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;
44
45private:
46 TGedEditor *fGedEditor; // Parent editor
47 TVirtualPad *fPad; // Pad to which this applies
48 TGTab *fTab; // Parent tab
49 TGeoVolume *fVolume; // Edited volume
50 TGeoTransientPanel *fShapePanel; // Panel for editing shapes
51 TGeoTransientPanel *fMediumPanel; // Panel for editing media
52 TGeoTransientPanel *fMaterialPanel; // Panel for editing materials
53 TGeoTransientPanel *fMatrixPanel; // Panel for editing matrices
55
56 static TMap fgEditorToMgrMap; // Map from ged-editor to associated tab-manager
57
58 void GetEditors(TClass *cl);
59
60public:
62 ~TGeoTabManager() override;
63
65 static void Cleanup(TGCompositeFrame *frame);
66 TVirtualPad *GetPad() const { return fPad; }
67 TGTab *GetTab() const { return fTab; }
68 Int_t GetTabIndex() const;
70 void SetVolTabEnabled(Bool_t flag = kTRUE);
71 void SetModel(TObject *model);
72 void SetTab();
73
74 void GetShapeEditor(TGeoShape *shape);
75 void GetVolumeEditor(TGeoVolume *vol);
76 void GetMatrixEditor(TGeoMatrix *matrix);
77 void GetMediumEditor(TGeoMedium *medium);
78 void GetMaterialEditor(TGeoMaterial *material);
79
81 TGeoVolume *GetVolume() const { return fVolume; }
82
83 ClassDefOverride(TGeoTabManager, 0) // Tab manager for geometry editors
84};
85
86//////////////////////////////////////////////////////////////////////////
87// //
88// TGeoTreeDialog //
89// //
90// Dialog frame for selecting objects with a tree hierarchy //
91// //
92//////////////////////////////////////////////////////////////////////////
93
95
96protected:
97 static TObject *fgSelectedObj; // Selected object
98 TGCanvas *fCanvas; // TGCanvas containing the list tree
99 TGLabel *fObjLabel; // Label for selected object
100 TGListTree *fLT; // List tree for selecting
101 TGCompositeFrame *f1; // Composite frame containing the selection
102 TGTextButton *fClose; // Close button
103
104 virtual void BuildListTree() = 0;
105 virtual void ConnectSignalsToSlots() = 0;
106
107public:
108 TGeoTreeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
109 ~TGeoTreeDialog() override;
110
111 static TObject *GetSelected();
112 // Slots
113 virtual void DoClose() = 0;
114 virtual void DoItemClick(TGListTreeItem *item, Int_t btn) = 0;
115 void DoSelect(TGListTreeItem *item);
116
117 ClassDefOverride(TGeoTreeDialog, 0) // List-Tree based dialog
118};
119
120//////////////////////////////////////////////////////////////////////////
121// //
122// TGeoVolumeDialog //
123// //
124// Special tree dialog class for selecting volumes. //
125// //
126//////////////////////////////////////////////////////////////////////////
127
129
130protected:
131 void BuildListTree() override;
132 void ConnectSignalsToSlots() override;
133
134public:
135 TGeoVolumeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
136 ~TGeoVolumeDialog() override {}
137
138 // Slots
139 void DoClose() override;
140 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
141
142 ClassDefOverride(TGeoVolumeDialog, 0) // List-Tree based volume dialog
143};
144
145//////////////////////////////////////////////////////////////////////////
146// //
147// TGeoShapeDialog //
148// //
149// Special tree dialog class for selecting shapes. //
150// //
151//////////////////////////////////////////////////////////////////////////
152
154
155protected:
156 void BuildListTree() override;
157 void ConnectSignalsToSlots() override;
158
159public:
160 TGeoShapeDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
161 ~TGeoShapeDialog() override {}
162
163 // Slots
164 void DoClose() override;
165 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
166
167 ClassDefOverride(TGeoShapeDialog, 0) // List-Tree based shape dialog
168};
169
170//////////////////////////////////////////////////////////////////////////
171// //
172// TGeoMediumDialog //
173// //
174// Special tree dialog class for selecting media. //
175// //
176//////////////////////////////////////////////////////////////////////////
177
179
180protected:
181 void BuildListTree() override;
182 void ConnectSignalsToSlots() override;
183
184public:
185 TGeoMediumDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
186 ~TGeoMediumDialog() override {}
187
188 // Slots
189 void DoClose() override;
190 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
191
192 ClassDefOverride(TGeoMediumDialog, 0) // List-Tree based medium dialog
193};
194
195//////////////////////////////////////////////////////////////////////////
196// //
197// TGeoMaterialDialog //
198// //
199// Special tree dialog class for selecting materials. //
200// //
201//////////////////////////////////////////////////////////////////////////
202
204
205protected:
206 void BuildListTree() override;
207 void ConnectSignalsToSlots() override;
208
209public:
210 TGeoMaterialDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
212
213 // Slots
214 void DoClose() override;
215 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
216
217 ClassDefOverride(TGeoMaterialDialog, 0) // List-Tree based material dialog
218};
219
220//////////////////////////////////////////////////////////////////////////
221// //
222// TGeoMatrixDialog //
223// //
224// Special tree dialog class for selecting matrices. //
225// //
226//////////////////////////////////////////////////////////////////////////
227
229
230protected:
231 void BuildListTree() override;
232 void ConnectSignalsToSlots() override;
233
234public:
235 TGeoMatrixDialog(TGFrame *caller, const TGWindow *main, UInt_t w = 1, UInt_t h = 1);
236 ~TGeoMatrixDialog() override {}
237
238 // Slots
239 void DoClose() override;
240 void DoItemClick(TGListTreeItem *item, Int_t btn) override;
241
242 ClassDefOverride(TGeoMatrixDialog, 0) // List-Tree based matrix dialog
243};
244
245//////////////////////////////////////////////////////////////////////////
246// //
247// TGeoTransientPanel //
248// //
249// Special transient tab holding TGeo editors. //
250// //
251//////////////////////////////////////////////////////////////////////////
252
254 TGedEditor *fGedEditor; // ged-editor steering this panel
255 TGCanvas *fCan; // TGCanvas containing a TGTab
256 TGTab *fTab; // tab widget holding the editor
257 TGCompositeFrame *fTabContainer; // main tab container
258 TGCompositeFrame *fStyle; // style tab container frame
259 TObject *fModel; // selected object
260 TGTextButton *fClose; // close button
261
262public:
263 TGeoTransientPanel(TGedEditor *ged, const char *name, TObject *obj);
264 ~TGeoTransientPanel() override;
265
266 void CloseWindow() override;
267 virtual void DeleteEditors();
268
269 TGTab *GetTab() const { return fTab; }
270 TGCompositeFrame *GetStyle() const { return fStyle; }
271 TObject *GetModel() const { return fModel; }
272
273 void GetEditors(TClass *cl);
274 virtual void Hide();
275 virtual void Show();
276 void SetModel(TObject *model);
277
278 ClassDefOverride(TGeoTransientPanel, 0) // List-Tree based dialog
279};
280
281#endif
int main()
Definition Prototype.cxx:12
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
Definition TGX11.cxx:110
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
This class handles GUI labels.
Definition TGLabel.h:24
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:195
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:397
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
Definition TGTab.h:46
Yield an action as soon as it is clicked.
Definition TGButton.h:142
Defines transient windows that typically are used for dialogs windows.
Definition TGFrame.h:498
ROOT GUI Window base class.
Definition TGWindow.h:23
Editor for TGeoManager class.
void ConnectSignalsToSlots() override
Connect signals to slots.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
void DoClose() override
Handle close button.
~TGeoMaterialDialog() override
void BuildListTree() override
Build volume specific list tree.
Base class describing materials.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
void DoClose() override
Handle close button.
~TGeoMatrixDialog() override
void ConnectSignalsToSlots() override
Connect signals to slots.
void BuildListTree() override
Build matrix specific list tree.
Geometrical transformation package.
Definition TGeoMatrix.h:38
void ConnectSignalsToSlots() override
Connect signals to slots.
void DoClose() override
Handle close button.
void BuildListTree() override
Build volume specific list tree.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
~TGeoMediumDialog() override
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
void BuildListTree() override
Build shape specific list tree.
~TGeoShapeDialog() override
void ConnectSignalsToSlots() override
Connect signals to slots.
void DoClose() override
Handle close button.
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
Base abstract class for all shapes.
Definition TGeoShape.h:25
Manager for all editor tabs.
TVirtualPad * fPad
TVirtualPad * GetPad() const
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
TGedEditor * fGedEditor
TGeoTransientPanel * fMaterialPanel
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.
~TGeoTabManager() override
Dtor.
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
void CloseWindow() override
When closed via WM close button, just unmap (i.e.
TObject * GetModel() const
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.
~TGeoTransientPanel() override
Destructor.
static TObject * fgSelectedObj
~TGeoTreeDialog() override
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
void DoItemClick(TGListTreeItem *item, Int_t btn) override
Handle item click.
~TGeoVolumeDialog() override
void DoClose() override
Handle close button.
void BuildListTree() override
Build volume specific list tree.
void ConnectSignalsToSlots() override
Connect signals to slots.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
A doubly linked list.
Definition TList.h:38
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:41
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51