27namespace Experimental {
40 std::array<RPadLength::Pixel, 2>
fSize;
50 std::unique_ptr<Internal::RVirtualCanvasPainter>
fPainter;
61 static std::shared_ptr<RCanvas>
Create(
const std::string &title);
74 const std::array<RPadLength::Pixel, 2> &
GetSize()
const {
return fSize; }
91 void Show(
const std::string &where =
"");
100 template <
class PANEL>
103 return fPainter->AddPanel(panel->GetWindow());
116 void Run(
double tm = 0.);
131 std::array<RPadLength::Normal, 2>
PixelsToNormal(
const std::array<RPadLength::Pixel, 2> &pos)
const final
133 return {{pos[0] /
fSize[0], pos[1] /
fSize[1]}};
136 static const std::vector<std::shared_ptr<RCanvas>>
GetCanvases();
include TDocParser_001 C image html pict1_TDocParser_001 png width
static const std::vector< std::shared_ptr< RCanvas > > GetCanvases()
RCanvas(const RCanvas &)=delete
Disable copy construction for now.
RCanvas * GetCanvas() override
Access to the top-most canvas, if any (non-const version).
const std::string & GetTitle() const
Get the canvas's title.
RCanvas & SetSize(const RPadLength::Pixel &width, const RPadLength::Pixel &height)
Set canvas pixel size - width and height.
RCanvas & SetTitle(const std::string &title)
Set the canvas's title.
RCanvas & SetSize(const std::array< RPadLength::Pixel, 2 > &sz)
Set canvas pixel size as array with two elements - width and height.
std::array< RPadLength::Normal, 2 > PixelsToNormal(const std::array< RPadLength::Pixel, 2 > &pos) const final
Convert a Pixel position to Canvas-normalized positions.
std::array< RPadLength::Pixel, 2 > fSize
Size of the canvas in pixels,.
bool IsModified() const
Returns true is canvas was modified since last painting.
const std::array< RPadLength::Pixel, 2 > & GetSize() const
Return canvas pixel size as array with two elements - width and height.
RCanvas & operator=(const RCanvas &)=delete
Disable assignment for now.
void Show(const std::string &where="")
Display the canvas.
void Remove()
Remove canvas from global canvas lists, will be destroyed when shared_ptr will be removed.
void Run(double tm=0.)
Run canvas functionality for given time (in seconds)
std::string fTitle
use for ID generation
uint64_t fModified
Modify counter, incremented every time canvas is changed.
std::unique_ptr< Internal::RVirtualCanvasPainter > fPainter
The painter of this canvas, bootstrapping the graphics connection.
static std::shared_ptr< RCanvas > Create(const std::string &title)
RCanvas()=default
Create a temporary RCanvas; for long-lived ones please use Create().
const RCanvas * GetCanvas() const override
Access to the top-most canvas, if any (const version).
uint64_t fIdCounter
counter for objects, id==1 is canvas itself
void Update(bool async=false, CanvasCallback_t callback=nullptr)
update drawing
void SaveAs(const std::string &filename, bool async=false, CanvasCallback_t callback=nullptr)
Save canvas in image file.
bool AddPanel(std::shared_ptr< PANEL > &panel)
Insert panel into the canvas, canvas should be shown at this moment.
std::string GenerateUniqueId()
Generates unique ID inside the canvas.
void Hide()
Hide all canvas displays.
Base class for graphic containers for RDrawable-s.
std::function< void(bool)> CanvasCallback_t
Namespace for new ROOT classes and functions.
A pixel coordinate: 0 in the left, bottom corner, 1 in the top, right corner of the RPad.