forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREveViewer.hxx
More file actions
156 lines (114 loc) · 4.99 KB
/
Copy pathREveViewer.hxx
File metadata and controls
156 lines (114 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// @(#)root/eve7:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
/*************************************************************************
* Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT7_REveViewer
#define ROOT7_REveViewer
#include <ROOT/REveElement.hxx>
#include <ROOT/REveCamera.hxx>
namespace ROOT {
namespace Experimental {
class REveScene;
////////////////////////////////////////////////////////////////////////////////
/// REveViewer
/// Reve representation of TGLViewer.
////////////////////////////////////////////////////////////////////////////////
class REveViewer : public REveElement
{
public:
// set alias instead
using ECameraType = REveCamera::ECameraType;
// backward compatibility
static constexpr ECameraType kCameraPerspXOZ = REveCamera::kCameraPerspXOZ;
static constexpr ECameraType kCameraPerspYOZ = REveCamera::kCameraPerspYOZ;
static constexpr ECameraType kCameraPerspXOY = REveCamera::kCameraPerspXOY;
static constexpr ECameraType kCameraOrthoXOY = REveCamera::kCameraOrthoXOY;
static constexpr ECameraType kCameraOrthoXOZ = REveCamera::kCameraOrthoXOZ;
static constexpr ECameraType kCameraOrthoZOY = REveCamera::kCameraOrthoZOY;
static constexpr ECameraType kCameraOrthoZOX = REveCamera::kCameraOrthoZOX;
static constexpr ECameraType kCameraOrthoXnOY = REveCamera::kCameraOrthoXnOY;
static constexpr ECameraType kCameraOrthoXnOZ = REveCamera::kCameraOrthoXnOZ;
static constexpr ECameraType kCameraOrthoZnOY = REveCamera::kCameraOrthoZnOY;
static constexpr ECameraType kCameraOrthoZnOX = REveCamera::kCameraOrthoZnOX;
enum EAxesType {
kAxesNone,
kAxesOrigin,
kAxesEdge
};
private:
REveViewer(const REveViewer&) = delete;
REveViewer& operator=(const REveViewer&) = delete;
REveCamera* fCamera{0};
EAxesType fAxesType{kAxesNone};
bool fBlackBackground{false};
bool fMandatory{true};
std::string fPostStreamFlag;
std::vector<REveCamera*> fCameraList;
ROOT::Experimental::REveCamera* CreateCamera(ECameraType type);
bool fSyncCamera{true};
public:
REveViewer(const std::string &n="REveViewer", const std::string &t="");
~REveViewer() override;
void Redraw(Bool_t resetCameras=kFALSE);
virtual void AddScene(REveScene* scene);
// XXX Missing RemoveScene() ????
// Camera setters
void SetCamera(ROOT::Experimental::REveCamera *cam);
REveCamera* GetCamera() const { return fCamera;}
void SetCameraByElementId(ElementId_t cameraId); // set camera via ElementID
void SetCameraType(REveCamera::ECameraType type);
void SyncCamera(bool s) {fSyncCamera = s;}
bool GetSyncCamera() const {return fSyncCamera;}
void SetAxesType(int);
void SetBlackBackground(bool);
void DisconnectClient();
void ConnectClient();
void SetMandatory(bool x);
bool GetMandatory() { return fMandatory; }
void RemoveElementLocal(REveElement *el) override;
void RemoveElementsLocal() override;
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
};
////////////////////////////////////////////////////////////////////////////////
/// REveViewerList
/// List of Viewers providing common operations on REveViewer collections.
////////////////////////////////////////////////////////////////////////////////
class REveViewerList : public REveElement
{
private:
REveViewerList(const REveViewerList&) = delete;
REveViewerList& operator=(const REveViewerList&) = delete;
protected:
Bool_t fShowTooltip;
Float_t fBrightness;
Bool_t fUseLightColorSet;
public:
REveViewerList(const std::string &n="REveViewerList", const std::string &t="");
~REveViewerList() override;
void AddElement(REveElement* el) override;
void RemoveElementLocal(REveElement* el) override;
void RemoveElementsLocal() override;
// --------------------------------
virtual void Connect();
virtual void Disconnect();
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals);
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals);
void DeleteAnnotations();
void SceneDestructing(REveScene* scene);
// --------------------------------
Bool_t GetShowTooltip() const { return fShowTooltip; }
void SetShowTooltip(Bool_t x) { fShowTooltip = x; }
Float_t GetColorBrightness() const { return fBrightness; }
void SetColorBrightness(Float_t b);
Bool_t UseLightColorSet() const { return fUseLightColorSet; }
void SwitchColorSet();
// Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
};
} // namespace Experimental
} // namespace ROOT
#endif