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 Member Functions

 RPad (TRootIOCtor *)
 Constructor must be used only for I/O.
 
virtual ~RPad ()
 Destructor to have a vtable.
 
const RCanvasGetCanvas () const override
 Access to the top-most canvas (const version).
 
RCanvasGetCanvas () override
 Access to the top-most canvas (non-const version).
 
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.
 
const RPadExtentGetSize () const
 Get the size of the pad in parent (!) coordinates.
 
void SetPos (const RPadPos &p)
 Set position.
 
void SetSize (const RPadExtent &sz)
 Set the size of the pad in parent (!) coordinates.
 
- Public Member Functions inherited from ROOT::Experimental::RPadBase
virtual ~RPadBase ()
 
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.
 
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.
 
std::shared_ptr< RFrameGetFrame ()
 Get a frame object if exists.
 
const std::shared_ptr< RFrameGetFrame () const
 Get a frame object if exists.
 
std::shared_ptr< RDrawableGetPrimitive (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)
 

Public Attributes

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

Protected Member Functions

std::unique_ptr< RDisplayItemDisplay (const RDisplayContext &) final
 Create pad display item.
 
- Protected Member Functions inherited from ROOT::Experimental::RPadBase
 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 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
 
RDrawableoperator= (const RDrawable &)=delete
 
virtual void PopulateMenu (RMenuItems &)
 
void SetCssType (const char *csstype)
 

Private Member Functions

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

Private Attributes

RPadBasefParent {nullptr}
 Pad containing this pad as a sub-pad.
 
RPadPos fPos
 pad position
 
RPadExtent fSize
 pad size
 

Friends

class RPadBase
 required to set parent
 

Additional Inherited Members

- Public Types inherited from ROOT::Experimental::RPadBase
using Primitives_t = std::vector< std::shared_ptr< RDrawable > >
 
- Public Types inherited from ROOT::Experimental::RDrawable
using Version_t = uint64_t
 

#include <ROOT/RPad.hxx>

Inheritance diagram for ROOT::Experimental::RPad:
[legend]

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 ( )
virtualdefault

Destructor to have a vtable.

Member Function Documentation

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

Friends And Related Symbol Documentation

◆ 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.

◆ 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.

◆ fSize

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

pad size

Definition at line 33 of file RPad.hxx.

Libraries for ROOT::Experimental::RPad:

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