Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Experimental::RLegend Class Reference

A legend for several drawables.

Author
Sergey Linev S.Lin.nosp@m.ev@g.nosp@m.si.de
Date
2019-10-09
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 33 of file RLegend.hxx.

Classes

class  RCustomDrawable
 Special drawable to let provide line, fill or marker attributes for legend. More...
class  REntry
 An entry in RLegend, references RDrawable and its attributes. More...

Public Types

enum  ECorner { kTopLeft = 1 , kTopRight = 2 , kBottomLeft = 3 , kBottomRight = 4 }
using Version_t = uint64_t

Public Member Functions

 RLegend ()
 RLegend (const RPadPos &offset, const RPadExtent &size)
 RLegend (const std::string &title)
void AddEntry (const std::shared_ptr< RDrawable > &drawable, const std::string &lbl, const std::string &opt="")
std::shared_ptr< RCustomDrawableAddEntry (const std::string &lbl, const std::string &opt="")
void ClearStyle ()
const std::string & GetCssClass () const
const char * GetCssType () const
auto & GetEntry (int n)
const std::string & GetId () const
const std::string & GetTitle () const
auto NumEntries () const
void SetCssClass (const std::string &cl)
void SetId (const std::string &id)
RLegendSetTitle (const std::string &title)
virtual void UseStyle (const std::shared_ptr< RStyle > &style)

Public Attributes

RAttrBorder border {this, "border"}
 ! border attributes
RAttrValue< ECornercorner {this, "corner", kTopRight}
 ! frame/pad corner to which pave is bound
RAttrFill fill {this, "fill"}
 ! fill attributes
RAttrValue< RPadLengthheight {this, "height", 0.2}
 ! pave height
RAttrValue< RPadLengthoffsetX {this, "offsetX", 0.02}
 ! offset X relative to selected frame or pad corner
RAttrValue< RPadLengthoffsetY {this, "offsetY", 0.02}
 ! offset Y relative to selected frame or pad corner
RAttrValue< boolonFrame {this, "onFrame", true}
 ! is pave assigned to frame (true) or to pad corner (false)
RAttrText text {this, "text"}
 ! text attributes
RAttrValue< RPadLengthwidth {this, "width", 0.4}
 ! pave width

Protected Member Functions

void CollectShared (Internal::RIOSharedVector_t &vect) override
std::unique_ptr< RDisplayItemDisplay (const RDisplayContext &) override
 hide I/O pointers when creating display item
virtual void Execute (const std::string &)
RAttrMapGetAttrMap ()
const RAttrMapGetAttrMap () const
Version_t GetVersion () const
virtual bool IsFrameRequired () 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.
void OnDisplayItemDestroyed (RDisplayItem *) const override
 when display item destroyed - restore I/O pointers
virtual void PopulateMenu (RMenuItems &)
void SetCssType (const char *csstype)
virtual void SetDrawableVersion (Version_t vers)

Private Attributes

RAttrMap fAttr
 attributes values
std::string fCssClass
 user-defined CSS class, used for RStyle
const char * fCssType {nullptr}
 ! drawable type, not stored in the root file, must be initialized in constructor
std::vector< REntryfEntries
 list of entries which should be displayed
std::string fId
 user-defined CSS id, used for RStyle
std::weak_ptr< RStylefStyle
 ! style applied for RDrawable, not stored when canvas is saved
std::string fTitle
 legend title
Version_t fVersion {1}
 ! drawable version, changed from the canvas

#include <ROOT/RLegend.hxx>

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

Member Typedef Documentation

◆ Version_t

using ROOT::Experimental::RDrawable::Version_t = uint64_t
inherited

Definition at line 123 of file RDrawable.hxx.

Member Enumeration Documentation

◆ ECorner

Enumerator
kTopLeft 
kTopRight 
kBottomLeft 
kBottomRight 

Definition at line 40 of file RPave.hxx.

Constructor & Destructor Documentation

◆ RLegend() [1/3]

ROOT::Experimental::RLegend::RLegend ( )
inline

Definition at line 164 of file RLegend.hxx.

◆ RLegend() [2/3]

ROOT::Experimental::RLegend::RLegend ( const std::string & title)
inline

Definition at line 166 of file RLegend.hxx.

◆ RLegend() [3/3]

ROOT::Experimental::RLegend::RLegend ( const RPadPos & offset,
const RPadExtent & size )
inline

Definition at line 168 of file RLegend.hxx.

