Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Experimental::RPad Class Reference

Graphic container for RDrawable-s.

Authors
Axel Naumann axel@.nosp@m.cern.nosp@m..ch Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Date
2017-07-06
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 25 of file RPad.hxx.

Public Types

using Primitives_t = std::vector<std::shared_ptr<RDrawable>>
using Version_t = uint64_t

Public Member Functions

 RPad (TRootIOCtor *)
 Constructor must be used only for I/O.
 ~RPad () override
 Destructor to have a vtable.
template<class T, class... ARGS>
std::shared_ptr< T > Add (ARGS... args)
 Add drawable of specified class T.
std::shared_ptr< RFrameAddFrame ()
 Add a frame object for the pad.
std::shared_ptr< RPadAddPad (const RPadPos &, const RPadExtent &)
 Add subpad.
void ClearStyle ()
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< RDrawableDraw (std::shared_ptr< RDrawable > &&drawable)
 Add existing drawable instance to canvas.
const RPadBaseFindPadForPrimitiveWithDisplayId (const std::string &display_id) const
 Find subpad which contains primitive with given display id.
std::shared_ptr< RDrawableFindPrimitive (const std::string &id) const
 Find primitive with specified id.
std::shared_ptr< RDrawableFindPrimitiveByDisplayId (const std::string &display_id) const
 Find primitive with unique id, produce for RDisplayItem Such id used for client-server identification of objects.
const RCanvasGetCanvas () const override
 Access to the top-most canvas (const version).
RCanvasGetCanvas () override
 Access to the top-most canvas (non-const version).
const std::string & GetCssClass () const
const char * GetCssType () const
std::shared_ptr< RFrameGetFrame ()
 Get a frame object if exists.
const std::shared_ptr< RFrameGetFrame () const
 Get a frame object if exists.
const std::string & GetId () const
RPadBaseGetParent ()
 Access to the parent pad (non-const version).
const RPadBaseGetParent () const
 Access to the parent pad (const version).
const RPadPosGetPos () const
 Get the position of the pad in parent (!) coordinates.
std::shared_ptr< RDrawableGetPrimitive (unsigned num) const
 returns primitive of given number
auto GetPrimitives () const
 Get all primitives contained in the pad.
const RPadExtentGetSize () const
 Get the size of the pad in parent (!) coordinates.
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 SetCssClass (const std::string &cl)
void SetId (const std::string &id)
void SetPos (const RPadPos &p)
 Set position.
void SetSize (const RPadExtent &sz)
 Set the size of the pad in parent (!) coordinates.
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 Attributes

RAttrBorder border {this, "border"}
 ! border attributes

Protected Member Functions

void CollectShared (Internal::RIOSharedVector_t &) override
 Collect all shared items to resolve shared_ptr after IO.
std::unique_ptr< RDisplayItemDisplay (const RDisplayContext &) final
 Create pad display item.
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.
virtual void Execute (const std::string &)
RAttrMapGetAttrMap ()
const RAttrMapGetAttrMap () 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
virtual void PopulateMenu (RMenuItems &)
void SetCssType (const char *csstype)
void SetDrawableVersion (Version_t vers) override
 Assign drawable version - for pad itself and all primitives.

Private Types

using Primitive_t = Internal::RIOShared<RDrawable>

Private Member Functions

 RPad ()
 Create default pad.
 RPad (const RPadPos &pos, const RPadExtent &size)
 Create a pad.
void SetParent (RPadBase *parent)
void TestIfFrameRequired (const RDrawable *drawable)

Private Attributes

RAttrMap fAttr
 attributes values
std::string fCssClass
 user-defined CSS class, used for RStyle
const char * fCssType {nullptr}
 ! drawable type, not stored in the root file, must be initialized in constructor
std::string fId
 user-defined CSS id, used for RStyle
RPadBasefParent {nullptr}
 Pad containing this pad as a sub-pad.
RPadPos fPos
 pad position
std::vector< Primitive_tfPrimitives
 Content of the pad.
RPadExtent fSize
 pad size
std::weak_ptr< RStylefStyle
 ! style applied for RDrawable, not stored when canvas is saved
Version_t fVersion {1}
 ! drawable version, changed from the canvas

Friends

class RPadBase
 required to set parent

#include <ROOT/RPad.hxx>

Inheritance diagram for ROOT::Experimental::RPad:
ROOT::Experimental::RPadBase ROOT::Experimental::RDrawable

Member Typedef Documentation

◆ Primitive_t

Definition at line 41 of file RPadBase.hxx.

◆ Primitives_t

using ROOT::Experimental::RPadBase::Primitives_t = std::vector<std::shared_ptr<RDrawable>>
inherited

