Logo ROOT   6.16/01
Reference Guide
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Experimental::RPadBase Class Referenceabstract

Base class for graphic containers for RDrawable-s.

Definition at line 41 of file RPad.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 CreateFrameIfNeeded ()
 
std::vector< std::vector< 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 (const std::shared_ptr< T > &what, ARGS... args)
 Add something to be painted. More...
 
template<class T , class... ARGS, class = typename std::enable_if<!ROOT::TypeTraits::IsSmartOrDumbPtr<T>::value>::type>
auto Draw (const T &what, ARGS... args)
 Add a copy of something to be painted. More...
 
template<class T , class... ARGS>
auto Draw (std::unique_ptr< T > &&what, ARGS... args)
 Add something to be painted. More...
 
std::shared_ptr< RDrawableFindDrawable (const std::string &id) const
 
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 ()
 
const Primitives_tGetPrimitives () const
 Get the elements contained in the canvas. 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 (RDrawingOptsBase &opts)
 Remove an object from the list of primitives. 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 Wipe ()
 Wipe the pad by clearing the list of primitives. More...
 

Protected Member Functions

 RPadBase ()=default
 Allow derived classes to default construct a RPadBase. More...
 

Private Member Functions

 RPadBase (const RPadBase &)=delete
 Disable copy construction. More...
 
template<class DRAWABLE >
auto AddDrawable (std::shared_ptr< DRAWABLE > &&uPtr)
 Adds a DRAWABLE to fPrimitives, returning a shared_ptr to DRAWABLE::GetOptions(). More...
 
void AssignUniqueID (std::shared_ptr< RDrawable > &ptr)
 
RPadBaseoperator= (const RPadBase &)=delete
 Disable assignment. More...
 

Private Attributes

std::unique_ptr< RFramefFrame
 RFrame with user coordinate system, if used by this pad. More...
 
Primitives_t fPrimitives
 Content of the pad. More...
 

#include <ROOT/RPad.hxx>

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

Member Typedef Documentation

◆ Primitives_t

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

Definition at line 43 of file RPad.hxx.

Constructor & Destructor Documentation

◆ RPadBase() [1/2]

ROOT::Experimental::RPadBase::RPadBase ( const RPadBase )
privatedelete

Disable copy construction.

◆ RPadBase() [2/2]

ROOT::Experimental::RPadBase::RPadBase ( )
protecteddefault

Allow derived classes to default construct a RPadBase.

◆ ~RPadBase()

ROOT::Experimental::RPadBase::~RPadBase ( )
virtualdefault

Member Function Documentation

◆ AddDrawable()

template<class DRAWABLE >
auto ROOT::Experimental::RPadBase::AddDrawable ( std::shared_ptr< DRAWABLE > &&  uPtr)
inlineprivate

Adds a DRAWABLE to fPrimitives, returning a shared_ptr to DRAWABLE::GetOptions().

Definition at line 62 of file RPad.hxx.

◆ AssignUniqueID()

void ROOT::Experimental::RPadBase::AssignUniqueID ( std::shared_ptr< RDrawable > &  ptr)
private

Definition at line 30 of file RPad.cxx.

◆ CreateFrameIfNeeded()

void ROOT::Experimental::RPadBase::CreateFrameIfNeeded ( )

Definition at line 106 of file RPad.cxx.

◆ Divide()

std::vector< std::vector< 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.

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 65 of file RPad.cxx.

◆ Draw() [1/3]

template<class T , class... ARGS>
auto ROOT::Experimental::RPadBase::Draw ( const std::shared_ptr< T > &  what,
ARGS...  args 
)
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 93 of file RPad.hxx.

◆ Draw() [2/3]

template<class T , class... ARGS, class = typename std::enable_if<!ROOT::TypeTraits::IsSmartOrDumbPtr<T>::value>::type>
auto ROOT::Experimental::RPadBase::Draw ( const T &  what,
ARGS...  args 
)
inline

Add a copy of something to be painted.

Drawing options will be constructed through args, which can be empty for default-constructed options.

Definition at line 111 of file RPad.hxx.

◆ Draw() [3/3]

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

Add something to be painted.

The pad claims ownership. Drawing options will be constructed through args, which can be empty for default-constructed options.

Definition at line 102 of file RPad.hxx.

