Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RAxisDrawable.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2020, 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_RAxisDrawable
10#define ROOT7_RAxisDrawable
11
12#include <ROOT/RDrawable.hxx>
13#include <ROOT/RAttrAxis.hxx>
14#include <ROOT/RPadPos.hxx>
15#include <ROOT/RPadLength.hxx>
16#include <ROOT/RLogger.hxx>
17
18#include <vector>
19#include <string>
20
21namespace ROOT {
22namespace Experimental {
23
24/** \class RAxisDrawableBase
25\ingroup GrafROOT7
26\brief Axis base drawing - only attributes and position.
27\author Sergey Linev <S.Linev@gsi.de>
28\date 2020-11-03
29\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
30*/
31
33
34 RPadPos fPos; ///< axis start point
35 bool fVertical{false}; ///< is vertical axis
36 RPadLength fLength; ///< axis length
37 RAttrAxis fAttrAxis{this, "axis"}; ///<! axis attributes
38
39public:
40
42
43 RAxisDrawableBase(const RPadPos &pos, bool vertical, const RPadLength &len) : RAxisDrawableBase()
44 {
45 SetPos(pos);
46 SetVertical(vertical);
47 SetLength(len);
48 }
49
50 RAxisDrawableBase &SetPos(const RPadPos &pos) { fPos = pos; return *this; }
51 RAxisDrawableBase &SetVertical(bool vertical = true) { fVertical = vertical; return *this; }
52 RAxisDrawableBase &SetLength(const RPadLength &len) { fLength = len; return *this; }
53
54 bool IsVertical() const { return fVertical; }
55 const RPadPos& GetPos() const { return fPos; }
56 const RPadLength& GetLength() const { return fLength; }
57
58 const RAttrAxis &GetAttrAxis() const { return fAttrAxis; }
59 RAxisDrawableBase &SetAttrAxis(const RAttrAxis &attr) { fAttrAxis = attr; return *this; }
61};
62
63
64//////////////////////////////////////////////////////////////////////////////////////////////////////////
65
66/** \class RAxisDrawable
67\ingroup GrafROOT7
68\brief Plain axis drawing.
69\author Sergey Linev <S.Linev@gsi.de>
70\date 2020-11-03
71\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
72*/
73
75
76 double fMin{0}, fMax{100}; ///< axis minimum and maximum
77
78public:
79
80 RAxisDrawable() = default;
81
82 RAxisDrawable(const RPadPos &pos, bool vertical, const RPadLength &len) : RAxisDrawableBase(pos, vertical, len) {}
83
84 RAxisDrawable &SetMinMax(double min, double max) { fMin = min; fMax = max; return *this; }
85 double GetMin() const { return fMin; }
86 double GetMax() const { return fMax; }
87};
88
89
90//////////////////////////////////////////////////////////////////////////////////////////////////////////
91
92/** \class RAxisLabelsDrawable
93\ingroup GrafROOT7
94\brief Labels axis drawing.
95\author Sergey Linev <S.Linev@gsi.de>
96\date 2020-11-03
97\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
98*/
99
101
102 std::vector<std::string> fLabels; ///< axis labels
103
104public:
105
107
108 RAxisLabelsDrawable(const RPadPos &pos, bool vertical, const RPadLength &len) : RAxisDrawableBase(pos, vertical, len) {}
109
110 RAxisLabelsDrawable &SetLabels(const std::vector<std::string> &lbls) { fLabels = lbls; return *this; }
111 const std::vector<std::string> &GetLabels() const { return fLabels; }
112};
113
114
115} // namespace Experimental
116} // namespace ROOT
117
118#endif
All supported axes attributes for: line, ticks, labels, title, min/max, log, reverse,...
Definition RAttrAxis.hxx:29
Axis base drawing - only attributes and position.
RAxisDrawableBase & SetVertical(bool vertical=true)
RAxisDrawableBase & SetAttrAxis(const RAttrAxis &attr)
RAttrAxis fAttrAxis
! axis attributes
const RAttrAxis & GetAttrAxis() const
RAxisDrawableBase(const RPadPos &pos, bool vertical, const RPadLength &len)
RAxisDrawableBase & SetPos(const RPadPos &pos)
RAxisDrawableBase & SetLength(const RPadLength &len)
const RPadLength & GetLength() const
RAxisDrawable(const RPadPos &pos, bool vertical, const RPadLength &len)
RAxisDrawable & SetMinMax(double min, double max)
double fMax
axis minimum and maximum
std::vector< std::string > fLabels
axis labels
const std::vector< std::string > & GetLabels() const
RAxisLabelsDrawable(const RPadPos &pos, bool vertical, const RPadLength &len)
RAxisLabelsDrawable & SetLabels(const std::vector< std::string > &lbls)
Base class for drawable entities: objects that can be painted on a RPad.
A position (horizontal and vertical) in a RPad.
Definition RPadPos.hxx:28
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...