Definition at line 71 of file RPadBase.hxx.

◆ Version_t

using ROOT::Experimental::RDrawable::Version_t = uint64_t
inherited

Definition at line 123 of file RDrawable.hxx.

Constructor & Destructor Documentation

◆ RPad() [1/3]

ROOT::Experimental::RPad::RPad ( )
inlineprivate

Create default pad.

Definition at line 36 of file RPad.hxx.

◆ RPad() [2/3]

ROOT::Experimental::RPad::RPad ( const RPadPos & pos,
const RPadExtent & size )
inlineprivate

Create a pad.

Definition at line 39 of file RPad.hxx.

◆ RPad() [3/3]

ROOT::Experimental::RPad::RPad ( TRootIOCtor * )
inline

Constructor must be used only for I/O.

Definition at line 58 of file RPad.hxx.

◆ ~RPad()

ROOT::Experimental::RPad::~RPad ( )
overridedefault

Destructor to have a vtable.

Member Function Documentation

◆ Add()

template<class T, class... ARGS>
std::shared_ptr< T > ROOT::Experimental::RPadBase::Add ( ARGS... args)
inlineinherited

Add drawable of specified class T.

Definition at line 108 of file RPadBase.hxx.

◆ AddFrame()

std::shared_ptr< RFrame > RPadBase::AddFrame ( )
inherited

Add a frame object for the pad.

If frame already exists - just return it

Definition at line 189 of file RPadBase.cxx.

◆ AddPad()

std::shared_ptr< RPad > RPadBase::AddPad ( const RPadPos & pos,
const RPadExtent & extent )
inherited

Add subpad.

Definition at line 138 of file RPadBase.cxx.

◆ ClearStyle()

void ROOT::Experimental::RDrawable::ClearStyle ( )
inlineinherited

Definition at line 213 of file RDrawable.hxx.

◆ CollectShared()

void RPadBase::CollectShared ( Internal::RIOSharedVector_t & vect)
overrideprotectedvirtualinherited

Collect all shared items to resolve shared_ptr after IO.

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 226 of file RPadBase.cxx.

◆ Display()

std::unique_ptr< RDisplayItem > RPad::Display ( const RDisplayContext & ctxt)
finalprotectedvirtual

Create pad display item.

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 27 of file RPad.cxx.

◆ DisplayPrimitives()

void RPadBase::DisplayPrimitives ( RPadBaseDisplayItem & paditem,
RDisplayContext & ctxt )
protectedinherited

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.

◆ Divide()

std::vector< std::vector< std::shared_ptr< RPad > > > RPadBase::Divide ( int nHoriz,
int nVert,
const RPadExtent & padding = {} )
inherited

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.

Parameters
nHorizNumber of horizontal pads.
nVertNumber of vertical pads.
paddingPadding between pads.
Returns
vector of vector (ret[x][y]) of created pads.

Definition at line 154 of file RPadBase.cxx.

◆ Draw() [1/3]

template<class T, class... ARGS>
std::shared_ptr< T > ROOT::Experimental::RPadBase::Draw ( ARGS... args)
inlineinherited

Create drawable of specified class T.

Definition at line 95 of file RPadBase.hxx.

◆ Draw() [2/3]

template<class T, class... ARGS>
auto ROOT::Experimental::RPadBase::Draw ( const std::shared_ptr< T > & what,
ARGS... args )
inlineinherited

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.

◆ Draw() [3/3]

std::shared_ptr< RDrawable > ROOT::Experimental::RPadBase::Draw ( std::shared_ptr< RDrawable > && drawable)
inlineinherited

Add existing drawable instance to canvas.

Definition at line 120 of file RPadBase.hxx.

◆ Execute()

void RDrawable::Execute ( const std::string & exec)
protectedvirtualinherited

Reimplemented in ROOT::Experimental::TObjectDrawable.

Definition at line 40 of file RDrawable.cxx.

◆ FindPadForPrimitiveWithDisplayId()

const RPadBase * RPadBase::FindPadForPrimitiveWithDisplayId ( const std::string & display_id) const
inherited

Find subpad which contains primitive with given display id.

Definition at line 87 of file RPadBase.cxx.

◆ FindPrimitive()

std::shared_ptr< RDrawable > RPadBase::FindPrimitive ( const std::string & id) const
inherited

Find primitive with specified id.

Definition at line 40 of file RPadBase.cxx.

◆ FindPrimitiveByDisplayId()

std::shared_ptr< RDrawable > RPadBase::FindPrimitiveByDisplayId ( const std::string & display_id) const
inherited

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.

◆ GetAttrMap() [1/2]

RAttrMap & ROOT::Experimental::RDrawable::GetAttrMap ( )
inlineprotectedinherited

