Logo ROOT  
Reference Guide
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);
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
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)
RPadPos fPos
axis start point
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.
Definition: RDrawable.hxx:108
A position (horizontal and vertical) in a RPad.
Definition: RPadPos.hxx:28
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.