23namespace Experimental {
27class RPadBaseDisplayItem;
82 std::vector<std::vector<std::shared_ptr<RPad>>>
Divide(
int nHoriz,
int nVert,
const RPadExtent &padding = {});
85 template<
class T,
class...
ARGS>
88 auto drawable = std::make_shared<T>(args...);
98 auto Draw(std::shared_ptr<RDrawable> &&drawable)
110 template <
class T,
class...
ARGS>
133 std::shared_ptr<RDrawable>
FindPrimitive(
const std::string &
id)
const;
144 res.emplace_back(entry.get_shared());
161 bool Remove(
const std::shared_ptr<RDrawable> &drawable)
186 const std::shared_ptr<RFrame>
GetFrame()
const;
195 void SetAllAxisBounds(
const std::vector<std::array<double, 2>> &vecBeginAndEnd);
202 void SetAllAxisBound(
const std::vector<BoundKindAndValue> &vecBoundAndKind);
206 virtual std::array<RPadLength::Normal, 2>
PixelsToNormal(
const std::array<RPadLength::Pixel, 2> &pos)
const = 0;
215 std::array<RPadLength::Normal, 2>
UserToNormal(
const std::array<RPadLength::User, 2> &pos)
const;
Base class for drawable entities: objects that can be painted on a RPad.
virtual bool IsFrameRequired() const
class RPadBaseDisplayItem
Base class for graphic containers for RDrawable-s.
RPadBase & operator=(const RPadBase &)=delete
Disable assignment.
RPadBase(const RPadBase &)=delete
Disable copy construction.
std::shared_ptr< RFrame > GetFrame()
Get a frame object if exists.
auto Draw(std::shared_ptr< RDrawable > &&drawable)
Add existing drawable instance to canvas.
bool Remove(const std::shared_ptr< RDrawable > &drawable)
Remove drawable from list of primitives.
std::array< RPadLength::Normal, 2 > UserToNormal(const std::array< RPadLength::User, 2 > &pos) const
Convert user coordinates to normal coordinates.
std::shared_ptr< RFrame > GetOrCreateFrame()
Get a frame object for the pad.
virtual std::array< RPadLength::Normal, 2 > PixelsToNormal(const std::array< RPadLength::Pixel, 2 > &pos) const =0
Convert a Pixel position to Canvas-normalized positions.
void DisplayPrimitives(RPadBaseDisplayItem &paditem, RDisplayContext &ctxt)
Create display items for all primitives in the pad Each display item gets its special id,...
void UseStyle(const std::shared_ptr< RStyle > &style) override
Use provided style for pad and all primitives inside.
RPadBase()
Allow derived classes to default construct a RPadBase.
void CollectShared(Internal::RIOSharedVector_t &) override
Collect all shared items to resolve shared_ptr after IO.
auto Draw(ARGS... args)
Create drawable of specified class T.
std::vector< std::vector< std::shared_ptr< RPad > > > Divide(int nHoriz, int nVert, const RPadExtent &padding={})
Divide this pad into a grid of subpads with padding in between.
void TestIfFrameRequired(const RDrawable *drawable)
std::vector< std::shared_ptr< RDrawable > > Primitives_t
void SetAllAxisBound(const std::vector< BoundKindAndValue > &vecBoundAndKind)
Set the range of an axis as bound kind and bound (up or down).
void SetAxisBounds(int dimension, double begin, double end)
Set the range of an axis as begin, end.
std::shared_ptr< RDrawable > GetPrimitive(unsigned num) const
returns primitive of given number
virtual const RCanvas * GetCanvas() const =0
Access to the top-most canvas, if any (const version).
bool Remove(const std::string &id)
Remove an object from the list of primitives.
void SetAllAxisAutoBounds()
Set the range of an axis as bound kind and bound (up or down).
void SetDrawableVersion(Version_t vers) override
Assign drawable version - for pad itself and all primitives.
void SetAxisBound(int dimension, RPadUserAxisBase::EAxisBoundsKind boundsKind, double bound)
Set the range of an axis as bound kind and bound (up or down).
auto GetPrimitives() const
Get all primitives contained in the pad.
unsigned NumPrimitives() const
returns number of primitives in the pad
std::vector< Primitive_t > fPrimitives
Content of the pad.
void SetAllAxisBounds(const std::vector< std::array< double, 2 > > &vecBeginAndEnd)
Set the range of an axis as bound kind and bound (up or down).
virtual RCanvas * GetCanvas()=0
Access to the top-most canvas, if any (non-const version).
RPadUserAxisBase * GetAxis(size_t dimension) const
Get a pad axis from the RFrame.
bool RemoveAt(unsigned indx)
Remove drawable at specified position.
void AssignAutoColors()
Method collect existing colors and assign new values if required.
RPadUserAxisBase * GetOrCreateAxis(size_t dimension)
Get a pad axis from the RFrame.
auto Draw(const std::shared_ptr< T > &what, ARGS... args)
Add object to be painted.
std::shared_ptr< RDrawable > FindPrimitiveByDisplayId(const std::string &display_id) const
Find primitive with unique id, produce for RDisplayItem Such id used for client-server identification...
void Wipe()
Wipe the pad by clearing the list of primitives.
void SetAxisAutoBounds(int dimension)
Set the range of an axis as bound kind and bound (up or down).
std::shared_ptr< RDrawable > FindPrimitive(const std::string &id) const
Find primitive with specified id.
const RPadBase * FindPadForPrimitiveWithDisplayId(const std::string &display_id) const
Find subpad which contains primitive with given display id.
An extent / size (horizontal and vertical) in a RPad.
Base class for user coordinates (e.g.
EAxisBoundsKind
Types of axis bounds to respect by the painter.
@ kAxisBoundsAuto
no defined axis range; the painter will decide
std::vector< RIOSharedBase * > RIOSharedVector_t
auto GetDrawable(const std::shared_ptr< DRAWABLE > &drawable)
Central method to insert drawable in list of pad primitives By default drawable placed as is.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Simple struct representing an axis bound.
RPadUserAxisBase::EAxisBoundsKind fKind