Base class for graphic containers for RDrawable
-s.
Definition at line 37 of file RPadBase.hxx.
Classes | |
struct | BoundKindAndValue |
Simple struct representing an axis bound. More... | |
Public Types | |
using | Primitives_t = std::vector< std::shared_ptr< RDrawable > > |
Public Member Functions | |
virtual | ~RPadBase () |
void | AssignAutoColors () |
Method collect existing colors and assign new values if required. More... | |
void | CreateFrameIfNeeded () |
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. More... | |
template<class T , class... ARGS> | |
auto | Draw (ARGS... args) |
Create drawable of specified class T. More... | |
template<class T , class... ARGS> | |
auto | Draw (const std::shared_ptr< T > &what, ARGS... args) |
Add something to be painted. More... | |
auto | Draw (std::shared_ptr< RDrawable > &&drawable) |
Add existing drawable instance to canvas. More... | |
std::shared_ptr< RDrawable > | FindPrimitive (const std::string &id) const |
Find primitive with specified id. More... | |
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. More... | |
RPadUserAxisBase * | GetAxis (size_t dimension) const |
Get a pad axis from the RFrame. More... | |
virtual const RCanvas * | GetCanvas () const =0 |
Access to the top-most canvas, if any (const version). More... | |
virtual RCanvas * | GetCanvas ()=0 |
Access to the top-most canvas, if any (non-const version). More... | |
const RFrame * | GetFrame () const |
RPadUserAxisBase * | GetOrCreateAxis (size_t dimension) |
Get a pad axis from the RFrame. More... | |
RFrame * | GetOrCreateFrame () |
std::shared_ptr< RDrawable > | GetPrimitive (unsigned num) const |
returns primitive of given number More... | |
auto | GetPrimitives () const |
Get all primitives contained in the pad. More... | |
unsigned | NumPrimitives () const |
returns number of primitives in the pad More... | |
virtual std::array< RPadLength::Normal, 2 > | PixelsToNormal (const std::array< RPadLength::Pixel, 2 > &pos) const =0 |
Convert a Pixel position to Canvas-normalized positions. More... | |
bool | Remove (const std::shared_ptr< RDrawable > &drawable) |
Remove drawable from list of primitives. More... | |
bool | Remove (const std::string &id) |
Remove an object from the list of primitives. More... | |
bool | RemoveAt (unsigned indx) |
Remove drawable at specified position. More... | |
void | SetAllAxisAutoBounds () |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAllAxisBound (const std::vector< BoundKindAndValue > &vecBoundAndKind) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAllAxisBounds (const std::vector< std::array< double, 2 > > &vecBeginAndEnd) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisAutoBounds (int dimension) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisBound (int dimension, RPadUserAxisBase::EAxisBoundsKind boundsKind, double bound) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisBounds (int dimension, double begin, double end) |
Set the range of an axis as begin, end. More... | |
std::array< RPadLength::Normal, 2 > | UserToNormal (const std::array< RPadLength::User, 2 > &pos) const |
Convert user coordinates to normal coordinates. More... | |
void | UseStyle (const std::shared_ptr< RStyle > &style) override |
Use provided style for pad and all primitives inside. More... | |
void | Wipe () |
Wipe the pad by clearing the list of primitives. More... | |
Public Member Functions inherited from ROOT::Experimental::RDrawable | |
RDrawable (const std::string &type) | |
virtual | ~RDrawable () |
void | ClearStyle () |
virtual void | Execute (const std::string &) |
const std::string & | GetCssClass () const |
const std::string & | GetCssType () const |
const std::string & | GetId () const |
virtual void | PopulateMenu (RMenuItems &) |
Method can be used to provide menu items for the drawn object. More... | |
void | SetCssClass (const std::string &cl) |
void | SetId (const std::string &id) |
virtual void | UseStyle (const std::shared_ptr< RStyle > &style) |
Protected Member Functions | |
RPadBase () | |
Allow derived classes to default construct a RPadBase. More... | |
void | CollectShared (Internal::RIOSharedVector_t &) override |
Collect all shared items to resolve shared_ptr after IO. More... | |
void | DisplayPrimitives (RPadBaseDisplayItem &paditem) const |
Create display items for all primitives in the pad Each display item gets its special id, which used later for client-server communication. More... | |
Protected Member Functions inherited from ROOT::Experimental::RDrawable | |
virtual void | CollectShared (Internal::RIOSharedVector_t &) |
virtual std::unique_ptr< RDisplayItem > | Display () const |
Creates display item for drawable By default item contains drawble data itself. More... | |
RAttrMap & | GetAttrMap () |
const RAttrMap & | GetAttrMap () 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. More... | |
Private Types | |
using | Primitive_t = Internal::RIOShared< RDrawable > |
Private Member Functions | |
RPadBase (const RPadBase &)=delete | |
Disable copy construction. More... | |
RPadBase & | operator= (const RPadBase &)=delete |
Disable assignment. More... | |
Private Attributes | |
std::unique_ptr< RFrame > | fFrame |
RFrame with user coordinate system, if used by this pad. More... | |
std::vector< Primitive_t > | fPrimitives |
Content of the pad. More... | |
#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 66 of file RPadBase.hxx.
|
privatedelete |
Disable copy construction.
|
inlineprotected |
Allow derived classes to default construct a RPadBase.
Definition at line 58 of file RPadBase.hxx.
|
virtualdefault |
void ROOT::Experimental::RPadBase::AssignAutoColors | ( | ) |
Method collect existing colors and assign new values if required.
Definition at line 85 of file RPadBase.cxx.
|
overrideprotectedvirtual |
Collect all shared items to resolve shared_ptr after IO.
Reimplemented from ROOT::Experimental::RDrawable.
Definition at line 268 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::CreateFrameIfNeeded | ( | ) |
Definition at line 176 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.
Definition at line 112 of file RPadBase.cxx.
std::vector< std::vector< std::shared_ptr< ROOT::Experimental::RPad > > > ROOT::Experimental::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 138 of file RPadBase.cxx.
|
inline |
Create drawable of specified class T.
Definition at line 81 of file RPadBase.hxx.
|
inline |
Add something to be painted.
The pad observes what's lifetime through a weak pointer. Drawing options will be constructed through args
, which can be empty for default-constructed options.
Definition at line 102 of file RPadBase.hxx.
|
inline |
Add existing drawable instance to canvas.
Definition at line 91 of file RPadBase.hxx.
std::shared_ptr< ROOT::Experimental::RDrawable > ROOT::Experimental::RPadBase::FindPrimitive | ( | const std::string & | id | ) | const |
Find primitive with specified id.
Definition at line 38 of file RPadBase.cxx.
std::shared_ptr< ROOT::Experimental::RDrawable > ROOT::Experimental::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 62 of file RPadBase.cxx.
ROOT::Experimental::RPadUserAxisBase * ROOT::Experimental::RPadBase::GetAxis | ( | size_t | dimension | ) | const |
Get a pad axis from the RFrame.
dimension | - Index of the dimension of the RFrame user coordinate system. |
Definition at line 187 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.
|
inline |
Definition at line 174 of file RPadBase.hxx.
ROOT::Experimental::RPadUserAxisBase * ROOT::Experimental::RPadBase::GetOrCreateAxis | ( | size_t | dimension | ) |
Get a pad axis from the RFrame.
dimension | - Index of the dimension of the RFrame user coordinate system. |
Definition at line 198 of file RPadBase.cxx.
ROOT::Experimental::RFrame * ROOT::Experimental::RPadBase::GetOrCreateFrame | ( | ) |
Definition at line 170 of file RPadBase.cxx.
|
inline |
returns primitive of given number
Definition at line 116 of file RPadBase.hxx.
|
inline |
Get all primitives contained in the pad.
Definition at line 127 of file RPadBase.hxx.
|
inline |
returns number of primitives in the pad
Definition at line 113 of file RPadBase.hxx.
Disable assignment.
|
pure virtual |
Convert a Pixel
position to Canvas-normalized positions.
Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.
|
inline |
Remove drawable from list of primitives.
Definition at line 148 of file RPadBase.hxx.
|
inline |
Remove an object from the list of primitives.
Definition at line 136 of file RPadBase.hxx.
|
inline |
Remove drawable at specified position.
Definition at line 160 of file RPadBase.hxx.
void ROOT::Experimental::RPadBase::SetAllAxisAutoBounds | ( | ) |
Set the range of an axis as bound kind and bound (up or down).
Definition at line 280 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::SetAllAxisBound | ( | const std::vector< BoundKindAndValue > & | vecBoundAndKind | ) |
Set the range of an axis as bound kind and bound (up or down).
Definition at line 251 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::SetAllAxisBounds | ( | const std::vector< std::array< double, 2 > > & | vecBeginAndEnd | ) |
Set the range of an axis as bound kind and bound (up or down).
Definition at line 234 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::SetAxisAutoBounds | ( | int | dimension | ) |
Set the range of an axis as bound kind and bound (up or down).
Definition at line 225 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::SetAxisBound | ( | int | dimension, |
RPadUserAxisBase::EAxisBoundsKind | boundsKind, | ||
double | bound | ||
) |
Set the range of an axis as bound kind and bound (up or down).
Definition at line 216 of file RPadBase.cxx.
void ROOT::Experimental::RPadBase::SetAxisBounds | ( | int | dimension, |
double | begin, | ||
double | end | ||
) |
Set the range of an axis as begin, end.
Definition at line 207 of file RPadBase.cxx.
|
inline |
Convert user coordinates to normal coordinates.
Definition at line 203 of file RPadBase.hxx.
|
overridevirtual |
Use provided style for pad and all primitives inside.
Reimplemented from ROOT::Experimental::RDrawable.
Definition at line 28 of file RPadBase.cxx.
|
inline |
Wipe the pad by clearing the list of primitives.
Definition at line 169 of file RPadBase.hxx.
|
private |
RFrame with user coordinate system, if used by this pad.
Definition at line 48 of file RPadBase.hxx.
|
private |
Content of the pad.
Definition at line 45 of file RPadBase.hxx.