ROOT 6.18/05 Reference Guide |
A set of defaults for graphics attributes, e.g.
for histogram fill color, line width, frame offsets etc.
Definition at line 34 of file RStyle.hxx.
Public Types | |
using | Attrs_t = std::unordered_map< std::string, std::string > |
A map of attribute name to string attribute values/. More... | |
Public Member Functions | |
RStyle ()=default | |
Default constructor, creating an unnamed, empty style. More... | |
RStyle (std::string_view name) | |
Creates a named but empty style. More... | |
RStyle (std::string_view name, Attrs_t &&attrs) | |
Constructor taking the style name and a set of attributes (e.g. read from the config files). More... | |
std::string | GetAttribute (const std::string &attrName, const std::string &className={}) const |
Get the style value as a string, given an attribute name. More... | |
const std::string & | GetName () const |
Get this stryle's name. (No setter as that would upset the unordered_map.) More... | |
Static Public Member Functions | |
static RStyle * | Get (std::string_view name) |
Get the RStyle named name from the global style collection, or nullptr if that doesn't exist. More... | |
static RStyle & | GetCurrent () |
Get the current RStyle. More... | |
static RStyle & | Register (RStyle &&style) |
Move-register style in the global style collection, possibly replacing a global style with the same name. More... | |
static void | SetCurrent (const RStyle &style) |
Set the current RStyle by copying style into the static current style object. More... | |
Private Attributes | |
Attrs_t | fAttrs |
std::string | fName |
Mapping of user coordinates to normal coordinates. More... | |
#include <ROOT/RStyle.hxx>
using ROOT::Experimental::RStyle::Attrs_t = std::unordered_map<std::string, std::string> |
A map of attribute name to string attribute values/.
Definition at line 37 of file RStyle.hxx.
|
default |
Default constructor, creating an unnamed, empty style.
|
inlineexplicit |
Creates a named but empty style.
Definition at line 49 of file RStyle.hxx.
|
inline |
Constructor taking the style name and a set of attributes (e.g. read from the config files).
Definition at line 52 of file RStyle.hxx.
|
static |
Get the RStyle
named name
from the global style collection, or nullptr
if that doesn't exist.
Definition at line 56 of file RStyle.cxx.
std::string RStyle::GetAttribute | ( | const std::string & | attrName, |
const std::string & | className = {} |
||
) | const |
Get the style value as a string, given an attribute name.
Strips leading "foo." from the name until the first entry in the style is found. E.g. if the default style has not entry for "Hist.1D.Fill.Color", the value might be initialized to the default style's entry for the more general "1D.Fill.Color". The className is the name of a CSS-style class, possibly overriding the generic attribute.
Definition at line 87 of file RStyle.cxx.
|
static |
Get the current RStyle.
Definition at line 81 of file RStyle.cxx.
|
inline |
Get this stryle's name. (No setter as that would upset the unordered_map.)
Definition at line 55 of file RStyle.hxx.
Move-register style
in the global style collection, possibly replacing a global style with the same name.
Definition at line 49 of file RStyle.cxx.
Set the current RStyle by copying style
into the static current style object.
Definition at line 74 of file RStyle.hxx.
|
private |
Definition at line 42 of file RStyle.hxx.
|
private |
Mapping of user coordinates to normal coordinates.
Definition at line 41 of file RStyle.hxx.