Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGLViewerEditor.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Alja Mrak-Tadel, Matevz Tadel, Timur Pocheptsov 08/03/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, 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_TGLViewerEditor
13 #define ROOT_TGLViewerEditor
14 
15 #include <memory>
16 
17 #include "TGedFrame.h"
18 
19 #include "TGLUtil.h"
20 
21 class TGCheckButton;
22 class TGNumberEntry;
23 class TGButtonGroup;
24 class TGroupFrame;
25 class TGRadioButton;
26 class TGColorSelect;
27 class TGComboBox;
28 class TGButton;
29 class TGTextEntry;
30 class TGLViewer;
31 class TGTab;
32 
33 class TGLLightSetSubEditor;
34 class TGLClipSetSubEditor;
35 
36 class TGLViewerEditor : public TGedFrame
37 {
38 private:
39  //Pointers to manipulate with tabs
40  TGCompositeFrame *fGuidesFrame;
41  TGCompositeFrame *fClipFrame;
42  TGCompositeFrame *fStereoFrame;
43 
44  TGLLightSetSubEditor *fLightSet;
45 
46  TGColorSelect *fClearColor;
47  TGCheckButton *fIgnoreSizesOnUpdate;
48  TGCheckButton *fResetCamerasOnUpdate;
49  TGTextButton *fUpdateScene;
50  TGTextButton *fCameraHome;
51 
52  TGNumberEntry *fMaxSceneDrawTimeHQ;
53  TGNumberEntry *fMaxSceneDrawTimeLQ;
54 
55  TGNumberEntry *fPointSizeScale;
56  TGNumberEntry *fLineWidthScale;
57  TGCheckButton *fPointSmooth;
58  TGCheckButton *fLineSmooth;
59  TGNumberEntry *fWFLineWidth;
60  TGNumberEntry *fOLLineWidth;
61 
62  //"Guides" tab's controls
63  TGCheckButton *fCameraCenterExt;
64  TGTextButton *fCaptureCenter;
65  TGCheckButton *fDrawCameraCenter;
66  TGNumberEntry *fCameraCenterX;
67  TGNumberEntry *fCameraCenterY;
68  TGNumberEntry *fCameraCenterZ;
69 
70  TGCheckButton* fCaptureAnnotate;
71 
72  Int_t fAxesType;
73  TGButtonGroup *fAxesContainer;
74  TGRadioButton *fAxesNone;
75  TGRadioButton *fAxesEdge;
76  TGRadioButton *fAxesOrigin;
77  TGCheckButton *fAxesDepthTest;
78 
79  TGGroupFrame *fRefContainer;
80  TGCheckButton *fReferenceOn;
81  TGNumberEntry *fReferencePosX;
82  TGNumberEntry *fReferencePosY;
83  TGNumberEntry *fReferencePosZ;
84 
85  TGGroupFrame *fCamContainer;
86  TGComboBox* fCamMode;
87  TGCheckButton* fCamOverlayOn;
88 
89  TGLClipSetSubEditor *fClipSet;
90 
91  //'Extras' tab.
92  TGCheckButton *fRotateSceneOn;
93  TGNumberEntry *fSceneRotDt;
94 
95  TGNumberEntry *fARotDt, *fARotWPhi;
96  TGNumberEntry *fARotATheta, *fARotWTheta;
97  TGNumberEntry *fARotADolly, *fARotWDolly;
98 
99  TGTextEntry *fASavImageGUIBaseName;
100  TGButtonGroup *fASavImageGUIOutMode;
101 
102  TGNumberEntry *fStereoZeroParallax;
103  TGNumberEntry *fStereoEyeOffsetFac;
104  TGNumberEntry *fStereoFrustumAsymFac;
105 
106  // Model
107  TGLViewer *fViewer;
108  Bool_t fIsInPad;
109 
110  void ConnectSignals2Slots();
111 
112  TGLViewerEditor(const TGLViewerEditor &);
113  TGLViewerEditor &operator = (const TGLViewerEditor &);
114 
115  void CreateStyleTab();
116  void CreateGuidesTab();
117  void CreateClippingTab();
118  void CreateExtrasTab();
119 
120  void UpdateReferencePosState();
121 
122 public:
123  TGLViewerEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30,
124  UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
125  ~TGLViewerEditor();
126 
127  virtual void ViewerRedraw();
128 
129  virtual void SetModel(TObject* obj);
130 
131  void SetGuides();
132  void DoClearColor(Pixel_t color);
133  void DoIgnoreSizesOnUpdate();
134  void DoResetCamerasOnUpdate();
135  void DoUpdateScene();
136  void DoCameraHome();
137  void UpdateMaxDrawTimes();
138  void UpdatePointLineStuff();
139  void DoCameraCenterExt();
140  void DoCaptureCenter();
141  void DoAnnotation();
142  void DoDrawCameraCenter();
143  void UpdateCameraCenter();
144  // Axis manipulation
145  void UpdateViewerAxes(Int_t id);
146  void UpdateViewerReference();
147  void DoCameraOverlay();
148  // Extras
149  void SetRotatorMode();
150  void UpdateRotator();
151  void DoRotatorStart();
152  void DoRotatorStop();
153  void DoASavImageGUIBaseName(const char* t);
154  void DoASavImageGUIOutMode(Int_t m);
155  void DoASavImageStart();
156  void DoASavImageStop();
157  void UpdateStereo();
158 
159  void DetachFromPad(){fIsInPad = kFALSE;}
160 
161  static TGNumberEntry* MakeLabeledNEntry(TGCompositeFrame* p, const char* name,
162  Int_t labelw, Int_t nd=7, Int_t s=5);
163 
164  ClassDef(TGLViewerEditor, 0); //GUI for editing TGLViewer attributes
165 };
166 
167 #endif