Member Function Documentation

◆ AddEntry() [1/2]

void ROOT::Experimental::RLegend::AddEntry ( const std::shared_ptr< RDrawable > & drawable,
const std::string & lbl,
const std::string & opt = "" )
inline

Definition at line 187 of file RLegend.hxx.

◆ AddEntry() [2/2]

std::shared_ptr< RCustomDrawable > ROOT::Experimental::RLegend::AddEntry ( const std::string & lbl,
const std::string & opt = "" )
inline

Definition at line 179 of file RLegend.hxx.

◆ ClearStyle()

void ROOT::Experimental::RDrawable::ClearStyle ( )
inlineinherited

Definition at line 213 of file RDrawable.hxx.

◆ CollectShared()

void ROOT::Experimental::RLegend::CollectShared ( Internal::RIOSharedVector_t & vect)
inlineoverrideprotectedvirtual

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 129 of file RLegend.hxx.

◆ Display()

std::unique_ptr< RDisplayItem > ROOT::Experimental::RLegend::Display ( const RDisplayContext & )
inlineoverrideprotectedvirtual

hide I/O pointers when creating display item

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 139 of file RLegend.hxx.

◆ Execute()

void RDrawable::Execute ( const std::string & exec)
protectedvirtualinherited

Reimplemented in ROOT::Experimental::TObjectDrawable.

Definition at line 40 of file RDrawable.cxx.

◆ GetAttrMap() [1/2]

RAttrMap & ROOT::Experimental::RDrawable::GetAttrMap ( )
inlineprotectedinherited

Definition at line 185 of file RDrawable.hxx.

◆ GetAttrMap() [2/2]

const RAttrMap & ROOT::Experimental::RDrawable::GetAttrMap ( ) const
inlineprotectedinherited

Definition at line 186 of file RDrawable.hxx.

◆ GetCssClass()

const std::string & ROOT::Experimental::RDrawable::GetCssClass ( ) const
inlineinherited

Definition at line 218 of file RDrawable.hxx.

◆ GetCssType()

const char * ROOT::Experimental::RDrawable::GetCssType ( ) const
inlineinherited

Definition at line 215 of file RDrawable.hxx.

◆ GetEntry()

auto & ROOT::Experimental::RLegend::GetEntry ( int n)
inline

Definition at line 194 of file RLegend.hxx.

◆ GetId()

const std::string & ROOT::Experimental::RDrawable::GetId ( ) const
inlineinherited

Definition at line 221 of file RDrawable.hxx.

◆ GetTitle()

const std::string & ROOT::Experimental::RLegend::GetTitle ( ) const
inline

Definition at line 177 of file RLegend.hxx.

◆ GetVersion()

Version_t ROOT::Experimental::RDrawable::GetVersion ( ) const
inlineprotectedinherited

Definition at line 197 of file RDrawable.hxx.

◆ IsFrameRequired()

virtual bool ROOT::Experimental::RDrawable::IsFrameRequired ( ) const
inlineprotectedvirtualinherited

Reimplemented in ROOT::Experimental::RFrameTitle, and ROOT::Experimental::RPaletteDrawable.

Definition at line 183 of file RDrawable.hxx.

◆ MatchSelector()

bool RDrawable::MatchSelector ( const std::string & selector) const
protectedinherited

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.

Definition at line 59 of file RDrawable.cxx.

◆ NumEntries()

auto ROOT::Experimental::RLegend::NumEntries ( ) const
inline

Definition at line 192 of file RLegend.hxx.

◆ OnDisplayItemDestroyed()

void ROOT::Experimental::RLegend::OnDisplayItemDestroyed ( RDisplayItem * ) const
inlineoverrideprotectedvirtual

when display item destroyed - restore I/O pointers

Reimplemented from ROOT::Experimental::RDrawable.

Definition at line 152 of file RLegend.hxx.

◆ PopulateMenu()

void RDrawable::PopulateMenu ( RMenuItems & items)
protectedvirtualinherited

Reimplemented in ROOT::Experimental::RFrame, and ROOT::Experimental::TObjectDrawable.

Definition at line 30 of file RDrawable.cxx.

◆ SetCssClass()

void ROOT::Experimental::RDrawable::SetCssClass ( const std::string & cl)
inlineinherited

Definition at line 217 of file RDrawable.hxx.

◆ SetCssType()

void ROOT::Experimental::RDrawable::SetCssType ( const char * csstype)
inlineprotectedinherited

