Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveViewer.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
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_REveViewer
13#define ROOT7_REveViewer
14
15#include <ROOT/REveElement.hxx>
16
17namespace ROOT {
18namespace Experimental {
19
20class REveScene;
21
22////////////////////////////////////////////////////////////////////////////////
23/// REveViewer
24/// Reve representation of TGLViewer.
25////////////////////////////////////////////////////////////////////////////////
26
27class REveViewer : public REveElement
28{
29public:
31 {
32 // Perspective
33 kCameraPerspXOZ, // XOZ floor
34 kCameraPerspYOZ, // YOZ floor
35 kCameraPerspXOY, // XOY floor
36 // Orthographic
37 kCameraOrthoXOY, // Looking down Z axis, X horz, Y vert
38 kCameraOrthoXOZ, // Looking along Y axis, X horz, Z vert
39 kCameraOrthoZOY, // Looking along X axis, Z horz, Y vert
40 kCameraOrthoZOX, // Looking along Y axis, Z horz, X vert
41 // nOrthographic
42 kCameraOrthoXnOY, // Looking along Z axis, -X horz, Y vert
43 kCameraOrthoXnOZ, // Looking down Y axis, -X horz, Z vert
44 kCameraOrthoZnOY, // Looking down X axis, -Z horz, Y vert
45 kCameraOrthoZnOX // Looking down Y axis, -Z horz, X vert
46 };
47
53
54 // For the moment REveCamera is internal class
56 {
58 std::string fName;
61
62 public:
63 REveCamera() { Setup(kCameraPerspXOZ, "PerspXOZ", REveVector(-1.0, 0.0, 0.0), REveVector(0.0, 1.0, 0.0));}
65
66 void Setup(ECameraType type, const std::string& name, REveVector v1, REveVector v2);
67
68 ECameraType GetType() const { return fType; }
69
70 int WriteCoreJson(nlohmann::json &j, Int_t /*rnr_offset*/);
71 };
72
73private:
74 REveViewer(const REveViewer&) = delete;
75 REveViewer& operator=(const REveViewer&) = delete;
76
79 bool fBlackBackground{false};
80
81 bool fMandatory{true};
82 std::string fPostStreamFlag;
83
84public:
85 REveViewer(const std::string &n="REveViewer", const std::string &t="");
86 ~REveViewer() override;
87
89
90 virtual void AddScene(REveScene* scene);
91 // XXX Missing RemoveScene() ????
92
95
96 void SetAxesType(int);
97 void SetBlackBackground(bool);
98
99 void DisconnectClient();
100 void ConnectClient();
101
102 void SetMandatory(bool x);
103 bool GetMandatory() { return fMandatory; }
104
105 void RemoveElementLocal(REveElement *el) override;
106 void RemoveElementsLocal() override;
107 Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
108};
109
110
111////////////////////////////////////////////////////////////////////////////////
112/// REveViewerList
113/// List of Viewers providing common operations on REveViewer collections.
114////////////////////////////////////////////////////////////////////////////////
115
117{
118private:
121
122protected:
124
127
128 void HandleTooltip();
129
130public:
131 REveViewerList(const std::string &n="REveViewerList", const std::string &t="");
132 ~REveViewerList() override;
133
134 void AddElement(REveElement* el) override;
135 void RemoveElementLocal(REveElement* el) override;
136 void RemoveElementsLocal() override;
137
138 // --------------------------------
139
140 virtual void Connect();
141 virtual void Disconnect();
142
145 void DeleteAnnotations();
146
148
149 // --------------------------------
150
153
156
158 void SwitchColorSet();
159 // Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
160};
161
162} // namespace Experimental
163} // namespace ROOT
164
165#endif
#define b(i)
Definition RSha256.hxx:100
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
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 type
char name[80]
Definition TGX11.cxx:110
Eve representation of TGLScene.
REveViewerList List of Viewers providing common operations on REveViewer collections.
void RemoveElementsLocal() override
Decompoundofy children, call base-class version.
REveViewerList & operator=(const REveViewerList &)=delete
void AddElement(REveElement *el) override
Call base-class implementation.
~REveViewerList() override
Destructor.
void HandleTooltip()
Show / hide tooltip for various MouseOver events.
void SceneDestructing(REveScene *scene)
Callback done from a REveScene destructor allowing proper removal of the scene from affected viewers.
void SetColorBrightness(Float_t b)
Set color brightness.
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
virtual void Disconnect()
Disconnect from TGLViewer class-signals.
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint viewers that are tagged as changed.
void SwitchColorSet()
Switch background color.
REveViewerList(const REveViewerList &)=delete
virtual void Connect()
Connect to TGLViewer class-signals.
void DeleteAnnotations()
Delete annotations from all viewers.
void RemoveElementLocal(REveElement *el) override
Decompoundofy el, call base-class version.
void Setup(ECameraType type, const std::string &name, REveVector v1, REveVector v2)
int WriteCoreJson(nlohmann::json &j, Int_t)
REveViewer Reve representation of TGLViewer.
void RemoveElementLocal(REveElement *el) override
Remove element 'el' from the list of children and also remove appropriate GLScene from GLViewer's lis...
void DisconnectClient()
Function called from MIR when user closes one of the viewer window.
void ConnectClient()
Function called from MIR when user wants to stream unsubscribed view.
~REveViewer() override
Destructor.
void RemoveElementsLocal() override
Remove all children, forwarded to GLViewer.
REveViewer(const REveViewer &)=delete
void SetCameraType(ECameraType t)
REveViewer & operator=(const REveViewer &)=delete
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Stream Camera Info.
ECameraType GetCameraType() const
void Redraw(Bool_t resetCameras=kFALSE)
Redraw viewer immediately.
virtual void AddScene(REveScene *scene)
Add 'scene' to the list of scenes.
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
REveVectorT< Float_t > REveVector
Namespace for new ROOT classes and functions.