Logo ROOT   6.12/07
Reference Guide
TGeoManagerEditor.cxx
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 /** \class TGeoManagerEditor
13 \ingroup Geometry_builder
14 
15 Editor for TGeoManager class. Provides also builder functionality for the
16 main TGeo objects: TGeoVolume, TGeoShape - derived classes, TGeoMaterial,
17 TGeoMatrix - derived transformations and TGeoMedium.
18 The GUI represents the main entry point for editing geometry classes. It
19 can be started either by:
20 
21  1. TGeoManager::Edit(). The method must be used when starting from a new
22  geometry.
23  2. Left-click on the 40x40 pixels top-right corner of a pad containing a
24  drawn volume. The region is always accesible when drawing geometry elements
25  and allows also restoring the manager editor in the "Style" tab of the GED
26  editor anytime.
27 
28 The TGeoManager editor is vertically split by a TGShutter widget into the
29 following categories:
30 
31  - General. This allows changing the name/title of the geometry, setting the
32  top volume, closing the geometry and saving the geometry in a file. The name
33  of the geometry file is formed by geometry_name.C/.root depending if the geometry
34  need to be saved as a C macro or a .root file.
35  - Shapes. The category provide buttons for creation of all supported shapes. The
36  new shape name is chosen by the interface, but can be changed from the shape
37  editor GUI. Existing shapes can be browsed and edited from the same category.
38  - Volumes. The category allows the creation of a new volume having a given name,
39  shape and medium. For creating a volume assembly only the name is relevant.
40  Existing volumes can be browsed or edited from this category.
41  - Materials. Allows creation of new materials/mixtures or editing existing ones.
42  - Media. The same for creation/editing of tracking media (materials having a set
43  of properties related to tracking)
44  - Matrices. Allows creation of translations, rotations or combined transformations.
45  Existing matrices can also be browser/edited.
46 */
47 
48 #include "TVirtualPad.h"
49 #include "TCanvas.h"
50 #include "TBaseClass.h"
51 #include "TGTab.h"
52 #include "TG3DLine.h"
53 #include "TGComboBox.h"
54 #include "TGButton.h"
55 #include "TGButtonGroup.h"
56 #include "TGTextEntry.h"
57 #include "TGNumberEntry.h"
58 #include "TGLabel.h"
59 #include "TGShutter.h"
60 
61 #include "TGeoVolumeEditor.h"
62 #include "TGeoNodeEditor.h"
63 #include "TGeoTabManager.h"
64 #include "TGeoVolume.h"
65 #include "TGeoManager.h"
66 #include "TGeoMatrix.h"
67 #include "TGeoBBox.h"
68 #include "TGeoPara.h"
69 #include "TGeoArb8.h"
70 #include "TGeoTube.h"
71 #include "TGeoEltu.h"
72 #include "TGeoHype.h"
73 #include "TGeoTorus.h"
74 #include "TGeoTrd1.h"
75 #include "TGeoTrd2.h"
76 #include "TGeoCone.h"
77 #include "TGeoSphere.h"
78 #include "TGeoPcon.h"
79 #include "TGeoPgon.h"
80 #include "TGeoElement.h"
81 #include "TGeoMaterial.h"
82 #include "TView.h"
83 
84 #include "TGeoManagerEditor.h"
85 #include "TGedEditor.h"
86 
88 
106 };
107 
108 ////////////////////////////////////////////////////////////////////////////////
109 /// Constructor for manager editor.
110 
112  Int_t height, UInt_t options, Pixel_t back)
113  : TGedFrame(p, width, height, options | kVerticalFrame, back)
114 {
116  fTabMgr = 0;
117  fTab = 0;
118  fConnectedCanvas = 0;
119 
122  TGLabel *label;
123 
124  // TGShutter for categories
126 
127  TGCompositeFrame *container;
128  Pixel_t color;
129  // General settings
131  container = (TGCompositeFrame*)si->GetContainer();
133  fCategories->AddItem(si);
134  // TextEntry for manager name
135  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
136  f1->AddFrame(label = new TGLabel(f1, "Name/Title"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
137  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
138  gClient->GetColorByName("#ff0000", color);
139  label->SetTextColor(color);
140  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
141  fManagerName = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_NAME);
143  fManagerName->SetToolTipText("Enter the geometry name");
144  container->AddFrame(fManagerName, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
145  fManagerTitle = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_TITLE);
147  fManagerTitle->SetToolTipText("Enter the geometry name");
148  container->AddFrame(fManagerTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
149  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
150  f1->AddFrame(label = new TGLabel(f1, "Export geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
151  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
152  gClient->GetColorByName("#ff0000", color);
153  label->SetTextColor(color);
154  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 6, 0));
155  TString stitle = "Options";
156  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
157  TGButtonGroup *bg = new TGVButtonGroup(f1, stitle);
158  fExportOption[0] = new TGRadioButton(bg, ".root", kEXPORT_ROOT);
159  fExportOption[1] = new TGRadioButton(bg, ".C", kEXPORT_C);
160  fExportButton = new TGTextButton(f1, "Export", kEXPORT_GEOMETRY);
162  bg->SetButton(kEXPORT_ROOT);
163  bg->Show();
164  f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
165  f1->AddFrame(fExportButton, new TGLayoutHints(kLHintsLeft, 20, 2, 22, 0));
166  container->AddFrame(f1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
167  // Close geometry
168  f7 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
169  f1 = new TGCompositeFrame(f7, 155, 10, kHorizontalFrame | kFixedWidth);
170  f1->AddFrame(label = new TGLabel(f1, "Close geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
171  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
172  gClient->GetColorByName("#ff0000", color);
173  label->SetTextColor(color);
174  f7->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
175  f1 = new TGCompositeFrame(f7, 155, 30, kHorizontalFrame | kFixedWidth);
176  fLSelTop = new TGLabel(f1, "Select top");
177  gClient->GetColorByName("#0000ff", color);
178  fLSelTop->SetTextColor(color);
181  fBSelTop = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_TOP_SELECT);
182  fBSelTop->SetToolTipText("Select the top volume");
183  fBSelTop->Associate(this);
184  f1->AddFrame(fBSelTop, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
185  fCloseGeometry = new TGTextButton(f1, "Close");
186  f1->AddFrame(fCloseGeometry, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
187  fCloseGeometry->SetToolTipText("Close geometry to make it ready for tracking");
188  fCloseGeometry->Associate(this);
189  f7->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
190  container->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
191 
192 
193  si = new TGShutterItem(fCategories, new TGHotString("Shapes"),kCAT_SHAPES);
194  container = (TGCompositeFrame*)si->GetContainer();
196  fCategories->AddItem(si);
197 
198  // Shape creators
199  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
200  f1->AddFrame(label = new TGLabel(f1, "Create new shape"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
201  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
202  gClient->GetColorByName("#ff0000", color);
203  label->SetTextColor(color);
204  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
205  TGLayoutHints *lhb = new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0);
206  TGLayoutHints *lhf1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
207  Int_t ipict;
208  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
209  fShapeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geobbox_t.xpm"), kCREATE_BOX);
210  fShapeButton[0]->SetToolTipText("Create a box");
211  fShapeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geopara_t.xpm"), kCREATE_PARA);
212  fShapeButton[1]->SetToolTipText("Create a parallelipiped");
213  fShapeButton[2] = new TGPictureButton(f1, fClient->GetPicture("geotrd1_t.xpm"), kCREATE_TRD1);
214  fShapeButton[2]->SetToolTipText("Create a TRD1 trapezoid");
215  fShapeButton[3] = new TGPictureButton(f1, fClient->GetPicture("geotrd2_t.xpm"), kCREATE_TRD2);
216  fShapeButton[3]->SetToolTipText("Create a TRD2 trapezoid");
217  fShapeButton[4] = new TGPictureButton(f1, fClient->GetPicture("geotrap_t.xpm"), kCREATE_TRAP);
218  fShapeButton[4]->SetToolTipText("Create a general trapezoid");
219  fShapeButton[5] = new TGPictureButton(f1, fClient->GetPicture("geogtra_t.xpm"), kCREATE_GTRA);
220  fShapeButton[5]->SetToolTipText("Create a general twisted trapezoid");
221  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict],lhb);
222  container->AddFrame(f1, lhf1);
223  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
224  fShapeButton[6] = new TGPictureButton(f1, fClient->GetPicture("geoxtru_t.xpm"), kCREATE_XTRU);
225  fShapeButton[6]->SetToolTipText("Create a extruded polygone");
226  fShapeButton[7] = new TGPictureButton(f1, fClient->GetPicture("geoarb8_t.xpm"), kCREATE_ARB8);
227  fShapeButton[7]->SetToolTipText("Create an arbitrary trapezoid with 8 vertices");
228  fShapeButton[8] = new TGPictureButton(f1, fClient->GetPicture("geotube_t.xpm"), kCREATE_TUBE);
229  fShapeButton[8]->SetToolTipText("Create a cylindrical pipe");
230  fShapeButton[9] = new TGPictureButton(f1, fClient->GetPicture("geotubeseg_t.xpm"), kCREATE_TUBS);
231  fShapeButton[9]->SetToolTipText("Create a cylindrical pipe within a phi range");
232  fShapeButton[10] = new TGPictureButton(f1, fClient->GetPicture("geocone_t.xpm"), kCREATE_CONE);
233  fShapeButton[10]->SetToolTipText("Create a conical pipe");
234  fShapeButton[11] = new TGPictureButton(f1, fClient->GetPicture("geoconeseg_t.xpm"), kCREATE_CONS);
235  fShapeButton[11]->SetToolTipText("Create a conical pipe within a phi range");
236  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+6],lhb);
237  container->AddFrame(f1, lhf1);
238  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
239  fShapeButton[12] = new TGPictureButton(f1, fClient->GetPicture("geosphere_t.xpm"), kCREATE_SPHE);
240  fShapeButton[12]->SetToolTipText("Create a spherical sector");
241  fShapeButton[13] = new TGPictureButton(f1, fClient->GetPicture("geoctub_t.xpm"), kCREATE_CTUB);
242  fShapeButton[13]->SetToolTipText("Create a cut tube");
243  fShapeButton[14] = new TGPictureButton(f1, fClient->GetPicture("geoeltu_t.xpm"), kCREATE_ELTU);
244  fShapeButton[14]->SetToolTipText("Create an elliptical tube");
245  fShapeButton[15] = new TGPictureButton(f1, fClient->GetPicture("geotorus_t.xpm"), kCREATE_TORUS);
246  fShapeButton[15]->SetToolTipText("Create a toroidal tube with a phi range");
247  fShapeButton[16] = new TGPictureButton(f1, fClient->GetPicture("geopcon_t.xpm"), kCREATE_PCON);
248  fShapeButton[16]->SetToolTipText("Create a polycone shape");
249  fShapeButton[17] = new TGPictureButton(f1, fClient->GetPicture("geopgon_t.xpm"), kCREATE_PGON);
250  fShapeButton[17]->SetToolTipText("Create a polygon shape");
251  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+12],lhb);
252  container->AddFrame(f1, lhf1);
253  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
254  fShapeButton[18] = new TGPictureButton(f1, fClient->GetPicture("geohype_t.xpm"), kCREATE_HYPE);
255  fShapeButton[18]->SetToolTipText("Create a hyperboloid");
256  fShapeButton[19] = new TGPictureButton(f1, fClient->GetPicture("geoparab_t.xpm"), kCREATE_PARAB);
257  fShapeButton[19]->SetToolTipText("Create a paraboloid");
258  fShapeButton[20] = new TGPictureButton(f1, fClient->GetPicture("geocomposite_t.xpm"), kCREATE_COMP);
259  fShapeButton[20]->SetToolTipText("Create a composite shape");
260  for (ipict=0; ipict<3; ipict++) f1->AddFrame(fShapeButton[ipict+18],lhb);
261  container->AddFrame(f1, lhf1);
262 
263  // List of shapes
264  f2 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
265  f1 = new TGCompositeFrame(f2, 155, 10, kHorizontalFrame | kFixedWidth);
266  f1->AddFrame(label = new TGLabel(f1, "Existing shapes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
267  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
268  gClient->GetColorByName("#ff0000", color);
269  label->SetTextColor(color);
270  f2->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
271  f1 = new TGCompositeFrame(f2, 155, 30, kHorizontalFrame | kFixedWidth);
272  fSelectedShape = 0;
273  fLSelShape = new TGLabel(f1, "Select shape");
274  gClient->GetColorByName("#0000ff", color);
275  fLSelShape->SetTextColor(color);
279  fBSelShape->SetToolTipText("Select one of the existing shapes");
280  fBSelShape->Associate(this);
281  f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
282  fEditShape = new TGTextButton(f1, "Edit");
283  f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
284  fEditShape->SetToolTipText("Edit selected shape");
285  fEditShape->Associate(this);
286  f2->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
287  container->AddFrame(f2, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
288 
289  // Volumes category
290  si = new TGShutterItem(fCategories, new TGHotString("Volumes"),kCAT_VOLUMES);
291  container = (TGCompositeFrame*)si->GetContainer();
293  fCategories->AddItem(si);
294 
295  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
296  f1->AddFrame(label = new TGLabel(f1, "Create new volume"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
297  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
298  gClient->GetColorByName("#ff0000", color);
299  label->SetTextColor(color);
300  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
301 
302  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
303  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
304  fVolumeName = new TGTextEntry(f1, new TGTextBuffer(50), kVOLUME_NAME);
306  fVolumeName->SetToolTipText("Enter the name for the new volume");
307  f1->AddFrame(fVolumeName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
308  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
309 
310  // ComboBox for shape component
311  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
312  fSelectedShape2 = 0;
313  fLSelShape2 = new TGLabel(f1, "Select shape");
314  gClient->GetColorByName("#0000ff", color);
315  fLSelShape2->SetTextColor(color);
319  fBSelShape2->SetToolTipText("Select one of the existing shapes");
320  fBSelShape2->Associate(this);
321  f1->AddFrame(fBSelShape2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
322  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
323 
324  // ComboBox for medium component
325  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
326  fSelectedMedium2 = 0;
327  fLSelMedium2 = new TGLabel(f1, "Select medium");
328  gClient->GetColorByName("#0000ff", color);
329  fLSelMedium2->SetTextColor(color);
333  fBSelMedium2->SetToolTipText("Select one of the existing media");
334  fBSelMedium2->Associate(this);
335  f1->AddFrame(fBSelMedium2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
336  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
337  // Picture buttons for different volumes
338  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
339  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
340  fVolumeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geovolume_t.xpm"), kCREATE_VOLUME);
341  fVolumeButton[0]->SetToolTipText("Create a new volume from shape and medium");
342  fVolumeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geoassembly_t.xpm"), kCREATE_ASSEMBLY);
343  fVolumeButton[1]->SetToolTipText("Create a new volume assembly having the selected name");
344  for (ipict=0; ipict<2; ipict++) f1->AddFrame(fVolumeButton[ipict],lhb);
345  container->AddFrame(f1, lhf1);
346  // List of volumes
347  f3 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
348  f1 = new TGCompositeFrame(f3, 155, 10, kHorizontalFrame | kFixedWidth);
349  f1->AddFrame(label = new TGLabel(f1, "Existing volumes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
350  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
351  gClient->GetColorByName("#ff0000", color);
352  label->SetTextColor(color);
353  f3->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
354  f1 = new TGCompositeFrame(f3, 155, 30, kHorizontalFrame | kFixedWidth);
355  fSelectedVolume = 0;
356  fLSelVolume = new TGLabel(f1, "Select volume");
357  gClient->GetColorByName("#0000ff", color);
358  fLSelVolume->SetTextColor(color);
362  fBSelVolume->SetToolTipText("Select one of the existing volumes");
363  fBSelVolume->Associate(this);
364  f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
365  f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
366  f1 = new TGCompositeFrame(f3, 155, 30, kHorizontalFrame | kFixedWidth);
367  fEditVolume = new TGTextButton(f1, " Edit ");
368  f1->AddFrame(fEditVolume, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 2));
369  fEditVolume->SetToolTipText("Edit selected volume");
370  fEditVolume->Associate(this);
371  fSetTopVolume = new TGTextButton(f1, "Set top");
372  f1->AddFrame(fSetTopVolume, new TGLayoutHints(kLHintsRight, 1, 20, 2, 2));
373  fSetTopVolume->SetToolTipText("Set top volume for geometry");
374  fSetTopVolume->Associate(this);
375  f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
376  container->AddFrame(f3, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
377 
378  // Materials category
379  si = new TGShutterItem(fCategories, new TGHotString("Materials"),kCAT_MATERIALS);
380  container = (TGCompositeFrame*)si->GetContainer();
382  fCategories->AddItem(si);
383 
384  // Material creators
386  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
387  f1->AddFrame(label = new TGLabel(f1, "Create material/mixt."), new TGLayoutHints(kLHintsLeft, 2, 1, 0, 0));
388  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
389  gClient->GetColorByName("#ff0000", color);
390  label->SetTextColor(color);
391  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
392  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
393  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
396  fMaterialName->SetToolTipText("Enter the new material name");
397  f1->AddFrame(fMaterialName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
398  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
399 
400  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
401  f1->AddFrame(new TGLabel(f1, "Element"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
405  if (table) {
406  TGeoElement *element;
407  for (Int_t i=0; i<table->GetNelements(); i++) {
408  element = table->GetElement(i);
409  fElementList->AddEntry(element->GetTitle(),i);
410  }
411  }
412  fElementList->Select(0);
413  f1->AddFrame(fElementList, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
414  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
415  // Number entry for density
416  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
417  f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
423  nef->SetToolTipText("Enter material/mixture density");
425  fEntryDensity->Associate(this);
426  f1->AddFrame(fEntryDensity, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
427  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
428  // Buttons for creating materials/mixtures
429  // Picture buttons for different volumes
430  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
431  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
432  fMaterialButton[0] = new TGPictureButton(f1, fClient->GetPicture("geomaterial_t.xpm"), kCREATE_MATERIAL);
433  fMaterialButton[0]->SetToolTipText("Create a new material from element and density");
434  fMaterialButton[1] = new TGPictureButton(f1, fClient->GetPicture("geomixture_t.xpm"), kCREATE_MIXTURE);
435  fMaterialButton[1]->SetToolTipText("Create a new mixture with selected density");
436  for (ipict=0; ipict<2; ipict++) f1->AddFrame(fMaterialButton[ipict],lhb);
437  container->AddFrame(f1, lhf1);
438 
439  // List of materials
440  f4 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
441  f1 = new TGCompositeFrame(f4, 155, 10, kHorizontalFrame | kFixedWidth);
442  f1->AddFrame(label = new TGLabel(f1, "Existing materials"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
443  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
444  gClient->GetColorByName("#ff0000", color);
445  label->SetTextColor(color);
446  f4->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
447  f1 = new TGCompositeFrame(f4, 155, 30, kHorizontalFrame | kFixedWidth);
448  fSelectedMaterial = 0;
449  fLSelMaterial = new TGLabel(f1, "Select material");
450  gClient->GetColorByName("#0000ff", color);
451  fLSelMaterial->SetTextColor(color);
455  fBSelMaterial->SetToolTipText("Select one of the existing materials");
456  fBSelMaterial->Associate(this);
457  f1->AddFrame(fBSelMaterial, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
458  fEditMaterial = new TGTextButton(f1, "Edit");
459  f1->AddFrame(fEditMaterial, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
460  fEditMaterial->SetToolTipText("Edit selected material");
461  fEditMaterial->Associate(this);
462  f4->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
463  container->AddFrame(f4, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
464 
465  si = new TGShutterItem(fCategories, new TGHotString("Media"),kCAT_MEDIA);
466  container = (TGCompositeFrame*)si->GetContainer();
468  fCategories->AddItem(si);
469 
470  // Media category
471  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
472  f1->AddFrame(label = new TGLabel(f1, "Create new medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
473  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
474  gClient->GetColorByName("#ff0000", color);
475  label->SetTextColor(color);
476  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
477 
478  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
479  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
480  fMediumName = new TGTextEntry(f1, new TGTextBuffer(50), kMEDIUM_NAME);
482  fMediumName->SetToolTipText("Enter the new medium name");
483  f1->AddFrame(fMediumName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
484 
485  fMediumId = new TGNumberEntry(f1, 0., 5, kMEDIUM_ID);
490  nef->SetToolTipText("Enter medium ID");
492  fMediumId->Associate(this);
493  f1->AddFrame(fMediumId, new TGLayoutHints(kLHintsRight, 2, 2, 2 ,2));
494  f1->AddFrame(new TGLabel(f1, "ID"), new TGLayoutHints(kLHintsRight, 1, 1, 6, 0));
495  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
496  // ComboBox for materials
497  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
498  fSelectedMaterial2 = 0;
499  fLSelMaterial2 = new TGLabel(f1, "Select material");
500  gClient->GetColorByName("#0000ff", color);
505  fBSelMaterial2->SetToolTipText("Select one of the existing materials");
506  fBSelMaterial2->Associate(this);
507  f1->AddFrame(fBSelMaterial2, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
508  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
509  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
510  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
511  fMediumButton = new TGPictureButton(f1, fClient->GetPicture("geomedium_t.xpm"), kCREATE_MEDIUM);
512  fMediumButton->SetToolTipText("Create a new medium from selected material");
513  fMediumButton->Associate(this);
514  f1->AddFrame(fMediumButton, new TGLayoutHints(kLHintsLeft, 5, 2, 2, 2));
515  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
516 
517  // List of media
518  f5 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
520  f1->AddFrame(label = new TGLabel(f1, "Existing media"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
521  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
522  gClient->GetColorByName("#ff0000", color);
523  label->SetTextColor(color);
524  f5->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
525  f1 = new TGCompositeFrame(f5, 155, 30, kHorizontalFrame | kFixedWidth);
526  fSelectedMedium = 0;
527  fLSelMedium = new TGLabel(f1, "Select medium");
528  gClient->GetColorByName("#0000ff", color);
529  fLSelMedium->SetTextColor(color);
533  fBSelMedium->SetToolTipText("Select one of the existing media");
534  fBSelMedium->Associate(this);
535  f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
536  fEditMedium = new TGTextButton(f1, "Edit");
537  f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
538  fEditMedium->SetToolTipText("Edit selected medium");
539  fEditMedium->Associate(this);
540  f5->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
541  container->AddFrame(f5, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
542 
543  // Matrix category
544  si = new TGShutterItem(fCategories, new TGHotString("Matrices"),kCAT_MATRICES);
545  container = (TGCompositeFrame*)si->GetContainer();
547  fCategories->AddItem(si);
548  // Name entry
549  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
550  f1->AddFrame(label = new TGLabel(f1, "Create new matrix"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
551  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
552  gClient->GetColorByName("#ff0000", color);
553  label->SetTextColor(color);
554  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
555 
556  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
557  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
558  fMatrixName = new TGTextEntry(f1, new TGTextBuffer(50), kMATRIX_NAME);
560  fMatrixName->SetToolTipText("Enter the new matrix name");
561  f1->AddFrame(fMatrixName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
562  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
563  // Picture buttons for different matrices
564  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
565  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
566  fMatrixButton[0] = new TGPictureButton(f1, fClient->GetPicture("geotranslation_t.xpm"), kCREATE_TRANSLATION);
567  fMatrixButton[0]->SetToolTipText("Create a translation");
568  fMatrixButton[1] = new TGPictureButton(f1, fClient->GetPicture("georotation_t.xpm"), kCREATE_ROTATION);
569  fMatrixButton[1]->SetToolTipText("Create a rotation");
570  fMatrixButton[2] = new TGPictureButton(f1, fClient->GetPicture("geocombi_t.xpm"), kCREATE_COMBI);
571  fMatrixButton[2]->SetToolTipText("Create a rotation + translation");
572  for (ipict=0; ipict<3; ipict++) f1->AddFrame(fMatrixButton[ipict],lhb);
573  container->AddFrame(f1, lhf1);
574  // List of matrices
575  f6 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
576  f1 = new TGCompositeFrame(f6, 155, 10, kHorizontalFrame | kFixedWidth);
577  f1->AddFrame(label = new TGLabel(f1, "Existing matrices"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
578  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
579  gClient->GetColorByName("#ff0000", color);
580  label->SetTextColor(color);
581  f6->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
582  f1 = new TGCompositeFrame(f6, 155, 30, kHorizontalFrame | kFixedWidth);
583  fSelectedMatrix = 0;
584  fLSelMatrix = new TGLabel(f1, "Select matrix");
585  gClient->GetColorByName("#0000ff", color);
586  fLSelMatrix->SetTextColor(color);
590  fBSelMatrix->SetToolTipText("Select one of the existing matrices");
591  fBSelMatrix->Associate(this);
592  f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
593  fEditMatrix = new TGTextButton(f1, "Edit");
594  f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
595  fEditMatrix->SetToolTipText("Edit selected matrix");
596  fEditMatrix->Associate(this);
597  f6->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
598  container->AddFrame(f6, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
599 
600  fCategories->Resize(163,370);
601  AddFrame(fCategories, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
602 
604 
605  // Set the fTab and disconnect editor from the canvas.
606  fTab = fGedEditor->GetTab();
607  TCanvas* edCanvas = fGedEditor->GetCanvas();
609  if (edCanvas != fConnectedCanvas) {
611  if (edCanvas)
612  ConnectSelected(edCanvas);
613  fConnectedCanvas = edCanvas;
614  }
615 }
616 
617 ////////////////////////////////////////////////////////////////////////////////
618 /// Destructor.
619 
621 {
622  TGCompositeFrame *cont;
623  cont = (TGCompositeFrame*)fCategories->GetItem("General")->GetContainer();
625  fCategories->GetItem("General")->SetCleanup(0);
626  cont = (TGCompositeFrame*)fCategories->GetItem("Shapes")->GetContainer();
628  fCategories->GetItem("Shapes")->SetCleanup(0);
629  cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
631  fCategories->GetItem("Volumes")->SetCleanup(0);
632  cont = (TGCompositeFrame*)fCategories->GetItem("Materials")->GetContainer();
634  fCategories->GetItem("Materials")->SetCleanup(0);
635  cont = (TGCompositeFrame*)fCategories->GetItem("Media")->GetContainer();
637  fCategories->GetItem("Media")->SetCleanup(0);
638  cont = (TGCompositeFrame*)fCategories->GetItem("Matrices")->GetContainer();
640  fCategories->GetItem("Matrices")->SetCleanup(0);
641 
642  delete fExportOption[0]; delete fExportOption[1];
643 
644  Cleanup();
645 
646  if (fTabMgr) {
648  delete fTabMgr;
649  }
650 }
651 
652 ////////////////////////////////////////////////////////////////////////////////
653 /// Connected to TCanvas::Selected. TGeoManagerEditor takes this
654 /// function from TGedEditor and only uses it if obj is a TGeoVolume.
655 
657 {
658  if (event == kButton1 && obj->InheritsFrom(TGeoVolume::Class())) {
659  TGeoVolume* v = (TGeoVolume*) obj;
661  fTabMgr->SetTab();
663  v->Draw();
664  }
665 }
666 
668 {
669  // Connect to TCanvas::Selected.
670 
671  c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGeoManagerEditor",
672  this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
673 }
674 
676 {
677  // Disconnect from TCanvas::Selected.
678 
679  if (fConnectedCanvas)
680  Disconnect(fConnectedCanvas, "Selected(TVirtualPad*,TObject*,Int_t)",
681  this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
682 
683 }
684 
685 ////////////////////////////////////////////////////////////////////////////////
686 /// Connect signals to slots.
687 
689 {
690  fManagerName->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
691  fManagerTitle->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
692  fExportButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoExportGeometry()");
693  fCloseGeometry->Connect("Clicked()", "TGeoManagerEditor", this, "DoCloseGeometry()");
694  fShapeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateBox()");
695  fShapeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePara()");
696  fShapeButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd1()");
697  fShapeButton[3]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd2()");
698  fShapeButton[4]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrap()");
699  fShapeButton[5]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateGtra()");
700  fShapeButton[6]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateXtru()");
701  fShapeButton[7]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateArb8()");
702  fShapeButton[8]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTube()");
703  fShapeButton[9]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTubs()");
704  fShapeButton[10]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCone()");
705  fShapeButton[11]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCons()");
706  fShapeButton[12]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateSphe()");
707  fShapeButton[13]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCtub()");
708  fShapeButton[14]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateEltu()");
709  fShapeButton[15]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTorus()");
710  fShapeButton[16]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePcon()");
711  fShapeButton[17]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePgon()");
712  fShapeButton[18]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateHype()");
713  fShapeButton[19]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateParab()");
714  fShapeButton[20]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateComposite()");
715  fMatrixButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTranslation()");
716  fMatrixButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateRotation()");
717  fMatrixButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCombi()");
718  fVolumeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateVolume()");
719  fVolumeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateAssembly()");
720  fBSelTop->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectTopVolume()");
721  fBSelVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectVolume()");
722  fBSelShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape()");
723  fBSelShape2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape2()");
724  fBSelMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMatrix()");
725  fBSelMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial()");
726  fBSelMaterial2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial2()");
727  fBSelMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium()");
728  fBSelMedium2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium2()");
729  fSetTopVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSetTopVolume()");
730  fEditShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditShape()");
731  fEditMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMedium()");
732  fEditMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMaterial()");
733  fEditMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMatrix()");
734  fEditVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditVolume()");
735 
736  fMaterialButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMaterial()");
737  fMaterialButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMixture()");
738  fMediumButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMedium()");
739 }
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 /// Refresh editor according the selected obj.
743 
745 {
746  fGeometry = (TGeoManager*)obj;
753  // Check if master volume can be set
756  // Check if geometry is already closed
758  else {
761  }
762  // Check if volumes category can be activated
764  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kFALSE);
765  else
766  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
768  else ShowSelectShape();
770  else ShowSelectVolume();
772  else ShowSelectMedium();
774  else ShowSelectMatrix();
775 
776  // Check if media category can be activated
777  if (!fGeometry->GetListOfMaterials()->GetSize()) {
780  } else {
783  }
784 
785  fTab->SetTab(0);
786  fCategories->Layout();
787  if (fTabMgr == 0) {
790  }
792  // SetActive();
793 }
794 
795 ////////////////////////////////////////////////////////////////////////////////
796 /// Change name/title of the geometry
797 
799 {
802 }
803 
804 ////////////////////////////////////////////////////////////////////////////////
805 /// Export geometry as .root or .C file
806 
808 {
809  Bool_t asroot = fExportOption[0]->IsDown();
810  TString s = fGeometry->GetName();
811  s = s.Strip();
812  s.Remove(20);
813  const char *name;
814  if (asroot) name = TString::Format("%s.root", s.Data());
815  else name = TString::Format("%s.C", s.Data());
816  fGeometry->Export(name);
817 }
818 
819 ////////////////////////////////////////////////////////////////////////////////
820 /// Create a box.
821 
823 {
825  fSelectedShape = new TGeoBBox(TString::Format("box_%i",id), 1., 1., 1.);
826  ShowSelectShape();
827  // Check if volumes category can be activated
828  if (fGeometry->GetListOfMedia()->GetSize())
829  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
830  DoEditShape();
831 }
832 
833 ////////////////////////////////////////////////////////////////////////////////
834 /// Create a parallelipiped.
835 
837 {
839  fSelectedShape = new TGeoPara(TString::Format("para_%i",id), 1., 1., 1., 30., 20., 45.);
840  ShowSelectShape();
841  if (fGeometry->GetListOfMedia()->GetSize())
842  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
843  DoEditShape();
844 }
845 
846 ////////////////////////////////////////////////////////////////////////////////
847 /// Create a Trd1.
848 
850 {
852  fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i",id), 0.5, 1., 1., 1.);
853  ShowSelectShape();
854  if (fGeometry->GetListOfMedia()->GetSize())
855  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
856  DoEditShape();
857 }
858 
859 ////////////////////////////////////////////////////////////////////////////////
860 /// Create a Trd2.
861 
863 {
865  fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i",id), 0.5, 1., 0.5, 1., 1.);
866  ShowSelectShape();
867  if (fGeometry->GetListOfMedia()->GetSize())
868  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
869  DoEditShape();
870 }
871 
872 ////////////////////////////////////////////////////////////////////////////////
873 /// Create a general trapezoid.
874 
876 {
878  fSelectedShape = new TGeoTrap(TString::Format("trap_%i",id), 1., 15., 45., 0.5, 0.3, 0.5, 30., 0.5, 0.3, 0.5, 30.);
879  ShowSelectShape();
880  if (fGeometry->GetListOfMedia()->GetSize())
881  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
882  DoEditShape();
883 }
884 
885 ////////////////////////////////////////////////////////////////////////////////
886 /// Create a twisted trapezoid.
887 
889 {
891  fSelectedShape = new TGeoGtra(TString::Format("gtra_%i",id), 1., 15., 45., 45.,0.5, 0.3, 0.5, 30., 0.5, 0.3, 0.5, 30.);
892  ShowSelectShape();
893  if (fGeometry->GetListOfMedia()->GetSize())
894  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
895  DoEditShape();
896 }
897 
898 ////////////////////////////////////////////////////////////////////////////////
899 /// Create an extruded polygone.
900 
902 {
903 }
904 
905 ////////////////////////////////////////////////////////////////////////////////
906 /// Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel
907 /// planes
908 
910 {
911 }
912 
913 ////////////////////////////////////////////////////////////////////////////////
914 /// Create a tube.
915 
917 {
919  fSelectedShape = new TGeoTube(TString::Format("tube_%i",id), 0.5, 1., 1.);
920  ShowSelectShape();
921  if (fGeometry->GetListOfMedia()->GetSize())
922  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
923  DoEditShape();
924 }
925 
926 ////////////////////////////////////////////////////////////////////////////////
927 /// Create a tube segment.
928 
930 {
932  fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i",id), 0.5, 1., 1.,0.,45.);
933  ShowSelectShape();
934  if (fGeometry->GetListOfMedia()->GetSize())
935  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
936  DoEditShape();
937 }
938 
939 ////////////////////////////////////////////////////////////////////////////////
940 /// Create a cone.
941 
943 {
945  fSelectedShape = new TGeoCone(TString::Format("cone_%i",id), 0.5, 0.5, 1., 1.5, 2.);
946  ShowSelectShape();
947  if (fGeometry->GetListOfMedia()->GetSize())
948  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
949  DoEditShape();
950 }
951 
952 ////////////////////////////////////////////////////////////////////////////////
953 /// Create a cone segment.
954 
956 {
958  fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i",id), 0.5, 0.5, 1., 1.5, 2.,0.,45.);
959  ShowSelectShape();
960  if (fGeometry->GetListOfMedia()->GetSize())
961  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
962  DoEditShape();
963 }
964 
965 ////////////////////////////////////////////////////////////////////////////////
966 /// Create a sphere.
967 
969 {
971  fSelectedShape = new TGeoSphere(TString::Format("sphere_%i",id), 0.5, 1., 0., 180., 0.,360.);
972  ShowSelectShape();
973  if (fGeometry->GetListOfMedia()->GetSize())
974  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
975  DoEditShape();
976 }
977 
978 ////////////////////////////////////////////////////////////////////////////////
979 /// Create a cut tube.
980 
982 {
984  fSelectedShape = new TGeoCtub(TString::Format("ctub_%i",id), 0.5, 1., 1.,0.,45.,0.,0.,-1,0.,0.,1);
985  ShowSelectShape();
986  if (fGeometry->GetListOfMedia()->GetSize())
987  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
988  DoEditShape();
989 }
990 
991 ////////////////////////////////////////////////////////////////////////////////
992 /// Create an elliptical tube.
993 
995 {
997  fSelectedShape = new TGeoEltu(TString::Format("para_%i",id), 1., 2., 1.5 );
998  ShowSelectShape();
999  if (fGeometry->GetListOfMedia()->GetSize())
1000  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1001  DoEditShape();
1002 }
1003 
1004 ////////////////////////////////////////////////////////////////////////////////
1005 /// Create a torus shape.
1006 
1008 {
1010  fSelectedShape = new TGeoTorus(TString::Format("torus_%i",id), 10., 1., 1.5, 0, 360.);
1011  ShowSelectShape();
1012  if (fGeometry->GetListOfMedia()->GetSize())
1013  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1014  DoEditShape();
1015 
1016 }
1017 
1018 ////////////////////////////////////////////////////////////////////////////////
1019 /// Create a polycone shape.
1020 
1022 {
1024  fSelectedShape = new TGeoPcon(TString::Format("pcon_%i",id), 0., 360., 2);
1025  ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1026  ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1027  ShowSelectShape();
1028  if (fGeometry->GetListOfMedia()->GetSize())
1029  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1030  DoEditShape();
1031 }
1032 
1033 ////////////////////////////////////////////////////////////////////////////////
1034 /// Create a polygone shape.
1035 
1037 {
1039  fSelectedShape = new TGeoPgon(TString::Format("pgon_%i",id), 0., 360.,6,2);
1040  ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1041  ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1042  ShowSelectShape();
1043  if (fGeometry->GetListOfMedia()->GetSize())
1044  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1045  DoEditShape();
1046 }
1047 
1048 ////////////////////////////////////////////////////////////////////////////////
1049 /// Create a hyperboloid.
1050 
1052 {
1054  fSelectedShape = new TGeoHype(TString::Format("hype_%i",id), 1., 15., 2., 30., 5.);
1055  ShowSelectShape();
1056  if (fGeometry->GetListOfMedia()->GetSize())
1057  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1058  DoEditShape();
1059 }
1060 
1061 ////////////////////////////////////////////////////////////////////////////////
1062 /// Create a paraboloid.
1063 
1065 {
1066 }
1067 
1068 ////////////////////////////////////////////////////////////////////////////////
1069 /// Create a composite shape.
1070 
1072 {
1073 }
1074 
1075 ////////////////////////////////////////////////////////////////////////////////
1076 /// Create a new material.
1077 
1079 {
1081  if (!el) {
1082  Error("DoCreateMaterial", "Cannot find selected element in list");
1083  return;
1084  }
1085  Double_t density = fEntryDensity->GetNumber();
1086  const char *name = fMaterialName->GetText();
1087  fSelectedMaterial = new TGeoMaterial(name, el, density);
1089  fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1090  DoEditMaterial();
1092 }
1093 
1094 ////////////////////////////////////////////////////////////////////////////////
1095 /// Create a new mixture.
1096 
1098 {
1099  Double_t density = fEntryDensity->GetNumber();
1100  const char *name = fMaterialName->GetText();
1101  fSelectedMaterial = new TGeoMixture(name, 1, density);
1103  fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1104  DoEditMaterial();
1106 }
1107 
1108 ////////////////////////////////////////////////////////////////////////////////
1109 /// Create a new medium.
1110 
1112 {
1113  Int_t id = fMediumId->GetIntNumber();
1114  if (!fSelectedMaterial2) return;
1115  const char *name = fMediumName->GetText();
1117  ShowSelectMedium();
1119  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1120  DoEditMedium();
1122 }
1123 
1124 ////////////////////////////////////////////////////////////////////////////////
1125 /// Create a new translation.
1126 
1128 {
1129  const char *name = fMatrixName->GetText();
1130  fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1133  ShowSelectMatrix();
1134  DoEditMatrix();
1136 }
1137 
1138 ////////////////////////////////////////////////////////////////////////////////
1139 /// Create a new rotation.
1140 
1142 {
1143  const char *name = fMatrixName->GetText();
1144  fSelectedMatrix = new TGeoRotation(name);
1147  ShowSelectMatrix();
1148  DoEditMatrix();
1150 }
1151 
1152 ////////////////////////////////////////////////////////////////////////////////
1153 /// Create a new volume.
1154 
1156 {
1157  const char *name = fVolumeName->GetText();
1158  if (!fSelectedShape2 || !fSelectedMedium2) return;
1160  fLSelVolume->SetText(name);
1161  ShowSelectVolume();
1162  DoEditVolume();
1164 }
1165 
1166 ////////////////////////////////////////////////////////////////////////////////
1167 /// Create a new volume assembly.
1168 
1170 {
1171  const char *name = fVolumeName->GetText();
1172  fSelectedVolume = new TGeoVolumeAssembly(name);
1173  fLSelVolume->SetText(name);
1174  ShowSelectVolume();
1175  DoEditVolume();
1177 }
1178 
1179 ////////////////////////////////////////////////////////////////////////////////
1180 /// Create a new translation + rotation.
1181 
1183 {
1184  const char *name = fMatrixName->GetText();
1185  fSelectedMatrix = new TGeoCombiTrans(name, 0., 0., 0., new TGeoRotation());
1189  ShowSelectMatrix();
1190  DoEditMatrix();
1192 }
1193 
1194 ////////////////////////////////////////////////////////////////////////////////
1195 /// Set top volume for the geometry.
1196 
1198 {
1199  if (!fSelectedVolume) return;
1202 }
1203 
1204 ////////////////////////////////////////////////////////////////////////////////
1205 /// Slot for editing selected shape.
1206 
1208 {
1209  if (!fSelectedShape) return;
1211  fSelectedShape->Draw();
1212  fTabMgr->GetPad()->GetView()->ShowAxis();
1213 }
1214 
1215 ////////////////////////////////////////////////////////////////////////////////
1216 /// Slot for editing selected volume.
1217 
1219 {
1220  if (!fSelectedVolume) {
1222  return;
1223  }
1225  fTabMgr->SetTab();
1227  fSelectedVolume->Draw();
1228 }
1229 
1230 ////////////////////////////////////////////////////////////////////////////////
1231 /// Slot for editing selected medium.
1232 
1234 {
1235  if (!fSelectedMedium) return;
1237 }
1238 
1239 ////////////////////////////////////////////////////////////////////////////////
1240 /// Slot for editing selected material.
1241 
1243 {
1244  if (!fSelectedMaterial) return;
1246 }
1247 
1248 ////////////////////////////////////////////////////////////////////////////////
1249 /// Slot for editing selected matrix.
1250 
1252 {
1253  if (!fSelectedMatrix) return;
1255 }
1256 
1257 ////////////////////////////////////////////////////////////////////////////////
1258 /// Slot for selecting an existing matrix.
1259 
1261 {
1262  TGeoMatrix *matrix = fSelectedMatrix;
1263  new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200,300);
1265  if (fSelectedMatrix) fLSelMatrix->SetText(fSelectedMatrix->GetName());
1266  else fSelectedMatrix = matrix;
1267 }
1268 
1269 ////////////////////////////////////////////////////////////////////////////////
1270 /// Slot for selecting an existing shape.
1271 
1273 {
1274  TGeoShape *shape = fSelectedShape;
1275  new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200,300);
1277  if (fSelectedShape) fLSelShape->SetText(fSelectedShape->GetName());
1278  else fSelectedShape = shape;
1279 }
1280 
1281 ////////////////////////////////////////////////////////////////////////////////
1282 /// Slot for selecting a shape for making a volume.
1283 
1285 {
1286  TGeoShape *shape = fSelectedShape2;
1287  new TGeoShapeDialog(fBSelShape2, gClient->GetRoot(), 200,300);
1289  if (fSelectedShape2) fLSelShape2->SetText(fSelectedShape2->GetName());
1290  else fSelectedShape2 = shape;
1291 }
1292 
1293 ////////////////////////////////////////////////////////////////////////////////
1294 /// Slot for selecting an existing material.
1295 
1297 {
1299  new TGeoMaterialDialog(fBSelMaterial, gClient->GetRoot(), 200,300);
1301  if (fSelectedMaterial) fLSelMaterial->SetText(fSelectedMaterial->GetName());
1302  else fSelectedMaterial = mat;
1303 }
1304 
1305 ////////////////////////////////////////////////////////////////////////////////
1306 /// Slot for selecting an existing material and making a medium.
1307 
1309 {
1311  new TGeoMaterialDialog(fBSelMaterial2, gClient->GetRoot(), 200,300);
1313  if (fSelectedMaterial2) fLSelMaterial2->SetText(fSelectedMaterial2->GetName());
1314  else fSelectedMaterial2 = mat;
1315 }
1316 
1317 ////////////////////////////////////////////////////////////////////////////////
1318 /// Slot for selecting an existing medium.
1319 
1321 {
1322  TGeoMedium *med = fSelectedMedium;
1323  new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200,300);
1325  if (fSelectedMedium) fLSelMedium->SetText(fSelectedMedium->GetName());
1326  else fSelectedMedium = med;
1327 }
1328 
1329 ////////////////////////////////////////////////////////////////////////////////
1330 /// Slot for selecting an existing medium for making a volume.
1331 
1333 {
1335  new TGeoMediumDialog(fBSelMedium2, gClient->GetRoot(), 200,300);
1337  if (fSelectedMedium2) fLSelMedium2->SetText(fSelectedMedium2->GetName());
1338  else fSelectedMedium2 = med;
1339 }
1340 
1341 ////////////////////////////////////////////////////////////////////////////////
1342 /// Slot for selecting an existing volume.
1343 
1345 {
1346  TGeoVolume *vol = fSelectedVolume;
1347  new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200,300);
1349  if (fSelectedVolume) fLSelVolume->SetText(fSelectedVolume->GetName());
1350  else fSelectedVolume = vol;
1351 }
1352 
1353 ////////////////////////////////////////////////////////////////////////////////
1354 /// Slot for setting top geometry volume.
1355 
1357 {
1358  TGeoVolume *vol = fGeometry->GetTopVolume();
1359  new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200,300);
1361  if (fSelectedVolume) fLSelTop->SetText(fSelectedVolume->GetName());
1362  else fSelectedVolume = vol;
1363  if (fSelectedVolume && (fSelectedVolume != vol)) fGeometry->SetTopVolume(fSelectedVolume);
1364 }
1365 
1366 ////////////////////////////////////////////////////////////////////////////////
1367 /// Slot for closing the geometry.
1368 
1370 {
1373 }
1374 
1375 ////////////////////////////////////////////////////////////////////////////////
1376 /// Show/hide interface for shape selection.
1377 
1379 {
1381  if (show) cont->ShowFrame(f2);
1382  else cont->HideFrame(f2);
1383 }
1384 
1385 ////////////////////////////////////////////////////////////////////////////////
1386 /// Show/hide interface for volume selection.
1387 
1389 {
1391  if (show) cont->ShowFrame(f7);
1392  else cont->HideFrame(f7);
1393  cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
1394  if (show) cont->ShowFrame(f3);
1395  else cont->HideFrame(f3);
1396 }
1397 
1398 ////////////////////////////////////////////////////////////////////////////////
1399 /// Show/hide interface for material selection.
1400 
1402 {
1404  if (show) cont->ShowFrame(f4);
1405  else cont->HideFrame(f4);
1406 }
1407 
1408 ////////////////////////////////////////////////////////////////////////////////
1409 /// Show/hide interface for medium selection.
1410 
1412 {
1414  if (show) cont->ShowFrame(f5);
1415  else cont->HideFrame(f5);
1416 }
1417 
1418 ////////////////////////////////////////////////////////////////////////////////
1419 /// Show/hide interface for matrix selection.
1420 
1422 {
1424  if (show) cont->ShowFrame(f6);
1425  else cont->HideFrame(f6);
1426 }
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
void DoEditMedium()
Slot for editing selected medium.
TGPictureButton * fBSelTop
Mixtures of elements.
Definition: TGeoMaterial.h:134
Spherical shell class.
Definition: TGeoSphere.h:17
Cylindrical tube class.
Definition: TGeoTube.h:17
void DoCreateCons()
Create a cone segment.
TGPictureButton * fBSelMedium
void SetTab()
Set a given tab element as active one.
TGNumberEntry * fMediumId
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
void DoExportGeometry()
Export geometry as .root or .C file.
void DoSelectMedium()
Slot for selecting an existing medium.
Box class.
Definition: TGeoBBox.h:17
void ShowSelectShape(Bool_t show=kTRUE)
Show/hide interface for shape selection.
Volume assemblies.
Definition: TGeoVolume.h:307
Table of elements.
Definition: TGeoElement.h:369
void DoCreateComposite()
Create a composite shape.
TGPictureButton * fVolumeButton[2]
void DoCreateXtru()
Create an extruded polygone.
virtual void ConnectSignals2Slots()
Connect signals to slots.
Gtra is a twisted trapezoid.
Definition: TGeoArb8.h:143
Geometrical transformation package.
Definition: TGeoMatrix.h:40
void DoCreateSphe()
Create a sphere.
void DoEditMaterial()
Slot for editing selected material.
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGLabel.cxx:359
void DoCloseGeometry()
Slot for closing the geometry.
TGShutter * fCategories
TGTextEntry * fMatrixName
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
void DoSelectMatrix()
Slot for selecting an existing matrix.
A polycone.
Definition: TGeoPcon.h:17
void ShowSelectMatrix(Bool_t show=kTRUE)
Show/hide interface for matrix selection.
void DoSelectShape()
Slot for selecting an existing shape.
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
A polygone.
Definition: TGeoPgon.h:19
virtual void SetButton(Int_t id, Bool_t down=kTRUE)
Sets the button with id to be on/down, and if this is an exclusive group, all other button in the gro...
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
TGeoVolume * fSelectedVolume
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
void DoCreateMaterial()
Create a new material.
TGeoMedium * fSelectedMedium
virtual void SetNumber(Double_t val)
virtual void Draw(Option_t *option="")
draw top volume according to option
TGCompositeFrame * fVolumeTab
Class describing translations.
Definition: TGeoMatrix.h:121
Torus segment class.
Definition: TGeoTorus.h:17
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void DoCreateEltu()
Create an elliptical tube.
TGTab * GetTab() const
Definition: TGedEditor.h:84
Basic string class.
Definition: TString.h:125
Base class describing materials.
Definition: TGeoMaterial.h:29
#define gClient
Definition: TGClient.h:166
void DoCreateTrd2()
Create a Trd2.
void DoCreateTrd1()
Create a Trd1.
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGeoVolume * GetMasterVolume() const
Definition: TGeoManager.h:499
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
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.
A trapezoid with only x length varying with z.
Definition: TGeoTrd1.h:17
void SetVolTabEnabled(Bool_t flag=kTRUE)
Enable/disable tabs.
TGPictureButton * fBSelVolume
TGTextEntry * fManagerName
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
TList * GetListOfMaterials() const
Definition: TGeoManager.h:463
void DoSelectVolume()
Slot for selecting an existing volume.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
TList * GetListOfMedia() const
Definition: TGeoManager.h:464
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Definition: TGShutter.cxx:71
TGeoTabManager * fTabMgr
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
Export this geometry to a file.
TGPictureButton * fBSelMaterial
TGTextButton * fEditVolume
TGFrame * GetContainer() const
Definition: TGShutter.h:59
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2365
ULong_t Pixel_t
Definition: GuiTypes.h:39
A phi segment of a conical tube.
Definition: TGeoCone.h:98
virtual Long_t GetIntNumber() const
void Class()
Definition: Class.C:29
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
void DoCreateBox()
Create a box.
void DoCreateTranslation()
Create a new translation.
void DoCreateCombi()
Create a new translation + rotation.
void DoEditVolume()
Slot for editing selected volume.
TGCompositeFrame * f5
void DoSelectTopVolume()
Slot for setting top geometry volume.
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
TGCompositeFrame * f2
Base class for chemical elements.
Definition: TGeoElement.h:36
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:443
TGCompositeFrame(const TGCompositeFrame &)
void DoCreateCone()
Create a cone.
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by &#39;owner&#39; in extra tab &#39;name&#39;.
Definition: TGedFrame.cxx:123
virtual void SetRadioButtonExclusive(Bool_t flag=kTRUE)
If enable is kTRUE, this button group will treat radio buttons as mutually exclusive, and other buttons according to IsExclusive().
TGPictureButton * fShapeButton[21]
TGShutterItem * GetItem(const char *name)
returns a shutter item by name (name is hot string of shutter item)
Definition: TGShutter.cxx:300
void DoCreateRotation()
Create a new rotation.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:294
void DoCreateTorus()
Create a torus shape.
TRAP is a general trapezoid, i.e.
Definition: TGeoArb8.h:89
Editor for TGeoManager class.
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:49
virtual TView * GetView() const =0
TGeoShape * fSelectedShape2
TGCompositeFrame * GetVolumeTab() const
TGTextButton * fEditMedium
TGeoMedium * fSelectedMedium2
void DoEditShape()
Slot for editing selected shape.
A trapezoid with both x and y lengths varying with z.
Definition: TGeoTrd2.h:17
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:867
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
Parallelepiped class.
Definition: TGeoPara.h:17
void ShowSelectMaterial(Bool_t show=kTRUE)
Show/hide interface for material selection.
TGCompositeFrame * f4
void DoCreateMedium()
Create a new medium.
Base abstract class for all shapes.
Definition: TGeoShape.h:25
void ConnectSelected(TCanvas *c)
TGTextButton * fCloseGeometry
TGeoMatrix * fSelectedMatrix
Class describing rotation + translation.
Definition: TGeoMatrix.h:291
SVector< double, 2 > v
Definition: Dict.h:5
void SetNumStyle(EStyle style)
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing...
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:221
void ShowSelectVolume(Bool_t show=kTRUE)
Show/hide interface for volume selection.
TObjArray * GetListOfShapes() const
Definition: TGeoManager.h:467
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition: TGTab.cxx:507
virtual void SetModel(TObject *obj)
Refresh editor according the selected obj.
unsigned int UInt_t
Definition: RtypesCore.h:42
Hyperboloid class defined by 5 parameters.
Definition: TGeoHype.h:17
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
void DoCreateTrap()
Create a general trapezoid.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:526
TGTextButton * fSetTopVolume
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
virtual void ShowAxis()=0
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1080
Int_t GetNelements() const
Definition: TGeoElement.h:417
void ShowSelectMedium(Bool_t show=kTRUE)
Show/hide interface for medium selection.
TGTextButton * fEditMaterial
TGComboBox * fElementList
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
static TObject * GetSelected()
static; return selected object
TGeoMaterial * fSelectedMaterial2
TGTextEntry * fVolumeName
void SetNumAttr(EAttribute attr=kNEAAnyNumber)
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:462
Class describing rotations.
Definition: TGeoMatrix.h:174
TVirtualPad * GetPad() const
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual void Layout()
Layout shutter items.
Definition: TGShutter.cxx:216
void DoCreateGtra()
Create a twisted trapezoid.
const char * GetText() const
Definition: TGTextEntry.h:134
TString & Remove(Ssiz_t pos)
Definition: TString.h:619
A tube segment cut with 2 planes.
Definition: TGeoTube.h:168
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
The Canvas class.
Definition: TCanvas.h:31
virtual ~TGeoManagerEditor()
Destructor.
TGCompositeFrame * f6
TGCompositeFrame * f7
void DoCreateHype()
Create a hyperboloid.
TGTextEntry * fMaterialName
#define ClassImp(name)
Definition: Rtypes.h:359
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:559
void DoCreateTubs()
Create a tube segment.
void DoSelectMaterial2()
Slot for selecting an existing material and making a medium.
double Double_t
Definition: RtypesCore.h:55
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
virtual Double_t GetNumber() const
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:287
TGCompositeFrame * f3
Conical tube class.
Definition: TGeoCone.h:17
TGTextButton * fEditShape
static constexpr double s
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1025
TGNumberEntry * fEntryDensity
ETGeoVolumeWid
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void Show()
Show group of buttons.
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:23
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.
TGPictureButton * fMatrixButton[3]
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:37
TGPictureButton * fBSelShape
TGPictureButton * fMediumButton
void DoCreatePgon()
Create a polygone shape.
TGeoManager * fGeometry
TGPictureButton * fBSelShape2
Bool_t fInit
Definition: TGedFrame.h:53
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
TGNumberEntryField * GetNumberEntry() const
Elliptical tube class.
Definition: TGeoEltu.h:17
TGCompositeFrame * fVolumeTab
TGRadioButton * fExportOption[2]
TGClient * fClient
Definition: TGObject.h:37
TGTextEntry * fManagerTitle
void DoCreatePcon()
Create a polycone shape.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:465
void BuildDefaultMaterials()
Now just a shortcut for GetElementTable.
TF1 * f1
Definition: legend1.C:11
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
TGPictureButton * fBSelMatrix
void DoCreateVolume()
Create a new volume.
TGButton * GetButton() const
Definition: TGShutter.h:58
TGTextButton * fEditMatrix
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:322
TGPictureButton * fMaterialButton[2]
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line...
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:500
Bool_t IsClosed() const
Definition: TGeoManager.h:282
void DoCreateCtub()
Create a cut tube.
TGTextEntry * fMediumName
virtual Int_t GetSize() const
Definition: TCollection.h:180
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
virtual void Draw(Option_t *option="")
Draw this shape.
Definition: TGeoShape.cxx:721
virtual Bool_t IsDown() const
Definition: TGButton.h:371
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:87
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:395
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:303
void DoCreateAssembly()
Create a new volume assembly.
void DoEditMatrix()
Slot for editing selected matrix.
char name[80]
Definition: TGX11.cxx:109
TGeoMaterial * fSelectedMaterial
void DoName()
Change name/title of the geometry.
UInt_t GetDefaultHeight() const
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.
const char * Data() const
Definition: TString.h:345
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:88
A phi segment of a tube.
Definition: TGeoTube.h:88