22namespace Experimental {
25 std::vector<std::string>
ids;
27 std::vector<std::unique_ptr<RAttrMap::Value_t>>
values;
35 std::unique_ptr<RDrawableReply>
Process()
override;
56 std::array<RPadLength::Pixel, 2>
fSize;
64 std::unique_ptr<Internal::RVirtualCanvasPainter>
fPainter;
76 static std::shared_ptr<RCanvas>
Create(
const std::string &title);
89 const std::array<RPadLength::Pixel, 2> &
GetSize()
const {
return fSize; }
107 void Show(
const std::string &where =
"");
119 template <
class PANEL>
123 return fPainter->AddPanel(panel->GetWindow());
139 void Run(
double tm = 0.);
142 bool SaveAs(
const std::string &filename);
157 std::array<RPadLength::Normal, 2>
PixelsToNormal(
const std::array<RPadLength::Pixel, 2> &pos)
const final
159 return {{pos[0] /
fSize[0], pos[1] /
fSize[1]}};
162 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()
Returns list of created canvases.
RCanvas(const RCanvas &)=delete
Disable copy construction for now.
static void ReleaseHeldCanvases()
Release list of held canvases pointers If no other shared pointers exists on the canvas,...
RCanvas * GetCanvas() override
Access to the top-most canvas, if any (non-const version).
const std::string & GetTitle() const
Get the canvas's title.
bool SaveAs(const std::string &filename)
Save canvas in image file.
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.
Version_t fModified
Modify counter, incremented every time canvas is changed.
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.
std::string GetWindowAddr() const
Returns window name used to display canvas.
void Remove()
Remove canvas from global canvas lists, will be destroyed when shared_ptr will be removed.
void ResolveSharedPtrs()
To resolve problem with storing of shared pointers Call this method when reading canvas from the file...
void Run(double tm=0.)
Run canvas functionality for given time (in seconds)
uint64_t GetModified() const
std::string fTitle
to apply attributes changes
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)
Create new canvas instance.
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).
friend class RCanvasPainter
use for ID generation
bool AddPanel(std::shared_ptr< PANEL > &panel)
Insert panel into the canvas, canvas should be shown at this moment.
void Hide()
Hide all canvas displays.
virtual ~RChangeAttrRequest()=default
std::vector< std::unique_ptr< RAttrMap::Value_t > > values
array of values
std::vector< std::string > names
array of attribute names
std::vector< std::string > ids
array of ids
bool NeedCanvasUpdate() const override
RChangeAttrRequest()=default
bool fNeedUpdate
! is canvas update required
RChangeAttrRequest & operator=(const RChangeAttrRequest &)=delete
bool update
update canvas at the end
std::unique_ptr< RDrawableReply > Process() override
Apply attributes changes to the drawable Return mask with actions which were really applied.
RChangeAttrRequest(const RChangeAttrRequest &)=delete
Base class for requests which can be submitted from the clients.
Base class for graphic containers for RDrawable-s.
void SetDrawableVersion(Version_t vers) override
Assign drawable version - for pad itself and all primitives.
std::function< void(bool)> CanvasCallback_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...