◆ FindDrawable()

std::shared_ptr< ROOT::Experimental::RDrawable > ROOT::Experimental::RPadBase::FindDrawable ( const std::string &  id) const

Definition at line 44 of file RPad.cxx.

◆ GetAxis()

ROOT::Experimental::RPadUserAxisBase * ROOT::Experimental::RPadBase::GetAxis ( size_t  dimension) const

Get a pad axis from the RFrame.

Parameters
dimension- Index of the dimension of the RFrame user coordinate system.

Definition at line 118 of file RPad.cxx.

◆ GetCanvas() [1/2]

virtual const RCanvas * ROOT::Experimental::RPadBase::GetCanvas ( ) const
pure virtual

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

Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.

◆ GetCanvas() [2/2]

virtual RCanvas * ROOT::Experimental::RPadBase::GetCanvas ( )
pure virtual

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

Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.

◆ GetFrame()

const RFrame * ROOT::Experimental::RPadBase::GetFrame ( ) const
inline

Definition at line 138 of file RPad.hxx.

◆ GetOrCreateAxis()

ROOT::Experimental::RPadUserAxisBase * ROOT::Experimental::RPadBase::GetOrCreateAxis ( size_t  dimension)

Get a pad axis from the RFrame.

Parameters
dimension- Index of the dimension of the RFrame user coordinate system.

Definition at line 129 of file RPad.cxx.

◆ GetOrCreateFrame()

ROOT::Experimental::RFrame * ROOT::Experimental::RPadBase::GetOrCreateFrame ( )

Definition at line 100 of file RPad.cxx.

◆ GetPrimitives()

const Primitives_t & ROOT::Experimental::RPadBase::GetPrimitives ( ) const
inline

Get the elements contained in the canvas.

Definition at line 158 of file RPad.hxx.

◆ operator=()

RPadBase & ROOT::Experimental::RPadBase::operator= ( const RPadBase )
privatedelete

Disable assignment.

◆ PixelsToNormal()

virtual std::array< RPadLength::Normal, 2 > ROOT::Experimental::RPadBase::PixelsToNormal ( const std::array< RPadLength::Pixel, 2 > &  pos) const
pure virtual

Convert a Pixel position to Canvas-normalized positions.

Implemented in ROOT::Experimental::RCanvas, and ROOT::Experimental::RPad.

◆ Remove()

bool ROOT::Experimental::RPadBase::Remove ( RDrawingOptsBase &  opts)
inline

Remove an object from the list of primitives.

Definition at line 118 of file RPad.hxx.

◆ SetAllAxisAutoBounds()

void ROOT::Experimental::RPadBase::SetAllAxisAutoBounds ( )

Set the range of an axis as bound kind and bound (up or down).

Definition at line 199 of file RPad.cxx.

◆ SetAllAxisBound()

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 182 of file RPad.cxx.

◆ SetAllAxisBounds()

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 165 of file RPad.cxx.

◆ SetAxisAutoBounds()

void ROOT::Experimental::RPadBase::SetAxisAutoBounds ( int  dimension)

Set the range of an axis as bound kind and bound (up or down).

Definition at line 156 of file RPad.cxx.

◆ SetAxisBound()

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 147 of file RPad.cxx.

◆ SetAxisBounds()

void ROOT::Experimental::RPadBase::SetAxisBounds ( int  dimension,
double  begin,
double  end 
)

Set the range of an axis as begin, end.

Definition at line 138 of file RPad.cxx.

◆ UserToNormal()

std::array< RPadLength::Normal, 2 > ROOT::Experimental::RPadBase::UserToNormal ( const std::array< RPadLength::User, 2 > &  pos) const
inline

Convert user coordinates to normal coordinates.

Definition at line 170 of file RPad.hxx.

◆ Wipe()

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

Wipe the pad by clearing the list of primitives.

Definition at line 130 of file RPad.hxx.

Member Data Documentation

◆ fFrame

std::unique_ptr<RFrame> ROOT::Experimental::RPadBase::fFrame
private

RFrame with user coordinate system, if used by this pad.

Definition at line 50 of file RPad.hxx.

◆ fPrimitives

Primitives_t ROOT::Experimental::RPadBase::fPrimitives
private

Content of the pad.

Definition at line 47 of file RPad.hxx.

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

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