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 RAxisDrawable
25\ingroup GrafROOT7
26\brief Axis drawing
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
32class RAxisDrawable : public RDrawable {
33
34 RPadPos fPos; ///< axis start point
35 bool fVertical{false}; ///< is vertical axis
36 RPadLength fLength; ///< axis length
37 std::vector<std::string> fLabels; ///< axis labels
38
39public:
40
41 RAttrAxis axis{this, "axis"}; ///<! axis attributes
42
43 RAxisDrawable() : RDrawable("axis") {}
44
45 RAxisDrawable(const RPadPos &pos, bool vertical, const RPadLength &len) : RAxisDrawable()
46 {
47 SetPos(pos);
48 SetVertical(vertical);
49 SetLength(len);
50 }
51
52 RAxisDrawable &SetPos(const RPadPos &pos) { fPos = pos; return *this; }
53 RAxisDrawable &SetVertical(bool vertical = true) { fVertical = vertical; return *this; }
54 RAxisDrawable &SetLength(const RPadLength &len) { fLength = len; return *this; }
55 RAxisDrawable &SetLabels(const std::vector<std::string> &lbls) { fLabels = lbls; return *this; }
56
57 bool IsVertical() const { return fVertical; }
58 const RPadPos& GetPos() const { return fPos; }
59 const RPadLength& GetLength() const { return fLength; }
60 const std::vector<std::string> &GetLabels() const { return fLabels; }
61};
62
63
64
65} // namespace Experimental
66} // namespace ROOT
67
68#endif
All supported axes attributes for: line, ticks, labels, title, min/max, log, reverse,...
Definition RAttrAxis.hxx:99
RAttrAxis axis
! axis attributes
RAxisDrawable & SetPos(const RPadPos &pos)
RAxisDrawable(const RPadPos &pos, bool vertical, const RPadLength &len)
const RPadLength & GetLength() const
const std::vector< std::string > & GetLabels() const
RAxisDrawable & SetVertical(bool vertical=true)
const RPadPos & GetPos() const
RAxisDrawable & SetLength(const RPadLength &len)
RAxisDrawable & SetLabels(const std::vector< std::string > &lbls)
std::vector< std::string > fLabels
axis labels
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...