Definition at line 185 of file RDrawable.hxx.

◆ GetAttrMap() [2/2]

const RAttrMap & ROOT::Experimental::RDrawable::GetAttrMap ( ) const
inlineprotectedinherited

Definition at line 186 of file RDrawable.hxx.

◆ GetCanvas() [1/2]

const RCanvas * ROOT::Experimental::RPad::GetCanvas ( ) const
inlineoverridevirtual

Access to the top-most canvas (const version).

Implements ROOT::Experimental::RPadBase.

Definition at line 70 of file RPad.hxx.

◆ GetCanvas() [2/2]

RCanvas * ROOT::Experimental::RPad::GetCanvas ( )
inlineoverridevirtual

Access to the top-most canvas (non-const version).

Implements ROOT::Experimental::RPadBase.

Definition at line 73 of file RPad.hxx.

◆ GetCssClass()

const std::string & ROOT::Experimental::RDrawable::GetCssClass ( ) const
inlineinherited

Definition at line 218 of file RDrawable.hxx.

◆ GetCssType()

const char * ROOT::Experimental::RDrawable::GetCssType ( ) const
inlineinherited

Definition at line 215 of file RDrawable.hxx.

◆ GetFrame() [1/2]

std::shared_ptr< RFrame > RPadBase::GetFrame ( )
inherited

Get a frame object if exists.

Definition at line 214 of file RPadBase.cxx.

◆ GetFrame() [2/2]

const std::shared_ptr< RFrame > RPadBase::GetFrame ( ) const
inherited

Get a frame object if exists.

Definition at line 202 of file RPadBase.cxx.

◆ GetId()

const std::string & ROOT::Experimental::RDrawable::GetId ( ) const
inlineinherited

Definition at line 221 of file RDrawable.hxx.

◆ GetParent() [1/2]

RPadBase * ROOT::Experimental::RPad::GetParent ( )
inline

Access to the parent pad (non-const version).

Definition at line 67 of file RPad.hxx.

◆ GetParent() [2/2]

const RPadBase * ROOT::Experimental::RPad::GetParent ( ) const
inline

Access to the parent pad (const version).

Definition at line 64 of file RPad.hxx.

◆ GetPos()

const RPadPos & ROOT::Experimental::RPad::GetPos ( ) const
inline

Get the position of the pad in parent (!) coordinates.

Definition at line 76 of file RPad.hxx.

◆ GetPrimitive()

std::shared_ptr< RDrawable > ROOT::Experimental::RPadBase::GetPrimitive ( unsigned num) const
inlineinherited

returns primitive of given number

Definition at line 135 of file RPadBase.hxx.

◆ GetPrimitives()

auto ROOT::Experimental::RPadBase::GetPrimitives ( ) const
inlineinherited

Get all primitives contained in the pad.

Definition at line 148 of file RPadBase.hxx.

◆ GetSize()

const RPadExtent & ROOT::Experimental::RPad::GetSize ( ) const
inline

Get the size of the pad in parent (!) coordinates.

Definition at line 79 of file RPad.hxx.

◆ GetVersion()

Version_t ROOT::Experimental::RDrawable::GetVersion ( ) const
inlineprotectedinherited

Definition at line 197 of file RDrawable.hxx.

◆ IsFrameRequired()

virtual bool ROOT::Experimental::RDrawable::IsFrameRequired ( ) const
inlineprotectedvirtualinherited

Reimplemented in ROOT::Experimental::RPaletteDrawable.

Definition at line 183 of file RDrawable.hxx.

◆ MatchSelector()

bool RDrawable::MatchSelector ( const std::string & selector) const
protectedinherited

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.

Definition at line 59 of file RDrawable.cxx.

◆ NumPrimitives()

unsigned ROOT::Experimental::RPadBase::NumPrimitives ( ) const
inlineinherited

returns number of primitives in the pad

Definition at line 132 of file RPadBase.hxx.

◆ OnDisplayItemDestroyed()

virtual void ROOT::Experimental::RDrawable::OnDisplayItemDestroyed ( RDisplayItem * ) const
inlineprotectedvirtualinherited

Definition at line 194 of file RDrawable.hxx.

◆ PopulateMenu()

void RDrawable::PopulateMenu ( RMenuItems & items)
protectedvirtualinherited

Reimplemented in ROOT::Experimental::RFrame, and ROOT::Experimental::TObjectDrawable.

Definition at line 30 of file RDrawable.cxx.

◆ Remove() [1/2]

bool ROOT::Experimental::RPadBase::Remove ( const std::shared_ptr< RDrawable > & drawable)
inlineinherited

Remove drawable from list of primitives.

