Logo ROOT  
Reference Guide
RAttrAxis.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_RAttrAxis
10#define ROOT7_RAttrAxis
11
12#include <ROOT/RAttrBase.hxx>
13#include <ROOT/RAttrLine.hxx>
14#include <ROOT/RAttrText.hxx>
15
16namespace ROOT {
17namespace Experimental {
18
19/** \class RAttrAxis
20\ingroup GpadROOT7
21\author Sergey Linev <s.linev@gsi.de>
22\date 2020-02-20
23\brief All kind of drawing a axis: line, text, ticks, min/max, log, invert, ...
24\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
25*/
26
27class RAttrAxis : public RAttrBase {
28
29 RAttrLine fAttrLine{this, "line_"}; ///<! axis line attributes
30 RAttrText fAttrText{this, "text_"}; ///<! axis text attributes
31
32 R__ATTR_CLASS(RAttrAxis, "axis_", AddDefaults(fAttrLine).AddDefaults(fAttrText)
33 .AddDouble("min", 0.).AddDouble("max", 1.)
34 .AddDouble("zoommin", 0.).AddDouble("zoommax", 0.)
35 .AddBool("log", false).AddBool("invert", false));
36
37 const RAttrLine &GetAttrLine() const { return fAttrLine; }
38 RAttrAxis &SetAttrLine(const RAttrLine &line) { fAttrLine = line; return *this; }
40
41 const RAttrText &GetAttrText() const { return fAttrText; }
42 RAttrAxis &SetAttrText(const RAttrText &text) { fAttrText = text; return *this; }
44
45 // min range, graphics will not show value less then this
46 RAttrAxis &SetMin(double min) { SetValue("min", min); return *this; }
47 RAttrAxis &SetMax(double max) { SetValue("max", max); return *this; }
48 double GetMin() const { return GetValue<double>("min"); }
49 double GetMax() const { return GetValue<double>("max"); }
50 bool HasMin() const { return HasValue<double>("min"); }
51 bool HasMax() const { return HasValue<double>("max"); }
52
53 RAttrAxis &SetMinMax(double min, double max) { SetMin(min); SetMax(max); return *this; }
54 void ClearMinMax() { ClearValue("min"); ClearValue("max"); }
55
56 RAttrAxis &SetZoomMin(double min) { SetValue("zoommin", min); return *this; }
57 RAttrAxis &SetZoomMax(double max) { SetValue("zoommax", max); return *this; }
58 double GetZoomMin() const { return GetValue<double>("zoommin"); }
59 double GetZoomMax() const { return GetValue<double>("zoommax"); }
60 bool HasZoomMin() const { return HasValue<double>("zoommin"); }
61 bool HasZoomMax() const { return HasValue<double>("zoommax"); }
62
63 RAttrAxis &SetZoomMinMax(double min, double max) { SetZoomMin(min); SetZoomMax(max); return *this; }
64 void ClearZoomMinMax() { ClearValue("zoommin"); ClearValue("zoommax"); }
65
66 RAttrAxis &SetLog(bool on = true) { SetValue("log", on); return *this; }
67 bool GetLog() const { return GetValue<bool>("log"); }
68
69 RAttrAxis &SetInvert(bool on = true) { SetValue("invert", on); return *this; }
70 bool GetInvert() const { return GetValue<bool>("invert"); }
71
72};
73
74} // namespace Experimental
75} // namespace ROOT
76
77#endif
#define R__ATTR_CLASS(ClassName, dflt_prefix, dflt_values)
Definition: RAttrBase.hxx:188
All kind of drawing a axis: line, text, ticks, min/max, log, invert, ...
Definition: RAttrAxis.hxx:27
RAttrAxis & SetLog(bool on=true)
Definition: RAttrAxis.hxx:66
RAttrAxis & SetZoomMinMax(double min, double max)
Definition: RAttrAxis.hxx:63
RAttrText fAttrText
! axis text attributes
Definition: RAttrAxis.hxx:30
RAttrAxis & SetMax(double max)
Definition: RAttrAxis.hxx:47
AddDouble("min", 0.).AddDouble("max"
RAttrAxis & SetAttrText(const RAttrText &text)
Definition: RAttrAxis.hxx:42
RAttrAxis & SetZoomMax(double max)
Definition: RAttrAxis.hxx:57
RAttrAxis & SetMinMax(double min, double max)
Definition: RAttrAxis.hxx:53
RAttrAxis & SetZoomMin(double min)
Definition: RAttrAxis.hxx:56
RAttrAxis & SetInvert(bool on=true)
Definition: RAttrAxis.hxx:69
RAttrAxis & SetMin(double min)
Definition: RAttrAxis.hxx:46
const RAttrLine & GetAttrLine() const
Definition: RAttrAxis.hxx:37
const RAttrText & GetAttrText() const
Definition: RAttrAxis.hxx:41
RAttrAxis & SetAttrLine(const RAttrLine &line)
Definition: RAttrAxis.hxx:38
AddBool("log", false).AddBool("invert"
RAttrLine fAttrLine
! axis line attributes
Definition: RAttrAxis.hxx:29
AddDouble("zoommin", 0.).AddDouble("zoommax"
Base class for all attributes, used with RDrawable.
Definition: RAttrBase.hxx:27
void ClearValue(const std::string &name)
Clear value if any with specified name.
Definition: RAttrBase.cxx:114
void SetValue(const std::string &name, bool value)
Set boolean value.
Definition: RAttrBase.cxx:133
Drawing line attributes for different objects.
Definition: RAttrLine.hxx:26
A text.attributes.
Definition: RAttrText.hxx:29
TText * text
TLine * line
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21