Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19class TVirtualPad;
20class TClass;
21
22class TList;
24class TGLabel;
25class TGTab;
26class TGComboBox;
27class TGListTree;
28class TGListTreeItem;
29class TGCanvas;
30
31class TGedEditor;
32
33class TGeoShape;
34class TGeoVolume;
35class TGeoMedium;
36class TGeoMaterial;
37class TGeoMatrix;
38
39class TGeoTreeDialog;
41
42class TGeoTabManager : public TObject {
43 friend class TGeoManagerEditor;
44private:
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
54
55 static TMap fgEditorToMgrMap; // Map from ged-editor to associated tab-manager
56
57 void GetEditors(TClass *cl);
58public:
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
94protected:
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;
104public:
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
127protected:
128 virtual void BuildListTree();
129 virtual void ConnectSignalsToSlots();
130
131public:
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
152protected:
153 virtual void BuildListTree();
154 virtual void ConnectSignalsToSlots();
155
156public:
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
177protected:
178 virtual void BuildListTree();
179 virtual void ConnectSignalsToSlots();
180
181public:
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
202protected:
203 virtual void BuildListTree();
204 virtual void ConnectSignalsToSlots();
205
206public:
207 TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
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
227protected:
228 virtual void BuildListTree();
229 virtual void ConnectSignalsToSlots();
230
231public:
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
259public:
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;}
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
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
Definition TGTab.h:62
Editor for TGeoManager class.
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)
Handle item click.
virtual void BuildListTree()
Build volume specific list tree.
virtual void DoClose()
Handle close button.
virtual ~TGeoMaterialDialog()
virtual void ConnectSignalsToSlots()
Connect signals to slots.
Base class describing materials.
virtual ~TGeoMatrixDialog()
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)
Handle item click.
virtual void DoClose()
Handle close button.
virtual void BuildListTree()
Build matrix specific list tree.
virtual void ConnectSignalsToSlots()
Connect signals to slots.
Geometrical transformation package.
Definition TGeoMatrix.h:41
virtual void BuildListTree()
Build volume specific list tree.
virtual void DoClose()
Handle close button.
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)
Handle item click.
virtual ~TGeoMediumDialog()
virtual void ConnectSignalsToSlots()
Connect signals to slots.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:24
virtual void ConnectSignalsToSlots()
Connect signals to slots.
virtual ~TGeoShapeDialog()
virtual void BuildListTree()
Build shape specific list tree.
virtual void DoClose()
Handle close button.
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)
Handle item click.
Base abstract class for all shapes.
Definition TGeoShape.h:26
Manager for all editor tabs.
TVirtualPad * fPad
TVirtualPad * GetPad() const
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
TGedEditor * fGedEditor
TGeoTransientPanel * fMaterialPanel
virtual ~TGeoTabManager()
Dtor.
TGeoVolume * fVolume
TGCompositeFrame * fVolumeTab
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
TGeoVolume * GetVolume() const
static TMap fgEditorToMgrMap
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
TGTab * GetTab() const
void GetEditors(TClass *cl)
Get editor for a class.
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.
void SetModel(TObject *model)
Send the SetModel signal to all editors in the tab TYPE.
Int_t GetTabIndex() const
Get index for a given tab element.
TGeoTransientPanel * fShapePanel
TGCompositeFrame * GetVolumeTab() const
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.
TGeoTransientPanel * fMediumPanel
void SetTab()
Set a given tab element as active one.
void SetVolTabEnabled(Bool_t flag=kTRUE)
Enable/disable tabs.
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
TGeoTransientPanel * fMatrixPanel
TGedEditor * fGedEditor
virtual void Hide()
Hide the transient frame.
TGTextButton * fClose
TObject * GetModel() const
virtual void CloseWindow()
When closed via WM close button, just unmap (i.e.
void GetEditors(TClass *cl)
Get editor for a class.
virtual void Show()
Hide the transient frame.
TGTab * GetTab() const
virtual void DeleteEditors()
Delete editors.
TGCompositeFrame * fTabContainer
TGCompositeFrame * fStyle
TGCompositeFrame * GetStyle() const
void SetModel(TObject *model)
Update the editors in the main tab to reflect the selected object.
virtual ~TGeoTransientPanel()
Destructor.
static TObject * fgSelectedObj
virtual ~TGeoTreeDialog()
Destructor.
virtual void ConnectSignalsToSlots()=0
virtual void BuildListTree()=0
TGLabel * fObjLabel
static TObject * GetSelected()
static; return selected object
TGCompositeFrame * f1
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)=0
TGTextButton * fClose
virtual void DoClose()=0
void DoSelect(TGListTreeItem *item)
Update dialog to reflect current clicked object.
TGListTree * fLT
TGCanvas * fCanvas
virtual void DoItemClick(TGListTreeItem *item, Int_t btn)
Handle item click.
virtual void BuildListTree()
Build volume specific list tree.
virtual ~TGeoVolumeDialog()
virtual void ConnectSignalsToSlots()
Connect signals to slots.
virtual void DoClose()
Handle close button.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:49
A doubly linked list.
Definition TList.h:44
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition TMap.h:40
Mother of all ROOT objects.
Definition TObject.h:37
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
int main()