|
ROOT 6.12/07 Reference Guide |
The TCanvas keep track of TColors, integer and floating point attributes used by the drawing options, making them accessible from other drawing options.
The index into the table of the active attributes is wrapped into TDrawingAttrRef to make them type-safe (i.e. distinct for TColor, long long and double).
Definition at line 32 of file TCanvas.hxx.
Public Member Functions | |
| TDrawingAttrRef ()=default | |
| Construct an invalid reference. More... | |
| TDrawingAttrRef (TDrawingOptsBaseNoDefault &opts, const std::string &attrName, const PRIMITIVE &deflt, const std::vector< std::string_view > &optStrings={}) | |
| Construct a reference from its options object, name, default value and set of string options. More... | |
| operator bool () const | |
| Whether the reference is valid. More... | |
| operator size_t () const | |
| Get the underlying index. More... | |
Private Member Functions | |
| TDrawingAttrRef (size_t idx) | |
| Construct a reference given the index. More... | |
Private Attributes | |
| size_t | fIdx = (size_t)-1 |
The index in the relevant attribute table of TCanvas. More... | |
Friends | |
| class | Internal::TDrawingAttrTable< PRIMITIVE > |
#include <ROOT/TCanvas.hxx>
|
inlineexplicitprivate |
Construct a reference given the index.
Definition at line 51 of file TDrawingAttrs.hxx.
|
default |
Construct an invalid reference.
| TDrawingAttrRef::TDrawingAttrRef | ( | TDrawingOptsBaseNoDefault & | opts, |
| const std::string & | attrName, | ||
| const PRIMITIVE & | deflt, | ||
| const std::vector< std::string_view > & | optStrings = {} |
||
| ) |
Construct a reference from its options object, name, default value and set of string options.
Initializes the PRIMITIVE to the default value, as available in TDrawingOptsBase::GetDefaultCanvas(), or to deflt if no entry exists under the attribute name. The attribute name is opts.GetName() + "." + attrName. optStrings is only be used if PRIMITIVE is long long; the style setting is expected to be one of the strings, with the attribute's value the index of the string.
Definition at line 67 of file TDrawingAttrs.cxx.
|
inlineexplicit |
Whether the reference is valid.
Definition at line 72 of file TDrawingAttrs.hxx.
|
inline |
Get the underlying index.
Definition at line 69 of file TDrawingAttrs.hxx.
|
friend |
Definition at line 53 of file TDrawingAttrs.hxx.
|
private |
The index in the relevant attribute table of TCanvas.
Definition at line 48 of file TDrawingAttrs.hxx.