Logo ROOT   6.10/09
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 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TGeoManagerEditor //
15 //
16 //////////////////////////////////////////////////////////////////////////
17 /*
18  Editor for TGeoManager class. Provides also builder functionality for the
19  main TGeo objects: TGeoVolume, TGeoShape - derived classes, TGeoMaterial,
20  TGeoMatrix - derived transformations and TGeoMedium.
21  The GUI represents the main entry point for editing geometry classes. It
22  can be started either by:
23  1. TGeoManager::Edit(). The method must be used when starting from a new
24  geometry.
25  2. Left-click on the 40x40 pixels top-right corner of a pad containing a
26  drawn volume. The region is always accesible when drawing geometry elements
27  and allows also restoring the manager editor in the "Style" tab of the GED
28  editor anytime.
29 
30  The TGeoManager editor is vertically split by a TGShutter widget into the
31  following categories:
32 
33  - General. This allows changing the name/title of the geometry, setting the
34  top volume, closing the geometry and saving the geometry in a file. The name
35  of the geometry file is formed by geometry_name.C/.root depending if the geometry
36  need to be saved as a C macro or a .root file.
37  - Shapes. The category provide buttons for creation of all supported shapes. The
38  new shape name is chosen by the interface, but can be changed from the shape
39  editor GUI. Existing shapes can be browsed and edited from the same category.
40  - Volumes. The category allows the creation of a new volume having a given name,
41  shape and medium. For creating a volume assembly only the name is relevant.
42  Existing volumes can be browsed or edited from this category.
43  - Materials. Allows creation of new materials/mixtures or editing existing ones.
44  - Media. The same for creation/editing of tracking media (materials having a set
45  of properties related to tracking)
46  - Matrices. Allows creation of translations, rotations or combined transformations.
47  Existing matrices can also be browser/edited.
48 */
49 
50 #include "TVirtualPad.h"
51 #include "TCanvas.h"
52 #include "TBaseClass.h"
53 #include "TGTab.h"
54 #include "TG3DLine.h"
55 #include "TGComboBox.h"
56 #include "TGButton.h"
57 #include "TGButtonGroup.h"
58 #include "TGTextEntry.h"
59 #include "TGNumberEntry.h"
60 #include "TGLabel.h"
61 #include "TGShutter.h"
62 
63 #include "TGeoVolumeEditor.h"
64 #include "TGeoNodeEditor.h"
65 #include "TGeoTabManager.h"
66 #include "TGeoVolume.h"
67 #include "TGeoManager.h"
68 #include "TGeoMatrix.h"
69 #include "TGeoBBox.h"
70 #include "TGeoPara.h"
71 #include "TGeoArb8.h"
72 #include "TGeoTube.h"
73 #include "TGeoEltu.h"
74 #include "TGeoHype.h"
75 #include "TGeoTorus.h"
76 #include "TGeoTrd1.h"
77 #include "TGeoTrd2.h"
78 #include "TGeoCone.h"
79 #include "TGeoSphere.h"
80 #include "TGeoPcon.h"
81 #include "TGeoPgon.h"
82 #include "TGeoElement.h"
83 #include "TGeoMaterial.h"
84 #include "TView.h"
85 
86 #include "TGeoManagerEditor.h"
87 #include "TGedEditor.h"
88 
90 
108 };
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Constructor for manager editor.
112 
114  Int_t height, UInt_t options, Pixel_t back)
115  : TGedFrame(p, width, height, options | kVerticalFrame, back)
116 {
118  fTabMgr = 0;
119  fTab = 0;
120  fConnectedCanvas = 0;
121 
124  TGLabel *label;
125 
126  // TGShutter for categories
128 
129  TGCompositeFrame *container;
130  Pixel_t color;
131  // General settings
133  container = (TGCompositeFrame*)si->GetContainer();
135  fCategories->AddItem(si);
136  // TextEntry for manager name
137  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
138  f1->AddFrame(label = new TGLabel(f1, "Name/Title"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
139  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
140  gClient->GetColorByName("#ff0000", color);
141  label->SetTextColor(color);
142  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
143  fManagerName = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_NAME);
145  fManagerName->SetToolTipText("Enter the geometry name");
146  container->AddFrame(fManagerName, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
147  fManagerTitle = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_TITLE);
149  fManagerTitle->SetToolTipText("Enter the geometry name");
150  container->AddFrame(fManagerTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
151  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
152  f1->AddFrame(label = new TGLabel(f1, "Export geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
153  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
154  gClient->GetColorByName("#ff0000", color);
155  label->SetTextColor(color);
156  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 6, 0));
157  TString stitle = "Options";
158  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
159  TGButtonGroup *bg = new TGVButtonGroup(f1, stitle);
160  fExportOption[0] = new TGRadioButton(bg, ".root", kEXPORT_ROOT);
161  fExportOption[1] = new TGRadioButton(bg, ".C", kEXPORT_C);
162  fExportButton = new TGTextButton(f1, "Export", kEXPORT_GEOMETRY);
164  bg->SetButton(kEXPORT_ROOT);
165  bg->Show();
166  f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
167  f1->AddFrame(fExportButton, new TGLayoutHints(kLHintsLeft, 20, 2, 22, 0));
168  container->AddFrame(f1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
169  // Close geometry
170  f7 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
171  f1 = new TGCompositeFrame(f7, 155, 10, kHorizontalFrame | kFixedWidth);
172  f1->AddFrame(label = new TGLabel(f1, "Close geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
173  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
174  gClient->GetColorByName("#ff0000", color);
175  label->SetTextColor(color);
176  f7->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
177  f1 = new TGCompositeFrame(f7, 155, 30, kHorizontalFrame | kFixedWidth);
178  fLSelTop = new TGLabel(f1, "Select top");
179  gClient->GetColorByName("#0000ff", color);
180  fLSelTop->SetTextColor(color);
183  fBSelTop = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_TOP_SELECT);
184  fBSelTop->SetToolTipText("Select the top volume");
185  fBSelTop->Associate(this);
186  f1->AddFrame(fBSelTop, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
187  fCloseGeometry = new TGTextButton(f1, "Close");
188  f1->AddFrame(fCloseGeometry, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
189  fCloseGeometry->SetToolTipText("Close geometry to make it ready for tracking");
190  fCloseGeometry->Associate(this);
191  f7->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
192  container->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
193 
194 
195  si = new TGShutterItem(fCategories, new TGHotString("Shapes"),kCAT_SHAPES);
196  container = (TGCompositeFrame*)si->GetContainer();
198  fCategories->AddItem(si);
199 
200  // Shape creators
201  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
202  f1->AddFrame(label = new TGLabel(f1, "Create new shape"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
203  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
204  gClient->GetColorByName("#ff0000", color);
205  label->SetTextColor(color);
206  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
207  TGLayoutHints *lhb = new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0);
208  TGLayoutHints *lhf1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
209  Int_t ipict;
210  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
211  fShapeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geobbox_t.xpm"), kCREATE_BOX);
212  fShapeButton[0]->SetToolTipText("Create a box");
213  fShapeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geopara_t.xpm"), kCREATE_PARA);
214  fShapeButton[1]->SetToolTipText("Create a parallelipiped");
215  fShapeButton[2] = new TGPictureButton(f1, fClient->GetPicture("geotrd1_t.xpm"), kCREATE_TRD1);
216  fShapeButton[2]->SetToolTipText("Create a TRD1 trapezoid");
217  fShapeButton[3] = new TGPictureButton(f1, fClient->GetPicture("geotrd2_t.xpm"), kCREATE_TRD2);
218  fShapeButton[3]->SetToolTipText("Create a TRD2 trapezoid");
219  fShapeButton[4] = new TGPictureButton(f1, fClient->GetPicture("geotrap_t.xpm"), kCREATE_TRAP);
220  fShapeButton[4]->SetToolTipText("Create a general trapezoid");
221  fShapeButton[5] = new TGPictureButton(f1, fClient->GetPicture("geogtra_t.xpm"), kCREATE_GTRA);
222  fShapeButton[5]->SetToolTipText("Create a general twisted trapezoid");
223  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict],lhb);
224  container->AddFrame(f1, lhf1);
225  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
226  fShapeButton[6] = new TGPictureButton(f1, fClient->GetPicture("geoxtru_t.xpm"), kCREATE_XTRU);
227  fShapeButton[6]->SetToolTipText("Create a extruded polygone");
228  fShapeButton[7] = new TGPictureButton(f1, fClient->GetPicture("geoarb8_t.xpm"), kCREATE_ARB8);
229  fShapeButton[7]->SetToolTipText("Create an arbitrary trapezoid with 8 vertices");
230  fShapeButton[8] = new TGPictureButton(f1, fClient->GetPicture("geotube_t.xpm"), kCREATE_TUBE);
231  fShapeButton[8]->SetToolTipText("Create a cylindrical pipe");
232  fShapeButton[9] = new TGPictureButton(f1, fClient->GetPicture("geotubeseg_t.xpm"), kCREATE_TUBS);
233  fShapeButton[9]->SetToolTipText("Create a cylindrical pipe within a phi range");
234  fShapeButton[10] = new TGPictureButton(f1, fClient->GetPicture("geocone_t.xpm"), kCREATE_CONE);
235  fShapeButton[10]->SetToolTipText("Create a conical pipe");
236  fShapeButton[11] = new TGPictureButton(f1, fClient->GetPicture("geoconeseg_t.xpm"), kCREATE_CONS);
237  fShapeButton[11]->SetToolTipText("Create a conical pipe within a phi range");
238  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+6],lhb);
239  container->AddFrame(f1, lhf1);
240  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
241  fShapeButton[12] = new TGPictureButton(f1, fClient->GetPicture("geosphere_t.xpm"), kCREATE_SPHE);
242  fShapeButton[12]->SetToolTipText("Create a spherical sector");
243  fShapeButton[13] = new TGPictureButton(f1, fClient->GetPicture("geoctub_t.xpm"), kCREATE_CTUB);
244  fShapeButton[13]->SetToolTipText("Create a cut tube");
245  fShapeButton[14] = new TGPictureButton(f1, fClient->GetPicture("geoeltu_t.xpm"), kCREATE_ELTU);
246  fShapeButton[14]->SetToolTipText("Create an eliptical tube");
247  fShapeButton[15] = new TGPictureButton(f1, fClient->GetPicture("geotorus_t.xpm"), kCREATE_TORUS);
248  fShapeButton[15]->SetToolTipText("Create a toroidal tube with a phi range");
249  fShapeButton[16] = new TGPictureButton(f1, fClient->GetPicture("geopcon_t.xpm"), kCREATE_PCON);
250  fShapeButton[16]->SetToolTipText("Create a polycone shape");
251  fShapeButton[17] = new TGPictureButton(f1, fClient->GetPicture("geopgon_t.xpm"), kCREATE_PGON);
252  fShapeButton[17]->SetToolTipText("Create a polygon shape");
253  for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+12],lhb);
254  container->AddFrame(f1, lhf1);
255  f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
256  fShapeButton[18] = new TGPictureButton(f1, fClient->GetPicture("geohype_t.xpm"), kCREATE_HYPE);
257  fShapeButton[18]->SetToolTipText("Create a hyperboloid");
258  fShapeButton[19] = new TGPictureButton(f1, fClient->GetPicture("geoparab_t.xpm"), kCREATE_PARAB);
259  fShapeButton[19]->SetToolTipText("Create a paraboloid");
260  fShapeButton[20] = new TGPictureButton(f1, fClient->GetPicture("geocomposite_t.xpm"), kCREATE_COMP);
261  fShapeButton[20]->SetToolTipText("Create a composite shape");
262  for (ipict=0; ipict<3; ipict++) f1->AddFrame(fShapeButton[ipict+18],lhb);
263  container->AddFrame(f1, lhf1);
264 
265  // List of shapes
266  f2 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
267  f1 = new TGCompositeFrame(f2, 155, 10, kHorizontalFrame | kFixedWidth);
268  f1->AddFrame(label = new TGLabel(f1, "Existing shapes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
269  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
270  gClient->GetColorByName("#ff0000", color);
271  label->SetTextColor(color);
272  f2->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
273  f1 = new TGCompositeFrame(f2, 155, 30, kHorizontalFrame | kFixedWidth);
274  fSelectedShape = 0;
275  fLSelShape = new TGLabel(f1, "Select shape");
276  gClient->GetColorByName("#0000ff", color);
277  fLSelShape->SetTextColor(color);
281  fBSelShape->SetToolTipText("Select one of the existing shapes");
282  fBSelShape->Associate(this);
283  f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
284  fEditShape = new TGTextButton(f1, "Edit");
285  f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
286  fEditShape->SetToolTipText("Edit selected shape");
287  fEditShape->Associate(this);
288  f2->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
289  container->AddFrame(f2, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
290 
291  // Volumes category
292  si = new TGShutterItem(fCategories, new TGHotString("Volumes"),kCAT_VOLUMES);
293  container = (TGCompositeFrame*)si->GetContainer();
295  fCategories->AddItem(si);
296 
297  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
298  f1->AddFrame(label = new TGLabel(f1, "Create new volume"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
299  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
300  gClient->GetColorByName("#ff0000", color);
301  label->SetTextColor(color);
302  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
303 
304  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
305  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
306  fVolumeName = new TGTextEntry(f1, new TGTextBuffer(50), kVOLUME_NAME);
308  fVolumeName->SetToolTipText("Enter the name for the new volume");
309  f1->AddFrame(fVolumeName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
310  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
311 
312  // ComboBox for shape component
313  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
314  fSelectedShape2 = 0;
315  fLSelShape2 = new TGLabel(f1, "Select shape");
316  gClient->GetColorByName("#0000ff", color);
317  fLSelShape2->SetTextColor(color);
321  fBSelShape2->SetToolTipText("Select one of the existing shapes");
322  fBSelShape2->Associate(this);
323  f1->AddFrame(fBSelShape2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
324  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
325 
326  // ComboBox for medium component
327  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
328  fSelectedMedium2 = 0;
329  fLSelMedium2 = new TGLabel(f1, "Select medium");
330  gClient->GetColorByName("#0000ff", color);
331  fLSelMedium2->SetTextColor(color);
335  fBSelMedium2->SetToolTipText("Select one of the existing media");
336  fBSelMedium2->Associate(this);
337  f1->AddFrame(fBSelMedium2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
338  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
339  // Picture buttons for different volumes
340  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
341  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
342  fVolumeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geovolume_t.xpm"), kCREATE_VOLUME);
343  fVolumeButton[0]->SetToolTipText("Create a new volume from shape and medium");
344  fVolumeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geoassembly_t.xpm"), kCREATE_ASSEMBLY);
345  fVolumeButton[1]->SetToolTipText("Create a new volume assemby having the selected name");
346  for (ipict=0; ipict<2; ipict++) f1->AddFrame(fVolumeButton[ipict],lhb);
347  container->AddFrame(f1, lhf1);
348  // List of volumes
349  f3 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
350  f1 = new TGCompositeFrame(f3, 155, 10, kHorizontalFrame | kFixedWidth);
351  f1->AddFrame(label = new TGLabel(f1, "Existing volumes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
352  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
353  gClient->GetColorByName("#ff0000", color);
354  label->SetTextColor(color);
355  f3->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
356  f1 = new TGCompositeFrame(f3, 155, 30, kHorizontalFrame | kFixedWidth);
357  fSelectedVolume = 0;
358  fLSelVolume = new TGLabel(f1, "Select volume");
359  gClient->GetColorByName("#0000ff", color);
360  fLSelVolume->SetTextColor(color);
364  fBSelVolume->SetToolTipText("Select one of the existing volumes");
365  fBSelVolume->Associate(this);
366  f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
367  f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
368  f1 = new TGCompositeFrame(f3, 155, 30, kHorizontalFrame | kFixedWidth);
369  fEditVolume = new TGTextButton(f1, " Edit ");
370  f1->AddFrame(fEditVolume, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 2));
371  fEditVolume->SetToolTipText("Edit selected volume");
372  fEditVolume->Associate(this);
373  fSetTopVolume = new TGTextButton(f1, "Set top");
374  f1->AddFrame(fSetTopVolume, new TGLayoutHints(kLHintsRight, 1, 20, 2, 2));
375  fSetTopVolume->SetToolTipText("Set top volume for geometry");
376  fSetTopVolume->Associate(this);
377  f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
378  container->AddFrame(f3, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
379 
380  // Materials category
381  si = new TGShutterItem(fCategories, new TGHotString("Materials"),kCAT_MATERIALS);
382  container = (TGCompositeFrame*)si->GetContainer();
384  fCategories->AddItem(si);
385 
386  // Material creators
388  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
389  f1->AddFrame(label = new TGLabel(f1, "Create material/mixt."), new TGLayoutHints(kLHintsLeft, 2, 1, 0, 0));
390  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
391  gClient->GetColorByName("#ff0000", color);
392  label->SetTextColor(color);
393  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
394  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
395  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
398  fMaterialName->SetToolTipText("Enter the new material name");
399  f1->AddFrame(fMaterialName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
400  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
401 
402  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
403  f1->AddFrame(new TGLabel(f1, "Element"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
407  if (table) {
408  TGeoElement *element;
409  for (Int_t i=0; i<table->GetNelements(); i++) {
410  element = table->GetElement(i);
411  fElementList->AddEntry(element->GetTitle(),i);
412  }
413  }
414  fElementList->Select(0);
415  f1->AddFrame(fElementList, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
416  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
417  // Number entry for density
418  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
419  f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
425  nef->SetToolTipText("Enter material/mixture density");
427  fEntryDensity->Associate(this);
428  f1->AddFrame(fEntryDensity, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
429  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
430  // Buttons for creating materials/mixtures
431  // Picture buttons for different volumes
432  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
433  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
434  fMaterialButton[0] = new TGPictureButton(f1, fClient->GetPicture("geomaterial_t.xpm"), kCREATE_MATERIAL);
435  fMaterialButton[0]->SetToolTipText("Create a new material from element and density");
436  fMaterialButton[1] = new TGPictureButton(f1, fClient->GetPicture("geomixture_t.xpm"), kCREATE_MIXTURE);
437  fMaterialButton[1]->SetToolTipText("Create a new mixture with selected density");
438  for (ipict=0; ipict<2; ipict++) f1->AddFrame(fMaterialButton[ipict],lhb);
439  container->AddFrame(f1, lhf1);
440 
441  // List of materials
442  f4 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
443  f1 = new TGCompositeFrame(f4, 155, 10, kHorizontalFrame | kFixedWidth);
444  f1->AddFrame(label = new TGLabel(f1, "Existing materials"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
445  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
446  gClient->GetColorByName("#ff0000", color);
447  label->SetTextColor(color);
448  f4->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
449  f1 = new TGCompositeFrame(f4, 155, 30, kHorizontalFrame | kFixedWidth);
450  fSelectedMaterial = 0;
451  fLSelMaterial = new TGLabel(f1, "Select material");
452  gClient->GetColorByName("#0000ff", color);
453  fLSelMaterial->SetTextColor(color);
457  fBSelMaterial->SetToolTipText("Select one of the existing materials");
458  fBSelMaterial->Associate(this);
459  f1->AddFrame(fBSelMaterial, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
460  fEditMaterial = new TGTextButton(f1, "Edit");
461  f1->AddFrame(fEditMaterial, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
462  fEditMaterial->SetToolTipText("Edit selected material");
463  fEditMaterial->Associate(this);
464  f4->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
465  container->AddFrame(f4, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
466 
467  si = new TGShutterItem(fCategories, new TGHotString("Media"),kCAT_MEDIA);
468  container = (TGCompositeFrame*)si->GetContainer();
470  fCategories->AddItem(si);
471 
472  // Media category
473  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
474  f1->AddFrame(label = new TGLabel(f1, "Create new medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
475  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
476  gClient->GetColorByName("#ff0000", color);
477  label->SetTextColor(color);
478  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
479 
480  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
481  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
482  fMediumName = new TGTextEntry(f1, new TGTextBuffer(50), kMEDIUM_NAME);
484  fMediumName->SetToolTipText("Enter the new medium name");
485  f1->AddFrame(fMediumName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
486 
487  fMediumId = new TGNumberEntry(f1, 0., 5, kMEDIUM_ID);
492  nef->SetToolTipText("Enter medium ID");
494  fMediumId->Associate(this);
495  f1->AddFrame(fMediumId, new TGLayoutHints(kLHintsRight, 2, 2, 2 ,2));
496  f1->AddFrame(new TGLabel(f1, "ID"), new TGLayoutHints(kLHintsRight, 1, 1, 6, 0));
497  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
498  // ComboBox for materials
499  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
500  fSelectedMaterial2 = 0;
501  fLSelMaterial2 = new TGLabel(f1, "Select material");
502  gClient->GetColorByName("#0000ff", color);
507  fBSelMaterial2->SetToolTipText("Select one of the existing materials");
508  fBSelMaterial2->Associate(this);
509  f1->AddFrame(fBSelMaterial2, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
510  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
511  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
512  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
513  fMediumButton = new TGPictureButton(f1, fClient->GetPicture("geomedium_t.xpm"), kCREATE_MEDIUM);
514  fMediumButton->SetToolTipText("Create a new medium from selected material");
515  fMediumButton->Associate(this);
516  f1->AddFrame(fMediumButton, new TGLayoutHints(kLHintsLeft, 5, 2, 2, 2));
517  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
518 
519  // List of media
520  f5 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
522  f1->AddFrame(label = new TGLabel(f1, "Existing media"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
523  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
524  gClient->GetColorByName("#ff0000", color);
525  label->SetTextColor(color);
526  f5->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
527  f1 = new TGCompositeFrame(f5, 155, 30, kHorizontalFrame | kFixedWidth);
528  fSelectedMedium = 0;
529  fLSelMedium = new TGLabel(f1, "Select medium");
530  gClient->GetColorByName("#0000ff", color);
531  fLSelMedium->SetTextColor(color);
535  fBSelMedium->SetToolTipText("Select one of the existing media");
536  fBSelMedium->Associate(this);
537  f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
538  fEditMedium = new TGTextButton(f1, "Edit");
539  f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
540  fEditMedium->SetToolTipText("Edit selected medium");
541  fEditMedium->Associate(this);
542  f5->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
543  container->AddFrame(f5, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
544 
545  // Matrix category
546  si = new TGShutterItem(fCategories, new TGHotString("Matrices"),kCAT_MATRICES);
547  container = (TGCompositeFrame*)si->GetContainer();
549  fCategories->AddItem(si);
550  // Name entry
551  f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
552  f1->AddFrame(label = new TGLabel(f1, "Create new matrix"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
553  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
554  gClient->GetColorByName("#ff0000", color);
555  label->SetTextColor(color);
556  container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
557 
558  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
559  f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
560  fMatrixName = new TGTextEntry(f1, new TGTextBuffer(50), kMATRIX_NAME);
562  fMatrixName->SetToolTipText("Enter the new matrix name");
563  f1->AddFrame(fMatrixName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
564  container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
565  // Picture buttons for different matrices
566  f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
567  f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
568  fMatrixButton[0] = new TGPictureButton(f1, fClient->GetPicture("geotranslation_t.xpm"), kCREATE_TRANSLATION);
569  fMatrixButton[0]->SetToolTipText("Create a translation");
570  fMatrixButton[1] = new TGPictureButton(f1, fClient->GetPicture("georotation_t.xpm"), kCREATE_ROTATION);
571  fMatrixButton[1]->SetToolTipText("Create a rotation");
572  fMatrixButton[2] = new TGPictureButton(f1, fClient->GetPicture("geocombi_t.xpm"), kCREATE_COMBI);
573  fMatrixButton[2]->SetToolTipText("Create a rotation + translation");
574  for (ipict=0; ipict<3; ipict++) f1->AddFrame(fMatrixButton[ipict],lhb);
575  container->AddFrame(f1, lhf1);
576  // List of matrices
577  f6 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
578  f1 = new TGCompositeFrame(f6, 155, 10, kHorizontalFrame | kFixedWidth);
579  f1->AddFrame(label = new TGLabel(f1, "Existing matrices"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
580  f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
581  gClient->GetColorByName("#ff0000", color);
582  label->SetTextColor(color);
583  f6->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
584  f1 = new TGCompositeFrame(f6, 155, 30, kHorizontalFrame | kFixedWidth);
585  fSelectedMatrix = 0;
586  fLSelMatrix = new TGLabel(f1, "Select matrix");
587  gClient->GetColorByName("#0000ff", color);
588  fLSelMatrix->SetTextColor(color);
592  fBSelMatrix->SetToolTipText("Select one of the existing matrices");
593  fBSelMatrix->Associate(this);
594  f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
595  fEditMatrix = new TGTextButton(f1, "Edit");
596  f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
597  fEditMatrix->SetToolTipText("Edit selected matrix");
598  fEditMatrix->Associate(this);
599  f6->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
600  container->AddFrame(f6, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
601 
602  fCategories->Resize(163,370);
603  AddFrame(fCategories, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
604 
606 
607  // Set the fTab and dissconnect editor from the canvas.
608  fTab = fGedEditor->GetTab();
609  TCanvas* edCanvas = fGedEditor->GetCanvas();
611  if (edCanvas != fConnectedCanvas) {
613  if (edCanvas)
614  ConnectSelected(edCanvas);
615  fConnectedCanvas = edCanvas;
616  }
617 }
618 
619 ////////////////////////////////////////////////////////////////////////////////
620 /// Destructor.
621 
623 {
624  TGCompositeFrame *cont;
625  cont = (TGCompositeFrame*)fCategories->GetItem("General")->GetContainer();
627  fCategories->GetItem("General")->SetCleanup(0);
628  cont = (TGCompositeFrame*)fCategories->GetItem("Shapes")->GetContainer();
630  fCategories->GetItem("Shapes")->SetCleanup(0);
631  cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
633  fCategories->GetItem("Volumes")->SetCleanup(0);
634  cont = (TGCompositeFrame*)fCategories->GetItem("Materials")->GetContainer();
636  fCategories->GetItem("Materials")->SetCleanup(0);
637  cont = (TGCompositeFrame*)fCategories->GetItem("Media")->GetContainer();
639  fCategories->GetItem("Media")->SetCleanup(0);
640  cont = (TGCompositeFrame*)fCategories->GetItem("Matrices")->GetContainer();
642  fCategories->GetItem("Matrices")->SetCleanup(0);
643 
644  delete fExportOption[0]; delete fExportOption[1];
645 
646  Cleanup();
647 
648  if (fTabMgr) {
650  delete fTabMgr;
651  }
652 }
653 
654 ////////////////////////////////////////////////////////////////////////////////
655 /// Connected to TCanvas::Selected. TGeoManagerEditor takes this
656 /// function from TGedEditor and only uses it if obj is a TGeoVolume.
657 
659 {
660  if (event == kButton1 && obj->InheritsFrom(TGeoVolume::Class())) {
661  TGeoVolume* v = (TGeoVolume*) obj;
663  fTabMgr->SetTab();
665  v->Draw();
666  }
667 }
668 
670 {
671  // Connect to TCanvas::Selected.
672 
673  c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGeoManagerEditor",
674  this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
675 }
676 
678 {
679  // Disconnect from TCanvas::Selected.
680 
681  if (fConnectedCanvas)
682  Disconnect(fConnectedCanvas, "Selected(TVirtualPad*,TObject*,Int_t)",
683  this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
684 
685 }
686 
687 ////////////////////////////////////////////////////////////////////////////////
688 /// Connect signals to slots.
689 
691 {
692  fManagerName->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
693  fManagerTitle->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
694  fExportButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoExportGeometry()");
695  fCloseGeometry->Connect("Clicked()", "TGeoManagerEditor", this, "DoCloseGeometry()");
696  fShapeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateBox()");
697  fShapeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePara()");
698  fShapeButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd1()");
699  fShapeButton[3]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd2()");
700  fShapeButton[4]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrap()");
701  fShapeButton[5]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateGtra()");
702  fShapeButton[6]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateXtru()");
703  fShapeButton[7]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateArb8()");
704  fShapeButton[8]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTube()");
705  fShapeButton[9]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTubs()");
706  fShapeButton[10]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCone()");
707  fShapeButton[11]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCons()");
708  fShapeButton[12]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateSphe()");
709  fShapeButton[13]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCtub()");
710  fShapeButton[14]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateEltu()");
711  fShapeButton[15]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTorus()");
712  fShapeButton[16]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePcon()");
713  fShapeButton[17]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePgon()");
714  fShapeButton[18]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateHype()");
715  fShapeButton[19]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateParab()");
716  fShapeButton[20]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateComposite()");
717  fMatrixButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTranslation()");
718  fMatrixButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateRotation()");
719  fMatrixButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCombi()");
720  fVolumeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateVolume()");
721  fVolumeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateAssembly()");
722  fBSelTop->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectTopVolume()");
723  fBSelVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectVolume()");
724  fBSelShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape()");
725  fBSelShape2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape2()");
726  fBSelMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMatrix()");
727  fBSelMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial()");
728  fBSelMaterial2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial2()");
729  fBSelMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium()");
730  fBSelMedium2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium2()");
731  fSetTopVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSetTopVolume()");
732  fEditShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditShape()");
733  fEditMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMedium()");
734  fEditMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMaterial()");
735  fEditMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMatrix()");
736  fEditVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditVolume()");
737 
738  fMaterialButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMaterial()");
739  fMaterialButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMixture()");
740  fMediumButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMedium()");
741 }
742 
743 ////////////////////////////////////////////////////////////////////////////////
744 /// Refresh editor according the selected obj.
745 
747 {
748  fGeometry = (TGeoManager*)obj;
755  // Check if master volume can be set
758  // Check if geometry is already closed
760  else {
763  }
764  // Check if volumes category can be activated
766  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kFALSE);
767  else
768  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
770  else ShowSelectShape();
772  else ShowSelectVolume();
774  else ShowSelectMedium();
776  else ShowSelectMatrix();
777 
778  // Check if media category can be activated
779  if (!fGeometry->GetListOfMaterials()->GetSize()) {
782  } else {
785  }
786 
787  fTab->SetTab(0);
788  fCategories->Layout();
789  if (fTabMgr == 0) {
792  }
794  // SetActive();
795 }
796 
797 ////////////////////////////////////////////////////////////////////////////////
798 /// Change name/title of the geometry
799 
801 {
804 }
805 
806 ////////////////////////////////////////////////////////////////////////////////
807 /// Export geometry as .root or .C file
808 
810 {
811  Bool_t asroot = fExportOption[0]->IsDown();
812  TString s = fGeometry->GetName();
813  s = s.Strip();
814  s.Remove(20);
815  const char *name;
816  if (asroot) name = TString::Format("%s.root", s.Data());
817  else name = TString::Format("%s.C", s.Data());
818  fGeometry->Export(name);
819 }
820 
821 ////////////////////////////////////////////////////////////////////////////////
822 /// Create a box.
823 
825 {
827  fSelectedShape = new TGeoBBox(TString::Format("box_%i",id), 1., 1., 1.);
828  ShowSelectShape();
829  // Check if volumes category can be activated
830  if (fGeometry->GetListOfMedia()->GetSize())
831  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
832  DoEditShape();
833 }
834 
835 ////////////////////////////////////////////////////////////////////////////////
836 /// Create a parallelipiped.
837 
839 {
841  fSelectedShape = new TGeoPara(TString::Format("para_%i",id), 1., 1., 1., 30., 20., 45.);
842  ShowSelectShape();
843  if (fGeometry->GetListOfMedia()->GetSize())
844  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
845  DoEditShape();
846 }
847 
848 ////////////////////////////////////////////////////////////////////////////////
849 /// Create a Trd1.
850 
852 {
854  fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i",id), 0.5, 1., 1., 1.);
855  ShowSelectShape();
856  if (fGeometry->GetListOfMedia()->GetSize())
857  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
858  DoEditShape();
859 }
860 
861 ////////////////////////////////////////////////////////////////////////////////
862 /// Create a Trd2.
863 
865 {
867  fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i",id), 0.5, 1., 0.5, 1., 1.);
868  ShowSelectShape();
869  if (fGeometry->GetListOfMedia()->GetSize())
870  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
871  DoEditShape();
872 }
873 
874 ////////////////////////////////////////////////////////////////////////////////
875 /// Create a general trapezoid.
876 
878 {
880  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.);
881  ShowSelectShape();
882  if (fGeometry->GetListOfMedia()->GetSize())
883  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
884  DoEditShape();
885 }
886 
887 ////////////////////////////////////////////////////////////////////////////////
888 /// Create a twisted trapezoid.
889 
891 {
893  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.);
894  ShowSelectShape();
895  if (fGeometry->GetListOfMedia()->GetSize())
896  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
897  DoEditShape();
898 }
899 
900 ////////////////////////////////////////////////////////////////////////////////
901 /// Create an extruded polygone.
902 
904 {
905 }
906 
907 ////////////////////////////////////////////////////////////////////////////////
908 /// Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel
909 /// planes
910 
912 {
913 }
914 
915 ////////////////////////////////////////////////////////////////////////////////
916 /// Create a tube.
917 
919 {
921  fSelectedShape = new TGeoTube(TString::Format("tube_%i",id), 0.5, 1., 1.);
922  ShowSelectShape();
923  if (fGeometry->GetListOfMedia()->GetSize())
924  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
925  DoEditShape();
926 }
927 
928 ////////////////////////////////////////////////////////////////////////////////
929 /// Create a tube segment.
930 
932 {
934  fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i",id), 0.5, 1., 1.,0.,45.);
935  ShowSelectShape();
936  if (fGeometry->GetListOfMedia()->GetSize())
937  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
938  DoEditShape();
939 }
940 
941 ////////////////////////////////////////////////////////////////////////////////
942 /// Create a cone.
943 
945 {
947  fSelectedShape = new TGeoCone(TString::Format("cone_%i",id), 0.5, 0.5, 1., 1.5, 2.);
948  ShowSelectShape();
949  if (fGeometry->GetListOfMedia()->GetSize())
950  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
951  DoEditShape();
952 }
953 
954 ////////////////////////////////////////////////////////////////////////////////
955 /// Create a cone segment.
956 
958 {
960  fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i",id), 0.5, 0.5, 1., 1.5, 2.,0.,45.);
961  ShowSelectShape();
962  if (fGeometry->GetListOfMedia()->GetSize())
963  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
964  DoEditShape();
965 }
966 
967 ////////////////////////////////////////////////////////////////////////////////
968 /// Create a sphere.
969 
971 {
973  fSelectedShape = new TGeoSphere(TString::Format("sphere_%i",id), 0.5, 1., 0., 180., 0.,360.);
974  ShowSelectShape();
975  if (fGeometry->GetListOfMedia()->GetSize())
976  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
977  DoEditShape();
978 }
979 
980 ////////////////////////////////////////////////////////////////////////////////
981 /// Create a cut tube.
982 
984 {
986  fSelectedShape = new TGeoCtub(TString::Format("ctub_%i",id), 0.5, 1., 1.,0.,45.,0.,0.,-1,0.,0.,1);
987  ShowSelectShape();
988  if (fGeometry->GetListOfMedia()->GetSize())
989  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
990  DoEditShape();
991 }
992 
993 ////////////////////////////////////////////////////////////////////////////////
994 /// Create an eliptical tube.
995 
997 {
999  fSelectedShape = new TGeoEltu(TString::Format("para_%i",id), 1., 2., 1.5 );
1000  ShowSelectShape();
1001  if (fGeometry->GetListOfMedia()->GetSize())
1002  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1003  DoEditShape();
1004 }
1005 
1006 ////////////////////////////////////////////////////////////////////////////////
1007 /// Create a torus shape.
1008 
1010 {
1012  fSelectedShape = new TGeoTorus(TString::Format("torus_%i",id), 10., 1., 1.5, 0, 360.);
1013  ShowSelectShape();
1014  if (fGeometry->GetListOfMedia()->GetSize())
1015  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1016  DoEditShape();
1017 
1018 }
1019 
1020 ////////////////////////////////////////////////////////////////////////////////
1021 /// Create a polycone shape.
1022 
1024 {
1026  fSelectedShape = new TGeoPcon(TString::Format("pcon_%i",id), 0., 360., 2);
1027  ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1028  ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1029  ShowSelectShape();
1030  if (fGeometry->GetListOfMedia()->GetSize())
1031  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1032  DoEditShape();
1033 }
1034 
1035 ////////////////////////////////////////////////////////////////////////////////
1036 /// Create a polygone shape.
1037 
1039 {
1041  fSelectedShape = new TGeoPgon(TString::Format("pgon_%i",id), 0., 360.,6,2);
1042  ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1043  ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1044  ShowSelectShape();
1045  if (fGeometry->GetListOfMedia()->GetSize())
1046  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1047  DoEditShape();
1048 }
1049 
1050 ////////////////////////////////////////////////////////////////////////////////
1051 /// Create a hyperboloid.
1052 
1054 {
1056  fSelectedShape = new TGeoHype(TString::Format("hype_%i",id), 1., 15., 2., 30., 5.);
1057  ShowSelectShape();
1058  if (fGeometry->GetListOfMedia()->GetSize())
1059  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1060  DoEditShape();
1061 }
1062 
1063 ////////////////////////////////////////////////////////////////////////////////
1064 /// Create a paraboloid.
1065 
1067 {
1068 }
1069 
1070 ////////////////////////////////////////////////////////////////////////////////
1071 /// Create a composite shape.
1072 
1074 {
1075 }
1076 
1077 ////////////////////////////////////////////////////////////////////////////////
1078 /// Create a new material.
1079 
1081 {
1083  if (!el) {
1084  Error("DoCreateMaterial", "Cannot find selected element in list");
1085  return;
1086  }
1087  Double_t density = fEntryDensity->GetNumber();
1088  const char *name = fMaterialName->GetText();
1089  fSelectedMaterial = new TGeoMaterial(name, el, density);
1091  fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1092  DoEditMaterial();
1094 }
1095 
1096 ////////////////////////////////////////////////////////////////////////////////
1097 /// Create a new mixture.
1098 
1100 {
1101  Double_t density = fEntryDensity->GetNumber();
1102  const char *name = fMaterialName->GetText();
1103  fSelectedMaterial = new TGeoMixture(name, 1, density);
1105  fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1106  DoEditMaterial();
1108 }
1109 
1110 ////////////////////////////////////////////////////////////////////////////////
1111 /// Create a new medium.
1112 
1114 {
1115  Int_t id = fMediumId->GetIntNumber();
1116  if (!fSelectedMaterial2) return;
1117  const char *name = fMediumName->GetText();
1119  ShowSelectMedium();
1121  fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1122  DoEditMedium();
1124 }
1125 
1126 ////////////////////////////////////////////////////////////////////////////////
1127 /// Create a new translation.
1128 
1130 {
1131  const char *name = fMatrixName->GetText();
1132  fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1135  ShowSelectMatrix();
1136  DoEditMatrix();
1138 }
1139 
1140 ////////////////////////////////////////////////////////////////////////////////
1141 /// Create a new rotation.
1142 
1144 {
1145  const char *name = fMatrixName->GetText();
1146  fSelectedMatrix = new TGeoRotation(name);
1149  ShowSelectMatrix();
1150  DoEditMatrix();
1152 }
1153 
1154 ////////////////////////////////////////////////////////////////////////////////
1155 /// Create a new volume.
1156 
1158 {
1159  const char *name = fVolumeName->GetText();
1160  if (!fSelectedShape2 || !fSelectedMedium2) return;
1162  fLSelVolume->SetText(name);
1163  ShowSelectVolume();
1164  DoEditVolume();
1166 }
1167 
1168 ////////////////////////////////////////////////////////////////////////////////
1169 /// Create a new volume assembly.
1170 
1172 {
1173  const char *name = fVolumeName->GetText();
1174  fSelectedVolume = new TGeoVolumeAssembly(name);
1175  fLSelVolume->SetText(name);
1176  ShowSelectVolume();
1177  DoEditVolume();
1179 }
1180 
1181 ////////////////////////////////////////////////////////////////////////////////
1182 /// Create a new translation + rotation.
1183 
1185 {
1186  const char *name = fMatrixName->GetText();
1187  fSelectedMatrix = new TGeoCombiTrans(name, 0., 0., 0., new TGeoRotation());
1191  ShowSelectMatrix();
1192  DoEditMatrix();
1194 }
1195 
1196 ////////////////////////////////////////////////////////////////////////////////
1197 /// Set top volume for the geometry.
1198 
1200 {
1201  if (!fSelectedVolume) return;
1204 }
1205 
1206 ////////////////////////////////////////////////////////////////////////////////
1207 /// Slot for editing selected shape.
1208 
1210 {
1211  if (!fSelectedShape) return;
1213  fSelectedShape->Draw();
1214  fTabMgr->GetPad()->GetView()->ShowAxis();
1215 }
1216 
1217 ////////////////////////////////////////////////////////////////////////////////
1218 /// Slot for editing selected volume.
1219 
1221 {
1222  if (!fSelectedVolume) {
1224  return;
1225  }
1227  fTabMgr->SetTab();
1229  fSelectedVolume->Draw();
1230 }
1231 
1232 ////////////////////////////////////////////////////////////////////////////////
1233 /// Slot for editing selected medium.
1234 
1236 {
1237  if (!fSelectedMedium) return;
1239 }
1240 
1241 ////////////////////////////////////////////////////////////////////////////////
1242 /// Slot for editing selected material.
1243 
1245 {
1246  if (!fSelectedMaterial) return;
1248 }
1249 
1250 ////////////////////////////////////////////////////////////////////////////////
1251 /// Slot for editing selected matrix.
1252 
1254 {
1255  if (!fSelectedMatrix) return;
1257 }
1258 
1259 ////////////////////////////////////////////////////////////////////////////////
1260 /// Slot for selecting an existing matrix.
1261 
1263 {
1264  TGeoMatrix *matrix = fSelectedMatrix;
1265  new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200,300);
1267  if (fSelectedMatrix) fLSelMatrix->SetText(fSelectedMatrix->GetName());
1268  else fSelectedMatrix = matrix;
1269 }
1270 
1271 ////////////////////////////////////////////////////////////////////////////////
1272 /// Slot for selecting an existing shape.
1273 
1275 {
1276  TGeoShape *shape = fSelectedShape;
1277  new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200,300);
1279  if (fSelectedShape) fLSelShape->SetText(fSelectedShape->GetName());
1280  else fSelectedShape = shape;
1281 }
1282 
1283 ////////////////////////////////////////////////////////////////////////////////
1284 /// Slot for selecting a shape for making a volume.
1285 
1287 {
1288  TGeoShape *shape = fSelectedShape2;
1289  new TGeoShapeDialog(fBSelShape2, gClient->GetRoot(), 200,300);
1291  if (fSelectedShape2) fLSelShape2->SetText(fSelectedShape2->GetName());
1292  else fSelectedShape2 = shape;
1293 }
1294 
1295 ////////////////////////////////////////////////////////////////////////////////
1296 /// Slot for selecting an existing material.
1297 
1299 {
1301  new TGeoMaterialDialog(fBSelMaterial, gClient->GetRoot(), 200,300);
1303  if (fSelectedMaterial) fLSelMaterial->SetText(fSelectedMaterial->GetName());
1304  else fSelectedMaterial = mat;
1305 }
1306 
1307 ////////////////////////////////////////////////////////////////////////////////
1308 /// Slot for selecting an existing material and making a medium.
1309 
1311 {
1313  new TGeoMaterialDialog(fBSelMaterial2, gClient->GetRoot(), 200,300);
1315  if (fSelectedMaterial2) fLSelMaterial2->SetText(fSelectedMaterial2->GetName());
1316  else fSelectedMaterial2 = mat;
1317 }
1318 
1319 ////////////////////////////////////////////////////////////////////////////////
1320 /// Slot for selecting an existing medium.
1321 
1323 {
1324  TGeoMedium *med = fSelectedMedium;
1325  new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200,300);
1327  if (fSelectedMedium) fLSelMedium->SetText(fSelectedMedium->GetName());
1328  else fSelectedMedium = med;
1329 }
1330 
1331 ////////////////////////////////////////////////////////////////////////////////
1332 /// Slot for selecting an existing medium for making a volume.
1333 
1335 {
1337  new TGeoMediumDialog(fBSelMedium2, gClient->GetRoot(), 200,300);
1339  if (fSelectedMedium2) fLSelMedium2->SetText(fSelectedMedium2->GetName());
1340  else fSelectedMedium2 = med;
1341 }
1342 
1343 ////////////////////////////////////////////////////////////////////////////////
1344 /// Slot for selecting an existing volume.
1345 
1347 {
1348  TGeoVolume *vol = fSelectedVolume;
1349  new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200,300);
1351  if (fSelectedVolume) fLSelVolume->SetText(fSelectedVolume->GetName());
1352  else fSelectedVolume = vol;
1353 }
1354 
1355 ////////////////////////////////////////////////////////////////////////////////
1356 /// Slot for seting top geometry volume.
1357 
1359 {
1360  TGeoVolume *vol = fGeometry->GetTopVolume();
1361  new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200,300);
1363  if (fSelectedVolume) fLSelTop->SetText(fSelectedVolume->GetName());
1364  else fSelectedVolume = vol;
1365  if (fSelectedVolume && (fSelectedVolume != vol)) fGeometry->SetTopVolume(fSelectedVolume);
1366 }
1367 
1368 ////////////////////////////////////////////////////////////////////////////////
1369 /// Slot for closing the geometry.
1370 
1372 {
1375 }
1376 
1377 ////////////////////////////////////////////////////////////////////////////////
1378 /// Show/hide interface for shape selection.
1379 
1381 {
1383  if (show) cont->ShowFrame(f2);
1384  else cont->HideFrame(f2);
1385 }
1386 
1387 ////////////////////////////////////////////////////////////////////////////////
1388 /// Show/hide interface for volume selection.
1389 
1391 {
1393  if (show) cont->ShowFrame(f7);
1394  else cont->HideFrame(f7);
1395  cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
1396  if (show) cont->ShowFrame(f3);
1397  else cont->HideFrame(f3);
1398 }
1399 
1400 ////////////////////////////////////////////////////////////////////////////////
1401 /// Show/hide interface for material selection.
1402 
1404 {
1406  if (show) cont->ShowFrame(f4);
1407  else cont->HideFrame(f4);
1408 }
1409 
1410 ////////////////////////////////////////////////////////////////////////////////
1411 /// Show/hide interface for medium selection.
1412 
1414 {
1416  if (show) cont->ShowFrame(f5);
1417  else cont->HideFrame(f5);
1418 }
1419 
1420 ////////////////////////////////////////////////////////////////////////////////
1421 /// Show/hide interface for matrix selection.
1422 
1424 {
1426  if (show) cont->ShowFrame(f6);
1427  else cont->HideFrame(f6);
1428 }
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
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:37
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:357
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:38
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:131
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:129
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 eliptical tube.
TGTab * GetTab() const
Definition: TGedEditor.h:84
Basic string class.
Definition: TString.h:129
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:495
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:687
TList * GetListOfMaterials() const
Definition: TGeoManager.h:460
void DoSelectVolume()
Slot for selecting an existing volume.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hirarchically all daughters of a composite frame.
TList * GetListOfMedia() const
Definition: TGeoManager.h:461
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:2345
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 seting 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
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:283
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:436
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:464
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:873
void DoCreateTrap()
Create a general trapezoid.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:575
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:405
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:459
Class describing rotations.
Definition: TGeoMatrix.h:178
TVirtualPad * GetPad() const
const Bool_t kFALSE
Definition: RtypesCore.h:92
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:621
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:336
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:553
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
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:462
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:494
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:398
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:496
Bool_t IsClosed() const
Definition: TGeoManager.h:279
void DoCreateCtub()
Create a cut tube.
TGTextEntry * fMediumName
virtual Int_t GetSize() const
Definition: TCollection.h:89
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:723
virtual Bool_t IsDown() const
Definition: TGButton.h:371
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:155
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:91
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.
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:347
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:88
A phi segment of a tube.
Definition: TGeoTube.h:88