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#include <ROOT/REveCamera.hxx>
17
18namespace ROOT {
19namespace Experimental {
20
21class REveScene;
22
23////////////////////////////////////////////////////////////////////////////////
24/// REveViewer
25/// Reve representation of TGLViewer.
26////////////////////////////////////////////////////////////////////////////////
27
28class REveViewer : public REveElement
29{
30public:
31 // set alias instead
33
34 // backward compatibility
46
52
53private:
54 REveViewer(const REveViewer&) = delete;
55 REveViewer& operator=(const REveViewer&) = delete;
56
58
60 bool fBlackBackground{false};
61
62 bool fMandatory{true};
63 std::string fPostStreamFlag;
64
65 std::vector<REveCamera*> fCameraList;
66
68
69 bool fSyncCamera{true};
70
71public:
72 REveViewer(const std::string &n="REveViewer", const std::string &t="");
73 ~REveViewer() override;
74
76
77 virtual void AddScene(REveScene* scene);
78 // XXX Missing RemoveScene() ????
79
80 // Camera setters
82 REveCamera* GetCamera() const { return fCamera;}
83 void SetCameraByElementId(ElementId_t cameraId); // set camera via ElementID
85
86 void SyncCamera(bool s) {fSyncCamera = s;}
87 bool GetSyncCamera() const {return fSyncCamera;}
88
89 void SetAxesType(int);
90 void SetBlackBackground(bool);
91
92 void DisconnectClient();
93 void ConnectClient();
94
95 void SetMandatory(bool x);
96 bool GetMandatory() { return fMandatory; }
97
98 void RemoveElementLocal(REveElement *el) override;
99 void RemoveElementsLocal() override;
100 Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
101};
102
103
104////////////////////////////////////////////////////////////////////////////////
105/// REveViewerList
106/// List of Viewers providing common operations on REveViewer collections.
107////////////////////////////////////////////////////////////////////////////////
108
110{
111private:
114
115protected:
117
120
121public:
122 REveViewerList(const std::string &n="REveViewerList", const std::string &t="");
123 ~REveViewerList() override;
124
125 void AddElement(REveElement* el) override;
126 void RemoveElementLocal(REveElement* el) override;
127 void RemoveElementsLocal() override;
128
129 // --------------------------------
130
131 virtual void Connect();
132 virtual void Disconnect();
133
136 void DeleteAnnotations();
137
139
140 // --------------------------------
141
144
147
149 void SwitchColorSet();
150 // Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override;
151};
152
153} // namespace Experimental
154} // namespace ROOT
155
156#endif
#define b(i)
Definition RSha256.hxx:100
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
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
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 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.
REveViewer Reve representation of TGLViewer.
static constexpr ECameraType kCameraPerspXOY
static constexpr ECameraType kCameraOrthoZOX
static constexpr ECameraType kCameraPerspYOZ
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.
static constexpr ECameraType kCameraOrthoXOZ
~REveViewer() override
Destructor.
void SetCamera(ROOT::Experimental::REveCamera *cam)
Set camera reference.
static constexpr ECameraType kCameraOrthoZOY
std::vector< REveCamera * > fCameraList
void RemoveElementsLocal() override
Remove all children, forwarded to GLViewer.
void SetCameraType(REveCamera::ECameraType type)
Set camera by type (backward compatibility with old API)
REveViewer(const REveViewer &)=delete
REveViewer & operator=(const REveViewer &)=delete
static constexpr ECameraType kCameraOrthoXnOZ
static constexpr ECameraType kCameraOrthoXnOY
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Stream Camera Info.
void SetCameraByElementId(ElementId_t cameraId)
void Redraw(Bool_t resetCameras=kFALSE)
Redraw viewer immediately.
virtual void AddScene(REveScene *scene)
Add 'scene' to the list of scenes.
static constexpr ECameraType kCameraOrthoXOY
ROOT::Experimental::REveCamera * CreateCamera(ECameraType type)
static constexpr ECameraType kCameraPerspXOZ
static constexpr ECameraType kCameraOrthoZnOX
REveCamera * GetCamera() const
static constexpr ECameraType kCameraOrthoZnOY
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
unsigned int ElementId_t
Definition REveTypes.hxx:28