Logo ROOT   6.10/09
Reference Guide
TGeoTabManager.h
Go to the documentation of this file.
1 // @(#):$Id$
2 // Author: M.Gheata
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, 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_TGeoTabManager
13 #define ROOT_TGeoTabManager
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGeoTabManager //
18 // //
19 // Manager for editor tabs //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TGFrame.h"
24 
25 #include "TMap.h"
26 
27 class TVirtualPad;
28 class TClass;
29 
30 class TList;
31 class TGCompositeFrame;
32 class TGLabel;
33 class TGTab;
34 class TGComboBox;
35 class TGListTree;
36 class TGListTreeItem;
37 class TGCanvas;
38 
39 class TGedEditor;
40 
41 class TGeoShape;
42 class TGeoVolume;
43 class TGeoMedium;
44 class TGeoMaterial;
45 class TGeoMatrix;
46 
47 class TGeoTreeDialog;
48 class TGeoTransientPanel;
49 
50 class TGeoTabManager : public TObject {
51  friend class TGeoManagerEditor;
52 private:
53  TGedEditor *fGedEditor; // Parent editor
54  TVirtualPad *fPad; // Pad to which this applies
55  TGTab *fTab; // Parent tab
56  TGeoVolume *fVolume; // Edited volume
57  TGeoTransientPanel *fShapePanel; // Panel for editing shapes
58  TGeoTransientPanel *fMediumPanel; // Panel for editing media
59  TGeoTransientPanel *fMaterialPanel; // Panel for editing materials
60  TGeoTransientPanel *fMatrixPanel; // Panel for editing matrices
61  TGCompositeFrame *fVolumeTab; // Volume tab
62 
63  static TMap fgEditorToMgrMap; // Map from ged-editor to associated tab-manager
64 
65  void GetEditors(TClass *cl);
66 public:
68  virtual ~TGeoTabManager();
69 
71  static void Cleanup(TGCompositeFrame *frame);
72  TVirtualPad *GetPad() const {return fPad;}
73  TGTab *GetTab() const {return fTab;}
74  Int_t GetTabIndex() const;
75  static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p);
76  void SetVolTabEnabled(Bool_t flag=kTRUE);
77  void SetModel(TObject *model);
78  void SetTab();
79 
80  void GetShapeEditor(TGeoShape *shape);
81  void GetVolumeEditor(TGeoVolume *vol);
82  void GetMatrixEditor(TGeoMatrix *matrix);
83  void GetMediumEditor(TGeoMedium *medium);
84  void GetMaterialEditor(TGeoMaterial *material);
85 
87  TGeoVolume *GetVolume() const {return fVolume;}
88 
89  ClassDef(TGeoTabManager, 0) // Tab manager for geometry editors
90 };
91 
92 //////////////////////////////////////////////////////////////////////////
93 // //
94 // TGeoTreeDialog //
95 // //
96 // Dialog frame for selecting objects with a tree hierarchy //
97 // //
98 //////////////////////////////////////////////////////////////////////////
99 
101 
102 protected:
103  static TObject *fgSelectedObj; // Selected object
104  TGCanvas *fCanvas; // TGCanvas containing the list tree
105  TGLabel *fObjLabel; // Label for selected object
106  TGListTree *fLT; // List tree for selecting
107  TGCompositeFrame *f1; // Composite frame containing the selection
108  TGTextButton *fClose; // Close button
109 
110  virtual void BuildListTree() = 0;
111  virtual void ConnectSignalsToSlots() = 0;
112 public:
113  TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
114  virtual ~TGeoTreeDialog();
115 
116  static TObject *GetSelected();
117  // Slots
118  virtual void DoClose() = 0;
119  virtual void DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
120  void DoSelect(TGListTreeItem *item);
121 
122  ClassDef(TGeoTreeDialog, 0) // List-Tree based dialog
123 };
124 
125 //////////////////////////////////////////////////////////////////////////
126 // //
127 // TGeoVolumeDialog //
128 // //
129 // Special tree dialog class for selecting volumes. //
130 // //
131 //////////////////////////////////////////////////////////////////////////
132 
134 
135 protected:
136  virtual void BuildListTree();
137  virtual void ConnectSignalsToSlots();
138 
139 public:
140  TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
141  virtual ~TGeoVolumeDialog() {;}
142 
143  // Slots
144  virtual void DoClose();
145  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
146 
147  ClassDef(TGeoVolumeDialog, 0) // List-Tree based volume dialog
148 };
149 
150 //////////////////////////////////////////////////////////////////////////
151 // //
152 // TGeoShapeDialog //
153 // //
154 // Special tree dialog class for selecting shapes. //
155 // //
156 //////////////////////////////////////////////////////////////////////////
157 
159 
160 protected:
161  virtual void BuildListTree();
162  virtual void ConnectSignalsToSlots();
163 
164 public:
165  TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
166  virtual ~TGeoShapeDialog() {;}
167 
168  // Slots
169  virtual void DoClose();
170  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
171 
172  ClassDef(TGeoShapeDialog, 0) // List-Tree based shape dialog
173 };
174 
175 //////////////////////////////////////////////////////////////////////////
176 // //
177 // TGeoMediumDialog //
178 // //
179 // Special tree dialog class for selecting media. //
180 // //
181 //////////////////////////////////////////////////////////////////////////
182 
184 
185 protected:
186  virtual void BuildListTree();
187  virtual void ConnectSignalsToSlots();
188 
189 public:
190  TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
191  virtual ~TGeoMediumDialog() {;}
192 
193  // Slots
194  virtual void DoClose();
195  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
196 
197  ClassDef(TGeoMediumDialog, 0) // List-Tree based medium dialog
198 };
199 
200 //////////////////////////////////////////////////////////////////////////
201 // //
202 // TGeoMaterialDialog //
203 // //
204 // Special tree dialog class for selecting materials. //
205 // //
206 //////////////////////////////////////////////////////////////////////////
207 
209 
210 protected:
211  virtual void BuildListTree();
212  virtual void ConnectSignalsToSlots();
213 
214 public:
215  TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
216  virtual ~TGeoMaterialDialog() {;}
217 
218  // Slots
219  virtual void DoClose();
220  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
221 
222  ClassDef(TGeoMaterialDialog, 0) // List-Tree based material dialog
223 };
224 
225 //////////////////////////////////////////////////////////////////////////
226 // //
227 // TGeoMatrixDialog //
228 // //
229 // Special tree dialog class for selecting matrices. //
230 // //
231 //////////////////////////////////////////////////////////////////////////
232 
234 
235 protected:
236  virtual void BuildListTree();
237  virtual void ConnectSignalsToSlots();
238 
239 public:
240  TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
241  virtual ~TGeoMatrixDialog() {;}
242 
243  // Slots
244  virtual void DoClose();
245  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
246 
247  ClassDef(TGeoMatrixDialog, 0) // List-Tree based matrix dialog
248 };
249 
250 //////////////////////////////////////////////////////////////////////////
251 // //
252 // TGeoTransientPanel //
253 // //
254 // Special transient tab holding TGeo editors. //
255 // //
256 //////////////////////////////////////////////////////////////////////////
257 
259  TGedEditor *fGedEditor; // ged-editor steering this panel
260  TGCanvas *fCan; // TGCanvas containing a TGTab
261  TGTab *fTab; //tab widget holding the editor
262  TGCompositeFrame *fTabContainer; //main tab container
263  TGCompositeFrame *fStyle; //style tab container frame
264  TObject *fModel; //selected object
265  TGTextButton *fClose; //close button
266 
267 public:
268  TGeoTransientPanel(TGedEditor* ged, const char *name, TObject *obj);
269  virtual ~TGeoTransientPanel();
270 
271  virtual void CloseWindow();
272  virtual void DeleteEditors();
273 
274  TGTab *GetTab() const {return fTab;}
275  TGCompositeFrame *GetStyle() const {return fStyle;}
276  TObject *GetModel() const {return fModel;}
277 
278  void GetEditors(TClass *cl);
279  virtual void Hide();
280  virtual void Show();
281  void SetModel(TObject *model);
282 
283  ClassDef(TGeoTransientPanel, 0) // List-Tree based dialog
284 };
285 
286 #endif
TGCanvas * fCanvas
void SetTab()
Set a given tab element as active one.
Definition: TGTab.h:62
virtual ~TGeoMatrixDialog()
Geometrical transformation package.
Definition: TGeoMatrix.h:38
TGeoTabManager(TGedEditor *ged)
Ctor.
TGTab * GetTab() const
TH1 * h
Definition: legend2.C:5
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
TGCompositeFrame * fVolumeTab
Base class describing materials.
Definition: TGeoMaterial.h:29
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
TGListTree * fLT
void SetVolTabEnabled(Bool_t flag=kTRUE)
Enable/disable tabs.
virtual ~TGeoMediumDialog()
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hirarchically all daughters of a composite frame.
TGCompositeFrame * f1
#define ClassDef(name, id)
Definition: Rtypes.h:297
TVirtualPad * fPad
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
virtual ~TGeoMaterialDialog()
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:49
A doubly linked list.
Definition: TList.h:43
TGCompositeFrame * GetVolumeTab() const
TGeoTransientPanel * fMatrixPanel
TGLabel * fObjLabel
Base abstract class for all shapes.
Definition: TGeoShape.h:25
TGTab * GetTab() const
virtual ~TGeoTabManager()
Dtor.
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing...
unsigned int UInt_t
Definition: RtypesCore.h:42
TGCompositeFrame * fStyle
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
TGeoTransientPanel * fShapePanel
void GetEditors(TClass *cl)
Get editor for a class.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
TGCompositeFrame * fTabContainer
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
TGedEditor * fGedEditor
TVirtualPad * GetPad() const
void SetModel(TObject *model)
Send the SetModel signal to all editors in the tab TYPE.
virtual ~TGeoShapeDialog()
TGTextButton * fClose
Int_t GetTabIndex() const
Get index for a given tab element.
TGedEditor * fGedEditor
TGeoTransientPanel * fMediumPanel
TGeoTransientPanel * fMaterialPanel
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
TGCompositeFrame * GetStyle() const
static TMap fgEditorToMgrMap
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:23
Mother of all ROOT objects.
Definition: TObject.h:37
TObject * GetModel() const
TGeoVolume * GetVolume() const
static TObject * fgSelectedObj
virtual ~TGeoVolumeDialog()
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGTextButton * fClose
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
TGeoVolume * fVolume
int main(int argc, char **argv)
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.