Base class for graphic containers for RDrawable
-s.
Definition at line 37 of file RPadBase.hxx.
Public Types | |
using | Primitives_t = std::vector< std::shared_ptr< RDrawable > > |
Public Types inherited from ROOT::Experimental::RDrawable | |
using | Version_t = uint64_t |
Public Member Functions | |
virtual | ~RPadBase () |
template<class T , class... ARGS> | |
std::shared_ptr< T > | Add (ARGS... args) |
Add drawable of specified class T. | |
std::shared_ptr< RFrame > | AddFrame () |
Add a frame object for the pad. | |
std::shared_ptr< RPad > | AddPad (const RPadPos &, const RPadExtent &) |
Add subpad. | |
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. | |
template<class T , class... ARGS> | |
std::shared_ptr< T > | Draw (ARGS... args) |
Create drawable of specified class T. | |
template<class T , class... ARGS> | |
auto | Draw (const std::shared_ptr< T > &what, ARGS... args) |
Add object to be painted. | |
std::shared_ptr< RDrawable > | Draw (std::shared_ptr< RDrawable > &&drawable) |
Add existing drawable instance to canvas. | |
const RPadBase * | FindPadForPrimitiveWithDisplayId (const std::string &display_id) const |
Find subpad which contains primitive with given display id. | |
std::shared_ptr< RDrawable > | FindPrimitive (const std::string &id) const |
Find primitive with specified id. | |
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 of objects. | |
virtual const RCanvas * | GetCanvas () const =0 |
Access to the top-most canvas, if any (const version). | |
virtual RCanvas * | GetCanvas ()=0 |
Access to the top-most canvas, if any (non-const version). | |
std::shared_ptr< RFrame > | GetFrame () |
Get a frame object if exists. | |
const std::shared_ptr< RFrame > | GetFrame () const |
Get a frame object if exists. | |
std::shared_ptr< RDrawable > | GetPrimitive (unsigned num) const |
returns primitive of given number | |
auto | GetPrimitives () const |
Get all primitives contained in the pad. | |
unsigned | NumPrimitives () const |
returns number of primitives in the pad | |
bool | Remove (const std::shared_ptr< RDrawable > &drawable) |
Remove drawable from list of primitives. | |
bool | Remove (const std::string &id) |
Remove an object from the list of primitives. | |
bool | RemoveAt (unsigned indx) |
Remove drawable at specified position. | |
void | UseStyle (const std::shared_ptr< RStyle > &style) override |
Use provided style for pad and all primitives inside. | |
void | Wipe () |
Wipe the pad by clearing the list of primitives. | |
Public Member Functions inherited from ROOT::Experimental::RDrawable | |
RDrawable (const char *csstype) | |
virtual | ~RDrawable () |
void | ClearStyle () |
const std::string & | GetCssClass () const |
const char * | GetCssType () const |
const std::string & | GetId () const |
void | SetCssClass (const std::string &cl) |
void | SetId (const std::string &id) |
Protected Member Functions | |
RPadBase (const char *csstype) | |
Allow derived classes to default construct a RPadBase. | |
void | CollectShared (Internal::RIOSharedVector_t &) override |
Collect all shared items to resolve shared_ptr after IO. | |
void | DisplayPrimitives (RPadBaseDisplayItem &paditem, RDisplayContext &ctxt) |
Create display items for all primitives in the pad Each display item gets its special id, which used later for client-server communication Second parameter is version id which already delivered to the client. | |
void | SetDrawableVersion (Version_t vers) override |
Assign drawable version - for pad itself and all primitives. | |
Protected Member Functions inherited from ROOT::Experimental::RDrawable | |
RDrawable (const RDrawable &)=delete | |
virtual std::unique_ptr< RDisplayItem > | Display (const RDisplayContext &) |
Creates display item for drawable By default item contains drawable data itself. | |
virtual void | Execute (const std::string &) |
RAttrMap & | GetAttrMap () |
const RAttrMap & | GetAttrMap () const |
Version_t | GetVersion () const |
virtual bool | IsFrameRequired () const |
bool | MatchSelector (const std::string &selector) const |
Preliminary method which checks if drawable matches with given selector Following selector are allowed: "type" or "#id" or ".class_name" Here type is drawable kind like 'rect' or 'pad' id is drawable identifier, specified with RDrawable::SetId() method class_name is drawable class name, specified with RDrawable::SetCssClass() method. | |
virtual void | OnDisplayItemDestroyed (RDisplayItem *) const |
RDrawable & | operator= (const RDrawable &)=delete |
virtual void | PopulateMenu (RMenuItems &) |
void | SetCssType (const char *csstype) |
Private Types | |
using | Primitive_t = Internal::RIOShared< RDrawable > |
Private Member Functions | |
RPadBase (const RPadBase &)=delete | |
Disable copy construction. | |
RPadBase & | operator= (const RPadBase &)=delete |
Disable assignment. | |
void | TestIfFrameRequired (const RDrawable *drawable) |
Private Attributes | |
std::vector< Primitive_t > | fPrimitives |
Content of the pad. | |
#include <ROOT/RPadBase.hxx>
|
private |
Definition at line 41 of file RPadBase.hxx.
using ROOT::Experimental::RPadBase::Primitives_t = std::vector<std::shared_ptr<RDrawable> > |
Definition at line 71 of file RPadBase.hxx.
|
privatedelete |
Disable copy construction.
|
inlineexplicitprotected |
Allow derived classes to default construct a RPadBase.
Definition at line 61 of file RPadBase.hxx.
|
virtualdefault |
|
inline |
Add drawable of specified class T.
Definition at line 108 of file RPadBase.hxx.
std::shared_ptr< RFrame > RPadBase::AddFrame | ( | ) |
Add a frame object for the pad.
If frame already exists - just return it
Definition at line 189 of file RPadBase.cxx.
std::shared_ptr< RPad > RPadBase::AddPad | ( | const RPadPos & | pos, |
const RPadExtent & | extent | ||
) |
Add subpad.
Definition at line 138 of file RPadBase.cxx.
|
overrideprotectedvirtual |
Collect all shared items to resolve shared_ptr after IO.
Reimplemented from ROOT::Experimental::RDrawable.
Definition at line 226 of file RPadBase.cxx.
|
protected |
Create display items for all primitives in the pad Each display item gets its special id, which used later for client-server communication Second parameter is version id which already delivered to the client.
Definition at line 112 of file RPadBase.cxx.
std::vector< std::vector< std::shared_ptr< RPad > > > RPadBase::Divide | ( | int | nHoriz, |
int | nVert, | ||
const RPadExtent & | padding = {} |
||
) |
Divide this pad into a grid of subpads with padding in between.
Divide pad on nHoriz X nVert subpads Return array of array of pads.
nHoriz | Number of horizontal pads. |
nVert | Number of vertical pads. |
padding | Padding between pads. |
Definition at line 154 of file RPadBase.cxx.
|
inline |
Create drawable of specified class T.
Definition at line 95 of file RPadBase.hxx.
|
inline |
Add object to be painted.
Correspondent drawable will be created via GetDrawable() function which should be defined and be accessed at calling time. If required, extra arguments for GetDrawable() function can be provided.
Definition at line 81 of file RPadBase.hxx.
|
inline |
Add existing drawable instance to canvas.
Definition at line 120 of file RPadBase.hxx.
const RPadBase * RPadBase::FindPadForPrimitiveWithDisplayId | ( | const std::string & | display_id | ) | const |
Find subpad which contains primitive with given display id.
Definition at line 87 of file RPadBase.cxx.
std::shared_ptr< RDrawable > RPadBase::FindPrimitive | ( | const std::string & | id | ) | const |
Find primitive with specified id.
Definition at line 40 of file RPadBase.cxx.
std::shared_ptr< RDrawable > RPadBase::FindPrimitiveByDisplayId | ( | const std::string & | display_id | ) | const |
Find primitive with unique id, produce for RDisplayItem Such id used for client-server identification of objects.
Definition at line 64 of file RPadBase.cxx.
|
pure virtual |
Access to the top-most canvas, if any (const version).
Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.
|
pure virtual |
Access to the top-most canvas, if any (non-const version).
Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.
std::shared_ptr< RFrame > RPadBase::GetFrame | ( | ) |
Get a frame object if exists.
Definition at line 214 of file RPadBase.cxx.
const std::shared_ptr< RFrame > RPadBase::GetFrame | ( | ) | const |
Get a frame object if exists.
Definition at line 202 of file RPadBase.cxx.
|
inline |
returns primitive of given number
Definition at line 135 of file RPadBase.hxx.
|
inline |
Get all primitives contained in the pad.
Definition at line 148 of file RPadBase.hxx.
|
inline |
returns number of primitives in the pad
Definition at line 132 of file RPadBase.hxx.
Disable assignment.
Remove drawable from list of primitives.
Definition at line 169 of file RPadBase.hxx.
|
inline |
Remove an object from the list of primitives.
Definition at line 157 of file RPadBase.hxx.
|
inline |
Remove drawable at specified position.
Definition at line 181 of file RPadBase.hxx.
Assign drawable version - for pad itself and all primitives.
Reimplemented from ROOT::Experimental::RDrawable.
Definition at line 238 of file RPadBase.cxx.
Definition at line 53 of file RPadBase.hxx.
Use provided style for pad and all primitives inside.
Reimplemented from ROOT::Experimental::RDrawable.
Definition at line 30 of file RPadBase.cxx.
|
inline |
Wipe the pad by clearing the list of primitives.
Definition at line 190 of file RPadBase.hxx.
|
private |
Content of the pad.
Definition at line 45 of file RPadBase.hxx.