Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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/RColor.hxx>
14 
15 #include <string>
16 
17 namespace ROOT {
18 namespace 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 
29 class RAttrText : public RAttrBase {
30 
31  RColor fColor{this, "color_"}; ///<! line color, will access container from line 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  const RColor &GetColor() const { return fColor; }
54  RColor &Color() { return fColor; }
55 
56 };
57 
58 
59 
60 } // namespace Experimental
61 } // namespace ROOT
62 
63 #endif