Logo ROOT   6.14/05
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::TPadBase Class Referenceabstract

Base class for graphic containers for TDrawable-s.

Definition at line 41 of file TPad.hxx.

Classes

struct  BoundKindAndValue
 Simple struct representing an axis bound. More...
 

Public Types

using Primitives_t = std::vector< std::shared_ptr< TDrawable > >
 

Public Member Functions

virtual ~TPadBase ()
 
void CreateFrameIfNeeded ()
 
std::vector< std::vector< TPad * > > Divide (int nHoriz, int nVert, const TPadExtent &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>
auto Draw (std::unique_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...
 
std::shared_ptr< TDrawableFindDrawable (const std::string &id) const
 
TPadUserAxisBaseGetAxis (size_t dimension) const
 Get a pad axis from the TFrame. More...
 
virtual const TCanvasGetCanvas () const =0
 Access to the top-most canvas, if any (const version). More...
 
virtual TCanvasGetCanvas ()=0
 Access to the top-most canvas, if any (non-const version). More...
 
const TFrameGetFrame () const
 
TPadUserAxisBaseGetOrCreateAxis (size_t dimension)
 Get a pad axis from the TFrame. More...
 
TFrameGetOrCreateFrame ()
 
const Primitives_tGetPrimitives () const
 Get the elements contained in the canvas. More...
 
virtual std::array< TPadLength::Normal, 2 > PixelsToNormal (const std::array< TPadLength::Pixel, 2 > &pos) const =0
 Convert a Pixel position to Canvas-normalized positions. More...
 
bool Remove (TDrawingOptsBase &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, TPadUserAxisBase::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< TPadLength::Normal, 2 > UserToNormal (const std::array< TPadLength::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

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

Private Member Functions

 TPadBase (const TPadBase &)=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< TDrawable > &ptr)
 
TPadBaseoperator= (const TPadBase &)=delete
 Disable assignment. More...
 

Private Attributes

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

#include <ROOT/TPad.hxx>

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

Member Typedef Documentation

◆ Primitives_t

using ROOT::Experimental::TPadBase::Primitives_t = std::vector<std::shared_ptr<TDrawable> >

Definition at line 43 of file TPad.hxx.

Constructor & Destructor Documentation

◆ TPadBase() [1/2]

ROOT::Experimental::TPadBase::TPadBase ( const TPadBase )
privatedelete

Disable copy construction.

◆ TPadBase() [2/2]

ROOT::Experimental::TPadBase::TPadBase ( )
protecteddefault

Allow derived classes to default construct a TPadBase.

◆ ~TPadBase()

ROOT::Experimental::TPadBase::~TPadBase ( )
virtualdefault

Member Function Documentation

◆ AddDrawable()

template<class DRAWABLE >
auto ROOT::Experimental::TPadBase::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 TPad.hxx.

◆ AssignUniqueID()

void ROOT::Experimental::TPadBase::AssignUniqueID ( std::shared_ptr< TDrawable > &  ptr)
private

Definition at line 30 of file TPad.cxx.

◆ CreateFrameIfNeeded()

void ROOT::Experimental::TPadBase::CreateFrameIfNeeded ( )

Definition at line 106 of file TPad.cxx.

◆ Divide()

std::vector< std::vector< ROOT::Experimental::TPad * > > ROOT::Experimental::TPadBase::Divide ( int  nHoriz,
int  nVert,
const TPadExtent 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 TPad.cxx.

◆ Draw() [1/3]

template<class T , class... ARGS>
auto ROOT::Experimental::TPadBase::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 TPad.hxx.

◆ Draw() [2/3]

template<class T , class... ARGS>
auto ROOT::Experimental::TPadBase::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 TPad.hxx.

◆ Draw() [3/3]

template<class T , class... ARGS, class = typename std::enable_if<!ROOT::TypeTraits::IsSmartOrDumbPtr<T>::value>::type>
auto ROOT::Experimental::TPadBase::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 TPad.hxx.

◆ FindDrawable()

std::shared_ptr< ROOT::Experimental::TDrawable > ROOT::Experimental::TPadBase::FindDrawable ( const std::string &  id) const

Definition at line 44 of file TPad.cxx.

◆ GetAxis()

ROOT::Experimental::TPadUserAxisBase * ROOT::Experimental::TPadBase::GetAxis ( size_t  dimension) const

Get a pad axis from the TFrame.

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

Definition at line 118 of file TPad.cxx.

◆ GetCanvas() [1/2]

virtual const TCanvas* ROOT::Experimental::TPadBase::GetCanvas ( ) const
pure virtual

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

Implemented in ROOT::Experimental::TPad, and ROOT::Experimental::TCanvas.

◆ GetCanvas() [2/2]

virtual TCanvas* ROOT::Experimental::TPadBase::GetCanvas ( )
pure virtual

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

Implemented in ROOT::Experimental::TPad, and ROOT::Experimental::TCanvas.

◆ GetFrame()

const TFrame* ROOT::Experimental::TPadBase::GetFrame ( ) const
inline

Definition at line 138 of file TPad.hxx.

◆ GetOrCreateAxis()

ROOT::Experimental::TPadUserAxisBase * ROOT::Experimental::TPadBase::GetOrCreateAxis ( size_t  dimension)

Get a pad axis from the TFrame.

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

Definition at line 129 of file TPad.cxx.

◆ GetOrCreateFrame()

ROOT::Experimental::TFrame * ROOT::Experimental::TPadBase::GetOrCreateFrame ( )

Definition at line 100 of file TPad.cxx.

◆ GetPrimitives()

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

Get the elements contained in the canvas.

Definition at line 158 of file TPad.hxx.

◆ operator=()

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

Disable assignment.

◆ PixelsToNormal()

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

Convert a Pixel position to Canvas-normalized positions.

Implemented in ROOT::Experimental::TPad, and ROOT::Experimental::TCanvas.

◆ Remove()

bool ROOT::Experimental::TPadBase::Remove ( TDrawingOptsBase &  opts)
inline

Remove an object from the list of primitives.

Definition at line 118 of file TPad.hxx.

◆ SetAllAxisAutoBounds()

void ROOT::Experimental::TPadBase::SetAllAxisAutoBounds ( )

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

Definition at line 199 of file TPad.cxx.

◆ SetAllAxisBound()

void ROOT::Experimental::TPadBase::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 TPad.cxx.

◆ SetAllAxisBounds()

void ROOT::Experimental::TPadBase::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 TPad.cxx.

◆ SetAxisAutoBounds()

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

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

Definition at line 156 of file TPad.cxx.

◆ SetAxisBound()

void ROOT::Experimental::TPadBase::SetAxisBound ( int  dimension,
TPadUserAxisBase::EAxisBoundsKind  boundsKind,
double  bound 
)

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

Definition at line 147 of file TPad.cxx.

◆ SetAxisBounds()

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

Set the range of an axis as begin, end.

Definition at line 138 of file TPad.cxx.

◆ UserToNormal()

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

Convert user coordinates to normal coordinates.

Definition at line 170 of file TPad.hxx.

◆ Wipe()

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

Wipe the pad by clearing the list of primitives.

Definition at line 130 of file TPad.hxx.

Member Data Documentation

◆ fFrame

std::unique_ptr<TFrame> ROOT::Experimental::TPadBase::fFrame
private

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

Definition at line 50 of file TPad.hxx.

◆ fPrimitives

Primitives_t ROOT::Experimental::TPadBase::fPrimitives
private

Content of the pad.

Definition at line 47 of file TPad.hxx.

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

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