KaliVeda
Toolkit for HIC analysis
KVDrawable< Drawable > Class Template Reference

Detailed Description

template<typename Drawable>
class KVDrawable< Drawable >

Simple wrapper for objects which can be drawn (graphs, histograms)

A drawable is an object which has as one of its base classes: TAttLine, TAttFill, TAttMarker. Examples are: TH1 (and all daughter classes) and TGraph. KVDrawable wraps a pointer to one of these objects and makes it easy to select line colour, marker style, etc. and draw the object with a single instruction:

TGraph* some_graph = new TGraph;
KVDrawable d_gr{some_graph};
d_gr->Draw("alp"); // with '->' operator, directly access wrapped pointer
d_gr.LineColor(kRed).MarkerStyle(20).MarkerColor(kBlue).LineStyle(kDashed)->Draw("alp");
Simple wrapper for objects which can be drawn (graphs, histograms)
Definition: KVDrawable.h:29
void Draw(Option_t *chopt="") override

As can be seen, the different marker/line/fill style indications can be chained together.

Definition at line 29 of file KVDrawable.h.

#include <KVDrawable.h>

Public Member Functions

 KVDrawable (const KVDrawable &d)
 
 KVDrawable (Drawable *d)
 
 KVDrawable (KVDrawable &&d)
 
KVDrawableFillColor (int lc)
 
KVDrawableFillStyle (int lc)
 
KVDrawableLineColor (int lc)
 
KVDrawableLineStyle (int lc)
 
KVDrawableLineWidth (int lc)
 
KVDrawableMarkerColor (int lc)
 
KVDrawableMarkerSize (float lc)
 
KVDrawableMarkerStyle (int lc)
 
 operator Drawable * () const
 
Drawableoperator-> ()
 
KVDrawableoperator= (const KVDrawable &d)
 
KVDrawableoperator= (KVDrawable &&d)
 

Private Attributes

DrawablefDraw = nullptr
 

Constructor & Destructor Documentation

◆ KVDrawable() [1/3]

template<typename Drawable >
KVDrawable< Drawable >::KVDrawable ( Drawable d)
inline

Definition at line 32 of file KVDrawable.h.

◆ KVDrawable() [2/3]

template<typename Drawable >
KVDrawable< Drawable >::KVDrawable ( const KVDrawable< Drawable > &  d)
inline

Definition at line 34 of file KVDrawable.h.

◆ KVDrawable() [3/3]

template<typename Drawable >
KVDrawable< Drawable >::KVDrawable ( KVDrawable< Drawable > &&  d)
inline

Definition at line 36 of file KVDrawable.h.

Member Function Documentation

◆ FillColor()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::FillColor ( int  lc)
inline

Definition at line 78 of file KVDrawable.h.

◆ FillStyle()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::FillStyle ( int  lc)
inline

Definition at line 83 of file KVDrawable.h.

◆ LineColor()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::LineColor ( int  lc)
inline

Definition at line 63 of file KVDrawable.h.

◆ LineStyle()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::LineStyle ( int  lc)
inline

Definition at line 68 of file KVDrawable.h.

◆ LineWidth()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::LineWidth ( int  lc)
inline

Definition at line 73 of file KVDrawable.h.

◆ MarkerColor()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::MarkerColor ( int  lc)
inline

Definition at line 88 of file KVDrawable.h.

◆ MarkerSize()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::MarkerSize ( float  lc)
inline

Definition at line 98 of file KVDrawable.h.

◆ MarkerStyle()

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::MarkerStyle ( int  lc)
inline

Definition at line 93 of file KVDrawable.h.

◆ operator Drawable *()

template<typename Drawable >
KVDrawable< Drawable >::operator Drawable * ( ) const
inline

Definition at line 59 of file KVDrawable.h.

◆ operator->()

template<typename Drawable >
Drawable* KVDrawable< Drawable >::operator-> ( )
inline

Definition at line 55 of file KVDrawable.h.

◆ operator=() [1/2]

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::operator= ( const KVDrawable< Drawable > &  d)
inline

Definition at line 40 of file KVDrawable.h.

◆ operator=() [2/2]

template<typename Drawable >
KVDrawable& KVDrawable< Drawable >::operator= ( KVDrawable< Drawable > &&  d)
inline

Definition at line 47 of file KVDrawable.h.

Member Data Documentation

◆ fDraw

template<typename Drawable >
Drawable* KVDrawable< Drawable >::fDraw = nullptr
private

Definition at line 30 of file KVDrawable.h.