Logo ROOT   6.12/07
Reference Guide
List of all members | 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.

Public Types

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

Public Member Functions

virtual ~TPadBase ()
 
std::vector< std::vector< TPad * > > Divide (int nHoriz, int nVert, const TPadExtent &padding={})
 Divide this pad into a grid of subpad with padding in between. More...
 
template<class T >
auto & Draw (const std::shared_ptr< T > &what)
 Add something to be painted. More...
 
template<class T >
auto & Draw (std::unique_ptr< T > &&what)
 Add something to be painted. The pad claims ownership. More...
 
template<class T , class = typename std::enable_if<!ROOT::TypeTraits::IsSmartOrDumbPtr<T>::value>::type>
auto & Draw (const T &what)
 Add a copy of something to be painted. 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 Primitives_tGetPrimitives () const
 Get the elements contained in the canvas. More...
 
virtual std::array< TPadCoord::Normal, 2 > PixelsToNormal (const std::array< TPadCoord::Pixel, 2 > &pos) const =0
 Convert a Pixel position to Canvas-normalized positions. More...
 
std::array< TPadCoord::Normal, 2 > UserToNormal (const std::array< TPadCoord::User, 2 > &pos) const
 Convert user coordinates to normal coordinates. More...
 
void Wipe ()
 Remove an object from 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::unique_ptr< DRAWABLE > &&uPtr)
 Adds a DRAWABLE to fPrimitives, returning the drawing options as given by DRAWABLE::Options(). More...
 
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::unique_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::unique_ptr< DRAWABLE > &&  uPtr)
inlineprivate

Adds a DRAWABLE to fPrimitives, returning the drawing options as given by DRAWABLE::Options().

Definition at line 60 of file TPad.hxx.

◆ 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 subpad 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 28 of file TPad.cxx.

◆ Draw() [1/3]

template<class T >
auto& ROOT::Experimental::TPadBase::Draw ( const std::shared_ptr< T > &  what)
inline

Add something to be painted.

The pad observes what's lifetime through a weak pointer.

Definition at line 84 of file TPad.hxx.

◆ Draw() [2/3]

template<class T >
auto& ROOT::Experimental::TPadBase::Draw ( std::unique_ptr< T > &&  what)
inline

Add something to be painted. The pad claims ownership.

Definition at line 92 of file TPad.hxx.

◆ Draw() [3/3]

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

Add a copy of something to be painted.

Definition at line 100 of file TPad.hxx.

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

◆ GetPrimitives()

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

Get the elements contained in the canvas.

Definition at line 116 of file TPad.hxx.

◆ operator=()

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

Disable assignment.

◆ PixelsToNormal()

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

Convert a Pixel position to Canvas-normalized positions.

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

◆ UserToNormal()

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

Convert user coordinates to normal coordinates.

Definition at line 128 of file TPad.hxx.

◆ Wipe()

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

Remove an object from the list of primitives.

Wipe the pad by clearing the list of primitives.

Definition at line 110 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: