Logo ROOT  
Reference Guide
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 ()=default
 Create a topmost, non-paintable pad. More...
 
 RPad (RPadBase *parent, const RPadPos &pos, const RPadExtent &size)
 Create a child pad. More...
 
virtual ~RPad ()
 Destructor to have a vtable. More...
 
RAttrLineAttrLine ()
 
const RAttrLineGetAttrLine () const
 
const RCanvasGetCanvas () const override
 Access to the top-most canvas (const version). More...
 
RCanvasGetCanvas () override
 Access to the top-most canvas (non-const version). More...
 
RPadBaseGetParent ()
 Access to the parent pad (non-const version). More...
 
const RPadBaseGetParent () const
 Access to the parent pad (const version). More...
 
const RPadPosGetPos () const
 Get the position of the pad in parent (!) coordinates. More...
 
const RPadExtentGetSize () const
 Get the size of the pad in parent (!) coordinates. More...
 
std::array< RPadLength::Normal, 2 > PixelsToNormal (const std::array< RPadLength::Pixel, 2 > &pos) const override
 Convert a Pixel position to Canvas-normalized positions. More...
 
RPadSetAttrLine (const RAttrLine &attr)
 
void SetPos (const RPadPos &p)
 Set position. More...
 
void SetSize (const RPadExtent &sz)
 Set the size of the pad in parent (!) coordinates. More...
 
std::array< RPadLength::Normal, 2 > ToNormal (const RPadPos &pos) const
 Convert a RPadPos to [x, y] of normalized coordinates. More...
 
- Public Member Functions inherited from ROOT::Experimental::RPadBase
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< RDrawableFindPrimitive (const std::string &id) const
 Find primitive with specified id. More...
 
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. More...
 
RPadUserAxisBaseGetAxis (size_t dimension) const
 Get a pad axis from the RFrame. More...
 
virtual const RCanvasGetCanvas () const =0
 Access to the top-most canvas, if any (const version). More...
 
virtual RCanvasGetCanvas ()=0
 Access to the top-most canvas, if any (non-const version). More...
 
const RFrameGetFrame () const
 
RPadUserAxisBaseGetOrCreateAxis (size_t dimension)
 Get a pad axis from the RFrame. More...
 
RFrameGetOrCreateFrame ()
 
std::shared_ptr< RDrawableGetPrimitive (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

std::unique_ptr< RDisplayItemDisplay () const final
 Create pad display item. More...
 
- Protected Member Functions inherited from ROOT::Experimental::RPadBase
 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< RDisplayItemDisplay () const
 Creates display item for drawable By default item contains drawble data itself. More...
 
RAttrMapGetAttrMap ()
 
const RAttrMapGetAttrMap () 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 Attributes

RAttrLine fAttrLine {this, "border_"}
 ! border attributes More...
 
RPadBasefParent {nullptr}
 Pad containing this pad as a sub-pad. More...
 
RPadPos fPos
 pad position More...
 
RPadExtent fSize
 pad size More...
 

Additional Inherited Members

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

#include <ROOT/RPad.hxx>

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

Constructor & Destructor Documentation

◆ RPad() [1/2]

ROOT::Experimental::RPad::RPad ( )
default

Create a topmost, non-paintable pad.

◆ RPad() [2/2]

ROOT::Experimental::RPad::RPad ( RPadBase parent,
const RPadPos pos,
const RPadExtent size 
)
inline

Create a child pad.

Definition at line 45 of file RPad.hxx.

◆ ~RPad()

ROOT::Experimental::RPad::~RPad ( )
virtualdefault

Destructor to have a vtable.

Member Function Documentation

◆ AttrLine()

RAttrLine & ROOT::Experimental::RPad::AttrLine ( )
inline

Definition at line 76 of file RPad.hxx.

◆ Display()

std::unique_ptr< ROOT::Experimental::RDisplayItem > ROOT::Experimental::RPad::Display ( ) const
finalprotectedvirtual

Create pad display item.

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 25 of file RPad.cxx.

◆ GetAttrLine()

const RAttrLine & ROOT::Experimental::RPad::GetAttrLine ( ) const
inline

Definition at line 74 of file RPad.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 57 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 60 of file RPad.hxx.

◆ GetParent() [1/2]

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

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

Definition at line 54 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 51 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 63 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 66 of file RPad.hxx.

◆ PixelsToNormal()

std::array< RPadLength::Normal, 2 > ROOT::Experimental::RPad::PixelsToNormal ( const std::array< RPadLength::Pixel, 2 > &  pos) const
inlineoverridevirtual

Convert a Pixel position to Canvas-normalized positions.

Implements ROOT::Experimental::RPadBase.

Definition at line 79 of file RPad.hxx.

◆ SetAttrLine()

RPad & ROOT::Experimental::RPad::SetAttrLine ( const RAttrLine attr)
inline

Definition at line 75 of file RPad.hxx.

◆ SetPos()

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

Set position.

Definition at line 72 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 69 of file RPad.hxx.

◆ ToNormal()

std::array< RPadLength::Normal, 2 > ROOT::Experimental::RPad::ToNormal ( const RPadPos pos) const
inline

Convert a RPadPos to [x, y] of normalized coordinates.

Definition at line 93 of file RPad.hxx.

Member Data Documentation

◆ fAttrLine

RAttrLine ROOT::Experimental::RPad::fAttrLine {this, "border_"}
private

! border attributes

Definition at line 33 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 28 of file RPad.hxx.

◆ fPos

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

pad position

Definition at line 30 of file RPad.hxx.

◆ fSize

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

pad size

Definition at line 31 of file RPad.hxx.

Libraries for ROOT::Experimental::RPad:
[legend]

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