Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveProjectionAxis.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel
3
4/*************************************************************************
5 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT7_REveProjectionAxis
13#define ROOT7_REveProjectionAxis
14
15#include <ROOT/REveText.hxx>
16
17#include <string>
18#include <vector>
19
20namespace ROOT {
21namespace Experimental {
22
24
26public:
27 /// Where the labelled values come from.
28 /// kValue round numbers in original space, unevenly spaced on screen
29 /// kPosition evenly spaced on screen, irregular label values
30 // clang-format off
32 // clang-format on
33
34 /// Which edges of the viewport carry an axis.
35 // clang-format off
37 // clang-format on
38
39 /// One tick: where it lands in projected space, what to write, and whether it
40 /// is a labelled (major) tick or a bare subdivision.
41 struct Tick_t {
42 // clang-format off
43 Float_t fPos{0}; ///< position along the axis, in projected coordinates
44 std::string fLabel; ///< empty for a minor tick
46 // clang-format on
47 };
48
49private:
52
53protected:
54 REveProjectionManager *fManager{nullptr}; ///<! held as an aunt, not owned
55
56 // clang-format off
59
60 /// Primary divisions * 100 + secondary divisions, decoded as
61 /// TEveProjectionAxes does, the reverse of TAttAxis. Finer than usual
62 /// because the client drops labels that do not fit.
64 Float_t fRangeFactor{2.0}; ///< tick range as a multiple of the manager's bbox extent, about its centre
65 /// Take the viewer's foreground colour instead of fTextColor/fLineColor, so
66 /// the axis stays legible when the background changes. On by default.
70 // clang-format on
71
72 std::vector<Tick_t> fTicks[2]; ///<! computed ticks, [0] horizontal, [1] vertical
73
74 REveText *fDistLabel{nullptr}; ///<! optional read-out of the distortion, not owned
75
76 void BuildTicks(Int_t ax);
77
78public:
79 REveProjectionAxis(REveProjectionManager *m, const Text_t *n = "REveProjectionAxis", const Text_t *t = "");
80 ~REveProjectionAxis() override;
81
83
84 // clang-format off
85 ELabMode_e GetLabMode() const { return fLabMode; }
87
88 EAxesMode_e GetAxesMode() const { return fAxesMode; }
90
91 Int_t GetNdivisions() const { return fNdivisions; }
93
96
97 Bool_t GetUseFgColor() const { return fUseFgColor; }
99
100 Bool_t GetDrawCenter() const { return fDrawCenter; }
102
103 Bool_t GetDrawOrigin() const { return fDrawOrigin; }
105 // clang-format on
106
107 void UpdateTicks();
108
110 void RemoveAunt(REveAunt *au) override;
112
113 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
114 void BuildRenderData() override;
115};
116
117} // namespace Experimental
118} // namespace ROOT
119
120#endif
#define f(i)
Definition RSha256.hxx:104
char Text_t
General string (char)
Definition RtypesCore.h:77
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
Manager class for steering of projections and managing projected objects.
ELabMode_e
Where the labelled values come from.
void RemoveAunt(REveAunt *au) override
Forget the projection manager when it is destroyed, then clear any click target as REveText does.
REveProjectionAxis(const REveProjectionAxis &)=delete
std::vector< Tick_t > fTicks[2]
! computed ticks, [0] horizontal, [1] vertical
void BuildRenderData() override
Render data.
EAxesMode_e
Which edges of the viewport carry an axis.
REveProjectionAxis & operator=(const REveProjectionAxis &)=delete
REveText * fDistLabel
! optional read-out of the distortion, not owned
REveProjectionManager * fManager
! held as an aunt, not owned
Float_t fRangeFactor
tick range as a multiple of the manager's bbox extent, about its centre
void UpdateDistortionLabel()
Rewrite the read-out.
Bool_t fUseFgColor
Take the viewer's foreground colour instead of fTextColor/fLineColor, so the axis stays legible when ...
REveProjectionManager * GetManager() const
void SetDistortionLabel(REveText *t)
Attach a text element that shows the current distortion.
Int_t fNdivisions
Primary divisions * 100 + secondary divisions, decoded as TEveProjectionAxes does,...
void UpdateTicks()
Recompute both tick sets.
void BuildTicks(Int_t ax)
Build the tick set for one screen axis, 0 horizontal and 1 vertical.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Stream style, mode and the tick sets.
REveProjectionManager Manager class for steering of projections and managing projected objects.
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
One tick: where it lands in projected space, what to write, and whether it is a labelled (major) tick...
Float_t fPos
position along the axis, in projected coordinates
TMarker m
Definition textangle.C:8