Definition at line 169 of file RPadBase.hxx.

◆ Remove() [2/2]

bool ROOT::Experimental::RPadBase::Remove ( const std::string & id)
inlineinherited

Remove an object from the list of primitives.

Definition at line 157 of file RPadBase.hxx.

◆ RemoveAt()

bool ROOT::Experimental::RPadBase::RemoveAt ( unsigned indx)
inlineinherited

Remove drawable at specified position.

Definition at line 181 of file RPadBase.hxx.

◆ SetCssClass()

void ROOT::Experimental::RDrawable::SetCssClass ( const std::string & cl)
inlineinherited

Definition at line 217 of file RDrawable.hxx.

◆ SetCssType()

void ROOT::Experimental::RDrawable::SetCssType ( const char * csstype)
inlineprotectedinherited

Definition at line 192 of file RDrawable.hxx.

◆ SetDrawableVersion()

void RPadBase::SetDrawableVersion ( Version_t vers)
overrideprotectedvirtualinherited

Assign drawable version - for pad itself and all primitives.

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 238 of file RPadBase.cxx.

◆ SetId()

void ROOT::Experimental::RDrawable::SetId ( const std::string & id)
inlineinherited

Definition at line 220 of file RDrawable.hxx.

◆ SetParent()

void ROOT::Experimental::RPad::SetParent ( RPadBase * parent)
inlineprivate

Definition at line 46 of file RPad.hxx.

◆ SetPos()

void ROOT::Experimental::RPad::SetPos ( const RPadPos & p)
inline

Set position.

Definition at line 85 of file RPad.hxx.

◆ SetSize()

void ROOT::Experimental::RPad::SetSize ( const RPadExtent & sz)
inline

Set the size of the pad in parent (!) coordinates.

Definition at line 82 of file RPad.hxx.

◆ TestIfFrameRequired()

void ROOT::Experimental::RPadBase::TestIfFrameRequired ( const RDrawable * drawable)
inlineprivateinherited

Definition at line 53 of file RPadBase.hxx.

◆ UseStyle()

void RPadBase::UseStyle ( const std::shared_ptr< RStyle > & style)
overridevirtualinherited

Use provided style for pad and all primitives inside.

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 30 of file RPadBase.cxx.

◆ Wipe()

void ROOT::Experimental::RPadBase::Wipe ( )
inlineinherited

Wipe the pad by clearing the list of primitives.

Definition at line 190 of file RPadBase.hxx.

◆ RPadBase

friend class RPadBase
friend

required to set parent

Definition at line 27 of file RPad.hxx.

Member Data Documentation

◆ border

RAttrBorder ROOT::Experimental::RPad::border {this, "border"}

! border attributes

Definition at line 55 of file RPad.hxx.

◆ fAttr

RAttrMap ROOT::Experimental::RDrawable::fAttr
privateinherited

attributes values

Definition at line 172 of file RDrawable.hxx.

◆ fCssClass

std::string ROOT::Experimental::RDrawable::fCssClass
privateinherited

user-defined CSS class, used for RStyle

Definition at line 175 of file RDrawable.hxx.

◆ fCssType

const char* ROOT::Experimental::RDrawable::fCssType {nullptr}
privateinherited

! drawable type, not stored in the root file, must be initialized in constructor

Definition at line 174 of file RDrawable.hxx.

◆ fId

std::string ROOT::Experimental::RDrawable::fId
privateinherited

user-defined CSS id, used for RStyle

Definition at line 176 of file RDrawable.hxx.

◆ fParent

RPadBase* ROOT::Experimental::RPad::fParent {nullptr}
private

Pad containing this pad as a sub-pad.

The parent pad, if this pad has one.

Definition at line 30 of file RPad.hxx.

◆ fPos

RPadPos ROOT::Experimental::RPad::fPos
private

pad position

Definition at line 32 of file RPad.hxx.

◆ fPrimitives

std::vector<Primitive_t> ROOT::Experimental::RPadBase::fPrimitives
privateinherited

Content of the pad.

Definition at line 45 of file RPadBase.hxx.

◆ fSize

RPadExtent ROOT::Experimental::RPad::fSize
private

pad size

Definition at line 33 of file RPad.hxx.

◆ fStyle

std::weak_ptr<RStyle> ROOT::Experimental::RDrawable::fStyle
privateinherited

! style applied for RDrawable, not stored when canvas is saved

Definition at line 173 of file RDrawable.hxx.

◆ fVersion

Version_t ROOT::Experimental::RDrawable::fVersion {1}
privateinherited

! drawable version, changed from the canvas

Definition at line 177 of file RDrawable.hxx.


The documentation for this class was generated from the following files: