ROOT  6.06/09
Reference Guide
TGeoManagerEditor.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_TGeoManagerEditor
13 #define ROOT_TGeoManagerEditor
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGeoManagerEditor //
18 // //
19 // Editor for a TGeoManager. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #ifndef ROOT_TGButton
24 #include "TGWidget.h"
25 #endif
26 #ifndef ROOT_TGeoGedFrame
27 #include "TGeoGedFrame.h"
28 #endif
29 
30 class TGeoManager;
31 class TGeoVolume;
32 class TGeoShape;
33 class TGeoMedium;
34 class TGeoMaterial;
35 class TGeoMatrix;
36 class TGShutter;
37 class TGShutterItem;
38 class TGTextEntry;
39 class TGTab;
40 class TGComboBox;
41 class TGNumberEntry;
42 class TGTextButton;
43 class TGPictureButton;
44 class TGCheckButton;
45 class TGRadioButton;
46 class TGeoTabManager;
47 
48 class TGeoManagerEditor : public TGedFrame {
49 
50 protected:
51 
52  TGeoManager *fGeometry; // Selected geometry manager
53  TGeoTabManager *fTabMgr; // Tab manager
54  TGTab *fTab; // TGTab of GedEditor
55  TGCompositeFrame *fVolumeTab; // Tab of Volume tab
56  Bool_t fIsModified; // Flag that manager was modified
57  TGShutter *fCategories; // Categories shutter
58  TGTextEntry *fManagerName; // Name text entry
59  TGTextEntry *fManagerTitle; // Title text entry
60  TGTextEntry *fMediumName; // Medium name text entry
61  TGTextEntry *fMatrixName; // Matrix name text entry
62  TGTextEntry *fMaterialName; // Material name text entry
63  TGTextEntry *fVolumeName; // Volume name text entry
64  TGeoMaterial *fSelectedMaterial; // Selected material
65  TGeoMaterial *fSelectedMaterial2; // Selected material for medium creation
66  TGLabel *fLSelMaterial; // Selected material label
67  TGLabel *fLSelMaterial2; // Selected material label
68  TGPictureButton *fBSelMaterial; // Button for selecting a material
69  TGPictureButton *fBSelMaterial2; // Button for selecting a material
70  TGeoVolume *fSelectedVolume; // Selected volume
71  TGLabel *fLSelVolume; // Selected volume label
72  TGPictureButton *fBSelVolume; // Button for selecting a volume
73  TGeoShape *fSelectedShape; // Selected shape
74  TGeoShape *fSelectedShape2; // Selected shape for volume creation
75  TGLabel *fLSelShape; // Selected shape label
76  TGLabel *fLSelShape2; // Selected shape label
77  TGPictureButton *fBSelShape; // Button for selecting a shape
78  TGPictureButton *fBSelShape2; // Button for selecting a shape
79  TGeoMatrix *fSelectedMatrix; // Selected matrix
80  TGLabel *fLSelMatrix; // Selected matrix label
81  TGPictureButton *fBSelMatrix; // Button for selecting a matrix
82  TGeoMedium *fSelectedMedium; // Selected medium
83  TGeoMedium *fSelectedMedium2; // Selected medium for volume creation
84  TGLabel *fLSelMedium; // Selected medium label
85  TGLabel *fLSelMedium2; // Selected medium label
86  TGPictureButton *fBSelMedium; // Button for selecting a medium
87  TGPictureButton *fBSelMedium2; // Button for selecting a medium
88  TGPictureButton *fShapeButton[21]; // List of shape buttons
89  TGPictureButton *fMatrixButton[3]; // List of matrix buttons
90  TGPictureButton *fVolumeButton[2]; // List of volume buttons
91  TGPictureButton *fMaterialButton[2]; // List of material buttons
92  TGRadioButton *fExportOption[2]; // Export option buttons
93  TGTextButton *fExportButton; // Button to export geometry
94  TGComboBox *fElementList; // Combo box for elements
95  TGNumberEntry *fEntryDensity; // Number entry for material density
96  TGPictureButton *fMediumButton; // Button to create a medium
97  TGNumberEntry *fMediumId; // Medium ID number entry
98  TGTextButton *fEditShape; // Button for editing selected shape
99  TGTextButton *fEditMedium; // Button for editing a medium
100  TGTextButton *fEditMaterial; // Button for editing a material
101  TGTextButton *fEditMatrix; // Button for editing a matrix
102  TGTextButton *fEditVolume; // Button for editing a volume
103  TGTextButton *fSetTopVolume; // Button for setting top volume
104  TGLabel *fLSelTop; // Selected top volume
105  TGPictureButton *fBSelTop; // Button for selecting top volume
106  TGTextButton *fCloseGeometry; // Button for closing the geometry
107  TGCompositeFrame *f2; // Parent frame for shape editing
108  TGCompositeFrame *f3; // Parent frame for volume editing
109  TGCompositeFrame *f4; // Parent frame for materials editing
110  TGCompositeFrame *f5; // Parent frame for media editing
111  TGCompositeFrame *f6; // Parent frame for matrices editing
112  TGCompositeFrame *f7; // Parent frame for closing geometry
113  TCanvas *fConnectedCanvas; // Canvas connected to SelectedSlot()
114 
115  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
116  void ShowSelectShape(Bool_t show=kTRUE);
117  void ShowSelectVolume(Bool_t show=kTRUE);
118  void ShowSelectMaterial(Bool_t show=kTRUE);
119  void ShowSelectMedium(Bool_t show=kTRUE);
120  void ShowSelectMatrix(Bool_t show=kTRUE);
121 
122 public:
123  TGeoManagerEditor(const TGWindow *p = 0,
124  Int_t width = 140, Int_t height = 30,
125  UInt_t options = kChildFrame,
127  virtual ~TGeoManagerEditor();
128  static void LoadLib() {;}
129  virtual void SetModel(TObject *obj);
130 
131  virtual void SelectedSlot(TVirtualPad* pad, TObject* obj, Int_t event);
132  void ConnectSelected(TCanvas *c);
133  void DisconnectSelected();
134 
135  void DoName();
136  void DoCreateBox();
137  void DoCreatePara();
138  void DoCreateTrd1();
139  void DoCreateTrd2();
140  void DoCreateTrap();
141  void DoCreateGtra();
142  void DoCreateXtru();
143  void DoCreateArb8();
144  void DoCreateTube();
145  void DoCreateTubs();
146  void DoCreateCone();
147  void DoCreateCons();
148  void DoCreateSphe();
149  void DoCreateCtub();
150  void DoCreateEltu();
151  void DoCreateTorus();
152  void DoCreatePcon();
153  void DoCreatePgon();
154  void DoCreateHype();
155  void DoCreateParab();
156  void DoCreateComposite();
157  void DoCreateMaterial();
158  void DoCreateMixture();
159  void DoCreateMedium();
160  void DoCreateTranslation();
161  void DoCreateRotation();
162  void DoCreateCombi();
163  void DoCreateVolume();
164  void DoCreateAssembly();
165  void DoEditShape();
166  void DoEditVolume();
167  void DoEditMedium();
168  void DoEditMaterial();
169  void DoEditMatrix();
170  void DoSelectShape();
171  void DoSelectShape2();
172  void DoSelectVolume();
173  void DoSelectMatrix();
174  void DoSelectMaterial();
175  void DoSelectMaterial2();
176  void DoSelectMedium();
177  void DoSelectMedium2();
178  void DoSetTopVolume();
179  void DoSelectTopVolume();
180  void DoExportGeometry();
181  void DoCloseGeometry();
182 
183  ClassDef(TGeoManagerEditor,0) // TGeoManager editor
184 };
185 
186 #endif
void DoEditMedium()
Slot for editing selected medium.
TGPictureButton * fBSelTop
void DoCreateCons()
Create a cone segment.
TGPictureButton * fBSelMedium
TGNumberEntry * fMediumId
void DoExportGeometry()
Export geometry as .root or .C file.
void DoSelectMedium()
Slot for selecting an existing medium.
void ShowSelectShape(Bool_t show=kTRUE)
Show/hide interface for shape selection.
void DoCreateComposite()
Create a composite shape.
void DoCreateXtru()
Create an extruded polygone.
Definition: TGTab.h:66
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoCreateSphe()
Create a sphere.
void DoEditMaterial()
Slot for editing selected material.
void DoCloseGeometry()
Slot for closing the geometry.
TGShutter * fCategories
TGTextEntry * fMatrixName
void DoSelectMatrix()
Slot for selecting an existing matrix.
void ShowSelectMatrix(Bool_t show=kTRUE)
Show/hide interface for matrix selection.
void DoSelectShape()
Slot for selecting an existing shape.
TGeoVolume * fSelectedVolume
void DoCreateMaterial()
Create a new material.
TGeoMedium * fSelectedMedium
void DoCreateEltu()
Create an eliptical tube.
void DoCreateTrd2()
Create a Trd2.
void DoCreateTrd1()
Create a Trd1.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void DoCreatePara()
Create a parallelipiped.
TGPictureButton * fBSelMaterial2
void DoCreateParab()
Create a paraboloid.
void DoSelectMedium2()
Slot for selecting an existing medium for making a volume.
void DoCreateTube()
Create a tube.
TGeoShape * fSelectedShape
void DoSetTopVolume()
Set top volume for the geometry.
TGPictureButton * fBSelVolume
TGTextEntry * fManagerName
void DoSelectVolume()
Slot for selecting an existing volume.
TGeoTabManager * fTabMgr
TGPictureButton * fBSelMaterial
TGTextButton * fEditVolume
ULong_t Pixel_t
Definition: GuiTypes.h:41
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
void DoCreateBox()
Create a box.
void DoCreateTranslation()
Create a new translation.
void DoEditVolume()
Slot for editing selected volume.
void DoCreateCombi()
Create a new translation + rotation.
TGCompositeFrame * f5
void DoSelectTopVolume()
Slot for seting top geometry volume.
TGCompositeFrame * f2
void DoCreateCone()
Create a cone.
void DoCreateRotation()
Create a new rotation.
void DoCreateTorus()
Create a torus shape.
void DoSelectMaterial()
Slot for selecting an existing material.
void DoCreateArb8()
Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel planes.
void DoCreateMixture()
Create a new mixture.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
ClassDef(TGedFrame, 0)
TGeoShape * fSelectedShape2
TGTextButton * fEditMedium
TGeoMedium * fSelectedMedium2
void DoEditShape()
Slot for editing selected shape.
void ShowSelectMaterial(Bool_t show=kTRUE)
Show/hide interface for material selection.
TGCompositeFrame * f4
void DoCreateMedium()
Create a new medium.
void ConnectSelected(TCanvas *c)
TGTextButton * fCloseGeometry
TGeoMatrix * fSelectedMatrix
void ShowSelectVolume(Bool_t show=kTRUE)
Show/hide interface for volume selection.
virtual void SetModel(TObject *obj)
Refresh editor according the selected obj.
unsigned int UInt_t
Definition: RtypesCore.h:42
void DoCreateTrap()
Create a general trapezoid.
TGTextButton * fSetTopVolume
void ShowSelectMedium(Bool_t show=kTRUE)
Show/hide interface for medium selection.
TGTextButton * fEditMaterial
TGComboBox * fElementList
TGeoMaterial * fSelectedMaterial2
TGTextEntry * fVolumeName
void DoCreateGtra()
Create a twisted trapezoid.
The Canvas class.
Definition: TCanvas.h:48
virtual ~TGeoManagerEditor()
Destructor.
TGCompositeFrame * f6
TGCompositeFrame * f7
void DoCreateHype()
Create a hyperboloid.
TGTextEntry * fMaterialName
void DoCreateTubs()
Create a tube segment.
void DoSelectMaterial2()
Slot for selecting an existing material and making a medium.
TGCompositeFrame * f3
TGTextButton * fEditShape
static void LoadLib()
TGNumberEntry * fEntryDensity
TGeoManagerEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for manager editor.
virtual void SelectedSlot(TVirtualPad *pad, TObject *obj, Int_t event)
Connected to TCanvas::Selected.
TGPictureButton * fBSelMedium2
void DoSelectShape2()
Slot for selecting a shape for making a volume.
TGTextButton * fExportButton
Mother of all ROOT objects.
Definition: TObject.h:58
TGPictureButton * fBSelShape
TGPictureButton * fMediumButton
void DoCreatePgon()
Create a polygone shape.
TGeoManager * fGeometry
TGPictureButton * fBSelShape2
TGCompositeFrame * fVolumeTab
TGTextEntry * fManagerTitle
void DoCreatePcon()
Create a polycone shape.
TGPictureButton * fBSelMatrix
void DoCreateVolume()
Create a new volume.
TGTextButton * fEditMatrix
void DoCreateCtub()
Create a cut tube.
TGTextEntry * fMediumName
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
void DoCreateAssembly()
Create a new volume assembly.
void DoEditMatrix()
Slot for editing selected matrix.
TGeoMaterial * fSelectedMaterial
void DoName()
Change name/title of the geometry.