Logo ROOT   6.12/07
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 #include "TGFrame.h"
16 
17 #include "TMap.h"
18 
19 class TVirtualPad;
20 class TClass;
21 
22 class TList;
23 class TGCompositeFrame;
24 class TGLabel;
25 class TGTab;
26 class TGComboBox;
27 class TGListTree;
28 class TGListTreeItem;
29 class TGCanvas;
30 
31 class TGedEditor;
32 
33 class TGeoShape;
34 class TGeoVolume;
35 class TGeoMedium;
36 class TGeoMaterial;
37 class TGeoMatrix;
38 
39 class TGeoTreeDialog;
40 class TGeoTransientPanel;
41 
42 class TGeoTabManager : public TObject {
43  friend class TGeoManagerEditor;
44 private:
45  TGedEditor *fGedEditor; // Parent editor
46  TVirtualPad *fPad; // Pad to which this applies
47  TGTab *fTab; // Parent tab
48  TGeoVolume *fVolume; // Edited volume
49  TGeoTransientPanel *fShapePanel; // Panel for editing shapes
50  TGeoTransientPanel *fMediumPanel; // Panel for editing media
51  TGeoTransientPanel *fMaterialPanel; // Panel for editing materials
52  TGeoTransientPanel *fMatrixPanel; // Panel for editing matrices
53  TGCompositeFrame *fVolumeTab; // Volume tab
54 
55  static TMap fgEditorToMgrMap; // Map from ged-editor to associated tab-manager
56 
57  void GetEditors(TClass *cl);
58 public:
60  virtual ~TGeoTabManager();
61 
63  static void Cleanup(TGCompositeFrame *frame);
64  TVirtualPad *GetPad() const {return fPad;}
65  TGTab *GetTab() const {return fTab;}
66  Int_t GetTabIndex() const;
67  static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p);
68  void SetVolTabEnabled(Bool_t flag=kTRUE);
69  void SetModel(TObject *model);
70  void SetTab();
71 
72  void GetShapeEditor(TGeoShape *shape);
73  void GetVolumeEditor(TGeoVolume *vol);
74  void GetMatrixEditor(TGeoMatrix *matrix);
75  void GetMediumEditor(TGeoMedium *medium);
76  void GetMaterialEditor(TGeoMaterial *material);
77 
79  TGeoVolume *GetVolume() const {return fVolume;}
80 
81  ClassDef(TGeoTabManager, 0) // Tab manager for geometry editors
82 };
83 
84 //////////////////////////////////////////////////////////////////////////
85 // //
86 // TGeoTreeDialog //
87 // //
88 // Dialog frame for selecting objects with a tree hierarchy //
89 // //
90 //////////////////////////////////////////////////////////////////////////
91 
93 
94 protected:
95  static TObject *fgSelectedObj; // Selected object
96  TGCanvas *fCanvas; // TGCanvas containing the list tree
97  TGLabel *fObjLabel; // Label for selected object
98  TGListTree *fLT; // List tree for selecting
99  TGCompositeFrame *f1; // Composite frame containing the selection
100  TGTextButton *fClose; // Close button
101 
102  virtual void BuildListTree() = 0;
103  virtual void ConnectSignalsToSlots() = 0;
104 public:
105  TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
106  virtual ~TGeoTreeDialog();
107 
108  static TObject *GetSelected();
109  // Slots
110  virtual void DoClose() = 0;
111  virtual void DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
112  void DoSelect(TGListTreeItem *item);
113 
114  ClassDef(TGeoTreeDialog, 0) // List-Tree based dialog
115 };
116 
117 //////////////////////////////////////////////////////////////////////////
118 // //
119 // TGeoVolumeDialog //
120 // //
121 // Special tree dialog class for selecting volumes. //
122 // //
123 //////////////////////////////////////////////////////////////////////////
124 
126 
127 protected:
128  virtual void BuildListTree();
129  virtual void ConnectSignalsToSlots();
130 
131 public:
132  TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
133  virtual ~TGeoVolumeDialog() {;}
134 
135  // Slots
136  virtual void DoClose();
137  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
138 
139  ClassDef(TGeoVolumeDialog, 0) // List-Tree based volume dialog
140 };
141 
142 //////////////////////////////////////////////////////////////////////////
143 // //
144 // TGeoShapeDialog //
145 // //
146 // Special tree dialog class for selecting shapes. //
147 // //
148 //////////////////////////////////////////////////////////////////////////
149 
151 
152 protected:
153  virtual void BuildListTree();
154  virtual void ConnectSignalsToSlots();
155 
156 public:
157  TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
158  virtual ~TGeoShapeDialog() {;}
159 
160  // Slots
161  virtual void DoClose();
162  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
163 
164  ClassDef(TGeoShapeDialog, 0) // List-Tree based shape dialog
165 };
166 
167 //////////////////////////////////////////////////////////////////////////
168 // //
169 // TGeoMediumDialog //
170 // //
171 // Special tree dialog class for selecting media. //
172 // //
173 //////////////////////////////////////////////////////////////////////////
174 
176 
177 protected:
178  virtual void BuildListTree();
179  virtual void ConnectSignalsToSlots();
180 
181 public:
182  TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
183  virtual ~TGeoMediumDialog() {;}
184 
185  // Slots
186  virtual void DoClose();
187  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
188 
189  ClassDef(TGeoMediumDialog, 0) // List-Tree based medium dialog
190 };
191 
192 //////////////////////////////////////////////////////////////////////////
193 // //
194 // TGeoMaterialDialog //
195 // //
196 // Special tree dialog class for selecting materials. //
197 // //
198 //////////////////////////////////////////////////////////////////////////
199 
201 
202 protected:
203  virtual void BuildListTree();
204  virtual void ConnectSignalsToSlots();
205 
206 public:
207  TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
208  virtual ~TGeoMaterialDialog() {;}
209 
210  // Slots
211  virtual void DoClose();
212  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
213 
214  ClassDef(TGeoMaterialDialog, 0) // List-Tree based material dialog
215 };
216 
217 //////////////////////////////////////////////////////////////////////////
218 // //
219 // TGeoMatrixDialog //
220 // //
221 // Special tree dialog class for selecting matrices. //
222 // //
223 //////////////////////////////////////////////////////////////////////////
224 
226 
227 protected:
228  virtual void BuildListTree();
229  virtual void ConnectSignalsToSlots();
230 
231 public:
232  TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
233  virtual ~TGeoMatrixDialog() {;}
234 
235  // Slots
236  virtual void DoClose();
237  virtual void DoItemClick(TGListTreeItem *item, Int_t btn);
238 
239  ClassDef(TGeoMatrixDialog, 0) // List-Tree based matrix dialog
240 };
241 
242 //////////////////////////////////////////////////////////////////////////
243 // //
244 // TGeoTransientPanel //
245 // //
246 // Special transient tab holding TGeo editors. //
247 // //
248 //////////////////////////////////////////////////////////////////////////
249 
251  TGedEditor *fGedEditor; // ged-editor steering this panel
252  TGCanvas *fCan; // TGCanvas containing a TGTab
253  TGTab *fTab; //tab widget holding the editor
254  TGCompositeFrame *fTabContainer; //main tab container
255  TGCompositeFrame *fStyle; //style tab container frame
256  TObject *fModel; //selected object
257  TGTextButton *fClose; //close button
258 
259 public:
260  TGeoTransientPanel(TGedEditor* ged, const char *name, TObject *obj);
261  virtual ~TGeoTransientPanel();
262 
263  virtual void CloseWindow();
264  virtual void DeleteEditors();
265 
266  TGTab *GetTab() const {return fTab;}
267  TGCompositeFrame *GetStyle() const {return fStyle;}
268  TObject *GetModel() const {return fModel;}
269 
270  void GetEditors(TClass *cl);
271  virtual void Hide();
272  virtual void Show();
273  void SetModel(TObject *model);
274 
275  ClassDef(TGeoTransientPanel, 0) // List-Tree based dialog
276 };
277 
278 #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:40
Manager for all editor tabs.
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 hierarchically all daughters of a composite frame.
TGCompositeFrame * f1
#define ClassDef(name, id)
Definition: Rtypes.h:320
TVirtualPad * fPad
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
virtual ~TGeoMaterialDialog()
int main(int argc, char **argv)
Editor for TGeoManager class.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:49
A doubly linked list.
Definition: TList.h:44
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:75
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:87
TGTextButton * fClose
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
TGeoVolume * fVolume
char name[80]
Definition: TGX11.cxx:109
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.