Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveViewer.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 ROOT_TEveViewer
13 #define ROOT_TEveViewer
14 
15 #include "TEveElement.h"
16 #include "TEveWindow.h"
17 
18 class TGWindow;
19 class TGedEditor;
20 class TGLViewer;
21 class TGLSAViewer;
22 class TGLEmbeddedViewer;
23 
24 class TEveScene;
25 
26 /******************************************************************************/
27 // TEveViewer
28 /******************************************************************************/
29 
30 class TEveViewer : public TEveWindowFrame
31 {
32 private:
33  TEveViewer(const TEveViewer&); // Not implemented
34  TEveViewer& operator=(const TEveViewer&); // Not implemented
35 
36 protected:
37  TGLViewer *fGLViewer;
38  TGFrame *fGLViewerFrame;
39 
40  static Bool_t fgInitInternal;
41  static Bool_t fgRecreateGlOnDockOps;
42  static void InitInternal();
43 
44 public:
45  TEveViewer(const char* n="TEveViewer", const char* t="");
46  virtual ~TEveViewer();
47 
48  virtual void PreUndock();
49  virtual void PostDock();
50 
51  TGLViewer* GetGLViewer() const { return fGLViewer; }
52  void SetGLViewer(TGLViewer* viewer, TGFrame* frame);
53 
54  TGLSAViewer* SpawnGLViewer(TGedEditor* ged=0, Bool_t stereo=kFALSE, Bool_t quad_buf=kTRUE);
55  TGLEmbeddedViewer* SpawnGLEmbeddedViewer(TGedEditor* ged=0, Int_t border=0);
56 
57  void Redraw(Bool_t resetCameras=kFALSE);
58  void SwitchStereo();
59 
60  virtual void AddScene(TEveScene* scene);
61 
62  virtual void RemoveElementLocal(TEveElement* el);
63  virtual void RemoveElementsLocal();
64 
65  virtual TObject* GetEditorObject(const TEveException& eh="TEveViewer::GetEditorObject ") const;
66 
67  virtual Bool_t HandleElementPaste(TEveElement* el);
68 
69  virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE);
70 
71  ClassDef(TEveViewer, 0); // Reve representation of TGLViewer.
72 };
73 
74 
75 /******************************************************************************/
76 // TEveViewerList
77 /******************************************************************************/
78 
79 class TEveViewerList : public TEveElementList
80 {
81 private:
82  TEveViewerList(const TEveViewerList&); // Not implemented
83  TEveViewerList& operator=(const TEveViewerList&); // Not implemented
84 
85 protected:
86  Bool_t fShowTooltip;
87 
88  Float_t fBrightness;
89  Bool_t fUseLightColorSet;
90 
91  void HandleTooltip();
92 
93 public:
94  TEveViewerList(const char* n="TEveViewerList", const char* t="");
95  virtual ~TEveViewerList();
96 
97  virtual void AddElement(TEveElement* el);
98  virtual void RemoveElementLocal(TEveElement* el);
99  virtual void RemoveElementsLocal();
100 
101  // --------------------------------
102 
103  virtual void Connect();
104  virtual void Disconnect();
105 
106  void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals);
107  void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals);
108  void DeleteAnnotations();
109 
110  void SceneDestructing(TEveScene* scene);
111 
112  // --------------------------------
113 
114  void OnMouseOver(TObject* obj, UInt_t state);
115  void OnReMouseOver(TObject* obj, UInt_t state);
116  void OnUnMouseOver(TObject* obj, UInt_t state);
117  void OnClicked(TObject *obj, UInt_t button, UInt_t state);
118  void OnReClicked(TObject *obj, UInt_t button, UInt_t state);
119  void OnUnClicked(TObject *obj, UInt_t button, UInt_t state);
120 
121  // --------------------------------
122 
123  Bool_t GetShowTooltip() const { return fShowTooltip; }
124  void SetShowTooltip(Bool_t x) { fShowTooltip = x; }
125 
126  Float_t GetColorBrightness() const { return fBrightness; }
127  void SetColorBrightness(Float_t b);
128 
129  Bool_t UseLightColorSet() const { return fUseLightColorSet; }
130  void SwitchColorSet();
131 
132  ClassDef(TEveViewerList, 0); // List of Viewers providing common operations on TEveViewer collections.
133 };
134 
135 #endif