Definition at line 192 of file RDrawable.hxx.

◆ SetDrawableVersion()

virtual void ROOT::Experimental::RDrawable::SetDrawableVersion ( Version_t vers)
inlineprotectedvirtualinherited

Reimplemented in ROOT::Experimental::RPadBase.

Definition at line 196 of file RDrawable.hxx.

◆ SetId()

void ROOT::Experimental::RDrawable::SetId ( const std::string & id)
inlineinherited

Definition at line 220 of file RDrawable.hxx.

◆ SetTitle()

RLegend & ROOT::Experimental::RLegend::SetTitle ( const std::string & title)
inline

Definition at line 176 of file RLegend.hxx.

◆ UseStyle()

virtual void ROOT::Experimental::RDrawable::UseStyle ( const std::shared_ptr< RStyle > & style)
inlinevirtualinherited

Reimplemented in ROOT::Experimental::RPadBase.

Definition at line 212 of file RDrawable.hxx.

Member Data Documentation

◆ border

RAttrBorder ROOT::Experimental::RPave::border {this, "border"}
inherited

! border attributes

Definition at line 47 of file RPave.hxx.

◆ corner

RAttrValue<ECorner> ROOT::Experimental::RPave::corner {this, "corner", kTopRight}
inherited

! frame/pad corner to which pave is bound

Definition at line 53 of file RPave.hxx.

◆ fAttr

RAttrMap ROOT::Experimental::RDrawable::fAttr
privateinherited

attributes values

Definition at line 172 of file RDrawable.hxx.

◆ fCssClass

std::string ROOT::Experimental::RDrawable::fCssClass
privateinherited

user-defined CSS class, used for RStyle

Definition at line 175 of file RDrawable.hxx.

◆ fCssType

const char* ROOT::Experimental::RDrawable::fCssType {nullptr}
privateinherited

! drawable type, not stored in the root file, must be initialized in constructor

Definition at line 174 of file RDrawable.hxx.

◆ fEntries

std::vector<REntry> ROOT::Experimental::RLegend::fEntries
private

list of entries which should be displayed

Definition at line 126 of file RLegend.hxx.

◆ fId

std::string ROOT::Experimental::RDrawable::fId
privateinherited

user-defined CSS id, used for RStyle

Definition at line 176 of file RDrawable.hxx.

◆ fill

RAttrFill ROOT::Experimental::RPave::fill {this, "fill"}
inherited

! fill attributes

Definition at line 48 of file RPave.hxx.

◆ fStyle

std::weak_ptr<RStyle> ROOT::Experimental::RDrawable::fStyle
privateinherited

! style applied for RDrawable, not stored when canvas is saved

Definition at line 173 of file RDrawable.hxx.

◆ fTitle

std::string ROOT::Experimental::RLegend::fTitle
private

legend title

Definition at line 124 of file RLegend.hxx.

◆ fVersion

Version_t ROOT::Experimental::RDrawable::fVersion {1}
privateinherited

! drawable version, changed from the canvas

Definition at line 177 of file RDrawable.hxx.

◆ height

RAttrValue<RPadLength> ROOT::Experimental::RPave::height {this, "height", 0.2}
inherited

! pave height

Definition at line 51 of file RPave.hxx.

◆ offsetX

RAttrValue<RPadLength> ROOT::Experimental::RPave::offsetX {this, "offsetX", 0.02}
inherited

! offset X relative to selected frame or pad corner

Definition at line 54 of file RPave.hxx.

◆ offsetY

RAttrValue<RPadLength> ROOT::Experimental::RPave::offsetY {this, "offsetY", 0.02}
inherited

! offset Y relative to selected frame or pad corner

Definition at line 55 of file RPave.hxx.

◆ onFrame

RAttrValue<bool> ROOT::Experimental::RPave::onFrame {this, "onFrame", true}
inherited

! is pave assigned to frame (true) or to pad corner (false)

Definition at line 52 of file RPave.hxx.

◆ text

RAttrText ROOT::Experimental::RPave::text {this, "text"}
inherited

! text attributes

Definition at line 49 of file RPave.hxx.

◆ width

RAttrValue<RPadLength> ROOT::Experimental::RPave::width {this, "width", 0.4}
inherited

! pave width

Definition at line 50 of file RPave.hxx.

Collaboration diagram for ROOT::Experimental::RLegend:
[legend]

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