Logo ROOT  
Reference Guide
RAttrText.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RAttrText
10#define ROOT7_RAttrText
11
12#include <ROOT/RAttrBase.hxx>
13#include <ROOT/RAttrColor.hxx>
14
15#include <string>
16
17namespace ROOT {
18namespace Experimental {
19
20/** \class RAttrText
21\ingroup GpadROOT7
22\brief A text.attributes.
23\author Axel Naumann <axel@cern.ch>
24\date 2018-10-12
25\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
26*/
27
28
29class RAttrText : public RAttrBase {
30
31 RAttrColor fColor{this, "color_"}; ///<! text color, will access container from text attributes
32
33 R__ATTR_CLASS(RAttrText, "text_", AddDouble("size", 12.).AddDouble("angle", 0.).AddInt("align", 22).AddInt("font", 41).AddDefaults(fColor));
34
35 ///The text size
36 RAttrText &SetSize(double width) { SetValue("size", width); return *this; }
37 double GetSize() const { return GetValue<double>("size"); }
38
39 ///The text angle
40 RAttrText &SetAngle(double angle) { SetValue("angle", angle); return *this; }
41 double GetAngle() const { return GetValue<double>("angle"); }
42
43 ///The text alignment
44 RAttrText &SetAlign(int align) { SetValue("align", align); return *this; }
45 int GetAlign() const { return GetValue<int>("align"); }
46
47 ///The text font
48 RAttrText &SetFont(int font) { SetValue("font", font); return *this; }
49 int GetFont() const { return GetValue<int>("font"); }
50
51 ///The color of the text.
52 RAttrText &SetColor(const RColor &color) { fColor = color; return *this; }
53 RColor GetColor() const { return fColor.GetColor(); }
55
56};
57
58
59
60} // namespace Experimental
61} // namespace ROOT
62
63#endif
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
Base class for all attributes, used with RDrawable.
Definition: RAttrBase.hxx:27
void SetValue(const std::string &name, bool value)
Set boolean value.
Definition: RAttrBase.cxx:133
Access RColor from drawable attributes.
Definition: RAttrColor.hxx:33
RColor GetColor() const
Extract RColor for given attribute.
Definition: RAttrColor.hxx:95
A text.attributes.
Definition: RAttrText.hxx:29
R__ATTR_CLASS(RAttrText, "text_", AddDouble("size", 12.).AddDouble("angle", 0.).AddInt("align", 22).AddInt("font", 41).AddDefaults(fColor))
RAttrText & SetAlign(int align)
The text alignment.
Definition: RAttrText.hxx:44
RAttrText & SetAngle(double angle)
The text angle.
Definition: RAttrText.hxx:40
RAttrText & SetColor(const RColor &color)
The color of the text.
Definition: RAttrText.hxx:52
RAttrText & SetSize(double width)
The text size.
Definition: RAttrText.hxx:36
RAttrColor fColor
! text color, will access container from text attributes
Definition: RAttrText.hxx:31
RAttrText & SetFont(int font)
The text font.
Definition: RAttrText.hxx:48
The color class.
Definition: RColor.hxx:34
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21