Logo ROOT   6.16/01
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
15Editor for TGeoManager class. Provides also builder functionality for the
16main TGeo objects: TGeoVolume, TGeoShape - derived classes, TGeoMaterial,
17TGeoMatrix - derived transformations and TGeoMedium.
18The GUI represents the main entry point for editing geometry classes. It
19can 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
28The TGeoManager editor is vertically split by a TGShutter widget into the
29following 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
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;
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);
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);
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));
176 fLSelTop = new TGLabel(f1, "Select top");
177 gClient->GetColorByName("#0000ff", color);
178 fLSelTop->SetTextColor(color);
180 f1->AddFrame(fLSelTop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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");
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);
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));
272 fSelectedShape = 0;
273 fLSelShape = new TGLabel(f1, "Select shape");
274 gClient->GetColorByName("#0000ff", color);
275 fLSelShape->SetTextColor(color);
277 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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));
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);
317 f1->AddFrame(fLSelShape2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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);
327 fLSelMedium2 = new TGLabel(f1, "Select medium");
328 gClient->GetColorByName("#0000ff", color);
331 f1->AddFrame(fLSelMedium2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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);
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));
355 fSelectedVolume = 0;
356 fLSelVolume = new TGLabel(f1, "Select volume");
357 gClient->GetColorByName("#0000ff", color);
360 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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));
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");
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 }
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");
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);
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));
449 fLSelMaterial = new TGLabel(f1, "Select material");
450 gClient->GetColorByName("#0000ff", color);
455 fBSelMaterial->SetToolTipText("Select one of the existing materials");
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");
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));
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);
499 fLSelMaterial2 = new TGLabel(f1, "Select material");
500 gClient->GetColorByName("#0000ff", color);
505 fBSelMaterial2->SetToolTipText("Select one of the existing materials");
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));
512 fMediumButton->SetToolTipText("Create a new medium from selected material");
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));
526 fSelectedMedium = 0;
527 fLSelMedium = new TGLabel(f1, "Select medium");
528 gClient->GetColorByName("#0000ff", color);
531 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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));
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);
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));
583 fSelectedMatrix = 0;
584 fLSelMatrix = new TGLabel(f1, "Select matrix");
585 gClient->GetColorByName("#0000ff", color);
588 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
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);
602
604
605 // Set the fTab and disconnect editor from the canvas.
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
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
765 else
768 else ShowSelectShape();
770 else ShowSelectVolume();
772 else ShowSelectMedium();
774 else ShowSelectMatrix();
775
776 // Check if media category can be activated
780 } else {
783 }
784
785 fTab->SetTab(0);
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();
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());
817}
818
819////////////////////////////////////////////////////////////////////////////////
820/// Create a box.
821
823{
825 fSelectedShape = new TGeoBBox(TString::Format("box_%i",id), 1., 1., 1.);
827 // Check if volumes category can be activated
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.);
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.);
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.);
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.);
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.);
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.);
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.);
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.);
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.);
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.);
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);
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 );
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.);
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);
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);
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.);
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);
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);
1106}
1107
1108////////////////////////////////////////////////////////////////////////////////
1109/// Create a new medium.
1110
1112{
1114 if (!fSelectedMaterial2) return;
1115 const char *name = fMediumName->GetText();
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.);
1134 DoEditMatrix();
1136}
1137
1138////////////////////////////////////////////////////////////////////////////////
1139/// Create a new rotation.
1140
1142{
1143 const char *name = fMatrixName->GetText();
1148 DoEditMatrix();
1150}
1151
1152////////////////////////////////////////////////////////////////////////////////
1153/// Create a new volume.
1154
1156{
1157 const char *name = fVolumeName->GetText();
1158 if (!fSelectedShape2 || !fSelectedMedium2) return;
1162 DoEditVolume();
1164}
1165
1166////////////////////////////////////////////////////////////////////////////////
1167/// Create a new volume assembly.
1168
1170{
1171 const char *name = fVolumeName->GetText();
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());
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;
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();
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);
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);
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);
1290 else fSelectedShape2 = shape;
1291}
1292
1293////////////////////////////////////////////////////////////////////////////////
1294/// Slot for selecting an existing material.
1295
1297{
1299 new TGeoMaterialDialog(fBSelMaterial, gClient->GetRoot(), 200,300);
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);
1314 else fSelectedMaterial2 = mat;
1315}
1316
1317////////////////////////////////////////////////////////////////////////////////
1318/// Slot for selecting an existing medium.
1319
1321{
1323 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200,300);
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);
1338 else fSelectedMedium2 = med;
1339}
1340
1341////////////////////////////////////////////////////////////////////////////////
1342/// Slot for selecting an existing volume.
1343
1345{
1347 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200,300);
1350 else fSelectedVolume = vol;
1351}
1352
1353////////////////////////////////////////////////////////////////////////////////
1354/// Slot for setting top geometry volume.
1355
1357{
1359 new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200,300);
1362 else fSelectedVolume = vol;
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}
void Class()
Definition: Class.C:29
SVector< double, 2 > v
Definition: Dict.h:5
ULong_t Pixel_t
Definition: GuiTypes.h:39
@ kButton1
Definition: GuiTypes.h:213
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
@ kSunkenFrame
Definition: TGFrame.h:61
@ kVerticalFrame
Definition: TGFrame.h:59
@ kDoubleBorder
Definition: TGFrame.h:63
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kFixedHeight
Definition: TGFrame.h:67
@ kOwnBackground
Definition: TGFrame.h:69
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
ETGeoVolumeWid
@ kCREATE_HYPE
@ kMANAGER_MATERIAL_SELECT
@ kCAT_VOLUMES
@ kMANAGER_MEDIUM_SELECT
@ kMANAGER_TITLE
@ kMANAGER_VOLUME_SELECT
@ kCREATE_XTRU
@ kCREATE_CONS
@ kCREATE_TRD1
@ kMATRIX_NAME
@ kMANAGER_MATERIAL_SELECT2
@ kCREATE_ROTATION
@ kMANAGER_ELEMENT_SELECT
@ kCREATE_TUBS
@ kEXPORT_ROOT
@ kCREATE_TUBE
@ kCREATE_TRANSLATION
@ kCAT_SHAPES
@ kCREATE_CONE
@ kCREATE_SPHE
@ kMANAGER_SHAPE_SELECT2
@ kMANAGER_CANCEL
@ kCAT_MATERIALS
@ kCREATE_GTRA
@ kCREATE_COMP
@ kMEDIUM_ID
@ kMATERIAL_NAME
@ kMANAGER_APPLY
@ kMANAGER_MATRIX_SELECT
@ kMANAGER_MEDIUM_SELECT2
@ kVOLUME_NAME
@ kCREATE_CTUB
@ kMANAGER_NELEM_SELECT
@ kCREATE_TRAP
@ kCREATE_VOLUME
@ kCREATE_ELTU
@ kCREATE_PGON
@ kCREATE_TORUS
@ kMANAGER_NAME
@ kCREATE_ASSEMBLY
@ kMANAGER_DENSITY_SELECT
@ kCREATE_MEDIUM
@ kCREATE_PCON
@ kMANAGER_MEDIA_SELECT
@ kCREATE_ARB8
@ kMEDIUM_NAME
@ kCREATE_COMBI
@ kEXPORT_GEOMETRY
@ kCREATE_PARAB
@ kMANAGER_EDIT_MEDIUM
@ kEXPORT_C
@ kCAT_MATRICES
@ kMANAGER_TOP_SELECT
@ kCREATE_BOX
@ kMANAGER_EDIT_SHAPE
@ kMANAGER_SHAPE_SELECT
@ kCREATE_MATERIAL
@ kCREATE_PARA
@ kCAT_GENERAL
@ kMANAGER_UNDO
@ kCAT_MEDIA
@ kCREATE_TRD2
@ kCREATE_MIXTURE
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:572
The Canvas class.
Definition: TCanvas.h:31
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
virtual void SetRadioButtonExclusive(Bool_t flag=kTRUE)
If enable is kTRUE, this button group will treat radio buttons as mutually exclusive,...
virtual void Show()
Show group of buttons.
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...
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:395
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:409
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:289
virtual Int_t GetSelected() const
Definition: TGComboBox.h:134
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
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 &)
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 Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:949
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:303
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:294
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGLabel.cxx:359
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
virtual void SetNumber(Double_t val)
UInt_t GetDefaultHeight() const
TGNumberEntryField * GetNumberEntry() const
virtual void Associate(const TGWindow *w)
Make w the window that will receive the generated messages.
virtual Long_t GetIntNumber() const
void SetNumAttr(EAttribute attr=kNEAAnyNumber)
virtual Double_t GetNumber() const
void SetNumStyle(EStyle style)
TGClient * fClient
Definition: TGObject.h:37
virtual Bool_t IsDown() const
Definition: TGButton.h:371
TGButton * GetButton() const
Definition: TGShutter.h:58
TGFrame * GetContainer() const
Definition: TGShutter.h:59
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Definition: TGShutter.cxx:71
TGShutterItem * GetItem(const char *name)
returns a shutter item by name (name is hot string of shutter item)
Definition: TGShutter.cxx:300
virtual void Layout()
Layout shutter items.
Definition: TGShutter.cxx:216
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
const char * GetText() const
Definition: TGTextEntry.h:134
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
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.
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
TGTab * GetTab() const
Definition: TGedEditor.h:84
virtual TCanvas * GetCanvas() const
Definition: TGedEditor.h:88
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Definition: TGedEditor.cxx:322
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
Bool_t fInit
Definition: TGedFrame.h:53
Box class.
Definition: TGeoBBox.h:18
Class describing rotation + translation.
Definition: TGeoMatrix.h:292
A phi segment of a conical tube.
Definition: TGeoCone.h:99
Conical tube class.
Definition: TGeoCone.h:18
A tube segment cut with 2 planes.
Definition: TGeoTube.h:169
Table of elements.
Definition: TGeoElement.h:370
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
Base class for chemical elements.
Definition: TGeoElement.h:37
Elliptical tube class.
Definition: TGeoEltu.h:18
Gtra is a twisted trapezoid.
Definition: TGeoArb8.h:144
Hyperboloid class defined by 5 parameters.
Definition: TGeoHype.h:18
Editor for TGeoManager class.
void DoCreateCons()
Create a cone segment.
void DoCreateArb8()
Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel planes.
void DoCreatePgon()
Create a polygone shape.
void DoSelectMedium()
Slot for selecting an existing medium.
TGeoMaterial * fSelectedMaterial
void DoCreateAssembly()
Create a new volume assembly.
TGNumberEntry * fMediumId
TGPictureButton * fBSelMedium2
void DoCreateHype()
Create a hyperboloid.
void ConnectSelected(TCanvas *c)
void DoSelectMaterial()
Slot for selecting an existing material.
TGeoTabManager * fTabMgr
TGCompositeFrame * fVolumeTab
TGPictureButton * fVolumeButton[2]
void DoSelectShape()
Slot for selecting an existing shape.
void DoEditVolume()
Slot for editing selected volume.
TGCompositeFrame * f5
void DoSelectShape2()
Slot for selecting a shape for making a volume.
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 * fBSelMatrix
TGPictureButton * fMatrixButton[3]
TGPictureButton * fMediumButton
void DoEditMedium()
Slot for editing selected medium.
TGTextButton * fEditMedium
void DoCreatePara()
Create a parallelipiped.
void DoSelectTopVolume()
Slot for setting top geometry volume.
void DoCreateTubs()
Create a tube segment.
TGTextEntry * fMediumName
void DoCreateTrd1()
Create a Trd1.
TGTextButton * fEditVolume
TGeoMedium * fSelectedMedium2
void DoCreateGtra()
Create a twisted trapezoid.
TGTextButton * fEditMaterial
void DoEditMatrix()
Slot for editing selected matrix.
void DoCloseGeometry()
Slot for closing the geometry.
TGPictureButton * fBSelShape2
void DoCreateParab()
Create a paraboloid.
TGCompositeFrame * f2
void DoSelectMedium2()
Slot for selecting an existing medium for making a volume.
void DoCreateBox()
Create a box.
TGComboBox * fElementList
void DoSetTopVolume()
Set top volume for the geometry.
TGTextButton * fEditShape
TGTextEntry * fManagerName
void DoSelectVolume()
Slot for selecting an existing volume.
void DoName()
Change name/title of the geometry.
void DoEditMaterial()
Slot for editing selected material.
virtual void ConnectSignals2Slots()
Connect signals to slots.
TGCompositeFrame * f3
void DoCreateTranslation()
Create a new translation.
void DoCreateMixture()
Create a new mixture.
TGPictureButton * fBSelMaterial
TGeoMaterial * fSelectedMaterial2
TGTextEntry * fVolumeName
TGPictureButton * fBSelVolume
void ShowSelectMaterial(Bool_t show=kTRUE)
Show/hide interface for material selection.
void DoCreateTrd2()
Create a Trd2.
TGeoMatrix * fSelectedMatrix
void DoCreateVolume()
Create a new volume.
void DoCreateCone()
Create a cone.
void DoCreateXtru()
Create an extruded polygone.
TGTextButton * fSetTopVolume
TGCompositeFrame * f4
TGeoShape * fSelectedShape
TGeoVolume * fSelectedVolume
void DoExportGeometry()
Export geometry as .root or .C file.
TGTextEntry * fMatrixName
void DoCreateTube()
Create a tube.
TGPictureButton * fBSelMaterial2
TGTextButton * fEditMatrix
TGTextButton * fExportButton
TGeoMedium * fSelectedMedium
TGTextEntry * fMaterialName
TGCompositeFrame * f6
void DoCreatePcon()
Create a polycone shape.
TGTextEntry * fManagerTitle
TGCompositeFrame * f7
void DoCreateTorus()
Create a torus shape.
void DoCreateTrap()
Create a general trapezoid.
TGTextButton * fCloseGeometry
void DoCreateSphe()
Create a sphere.
TGPictureButton * fBSelShape
TGRadioButton * fExportOption[2]
void DoSelectMaterial2()
Slot for selecting an existing material and making a medium.
void DoCreateMaterial()
Create a new material.
TGPictureButton * fBSelTop
TGeoManager * fGeometry
void ShowSelectMedium(Bool_t show=kTRUE)
Show/hide interface for medium selection.
TGShutter * fCategories
virtual void SelectedSlot(TVirtualPad *pad, TObject *obj, Int_t event)
Connected to TCanvas::Selected.
TGeoShape * fSelectedShape2
void ShowSelectVolume(Bool_t show=kTRUE)
Show/hide interface for volume selection.
void DoCreateMedium()
Create a new medium.
void ShowSelectShape(Bool_t show=kTRUE)
Show/hide interface for shape selection.
void ShowSelectMatrix(Bool_t show=kTRUE)
Show/hide interface for matrix selection.
void DoSelectMatrix()
Slot for selecting an existing matrix.
TGPictureButton * fMaterialButton[2]
TGNumberEntry * fEntryDensity
void DoEditShape()
Slot for editing selected shape.
virtual ~TGeoManagerEditor()
Destructor.
virtual void SetModel(TObject *obj)
Refresh editor according the selected obj.
void DoCreateEltu()
Create an elliptical tube.
void DoCreateCombi()
Create a new translation + rotation.
void DoCreateComposite()
Create a composite shape.
void DoCreateRotation()
Create a new rotation.
TGPictureButton * fBSelMedium
TGPictureButton * fShapeButton[21]
void DoCreateCtub()
Create a cut tube.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:39
TList * GetListOfMedia() const
Definition: TGeoManager.h:477
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:478
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:475
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
Export this geometry to a file.
TGeoVolume * GetMasterVolume() const
Definition: TGeoManager.h:512
Bool_t IsClosed() const
Definition: TGeoManager.h:290
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void BuildDefaultMaterials()
Now just a shortcut for GetElementTable.
TList * GetListOfMaterials() const
Definition: TGeoManager.h:476
TObjArray * GetListOfShapes() const
Definition: TGeoManager.h:480
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:513
Base class describing materials.
Definition: TGeoMaterial.h:31
Geometrical transformation package.
Definition: TGeoMatrix.h:41
@ kGeoTranslation
Definition: TGeoMatrix.h:46
@ kGeoRotation
Definition: TGeoMatrix.h:47
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:526
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:24
Mixtures of elements.
Definition: TGeoMaterial.h:135
Parallelepiped class.
Definition: TGeoPara.h:18
A polycone.
Definition: TGeoPcon.h:18
A polygone.
Definition: TGeoPgon.h:20
Class describing rotations.
Definition: TGeoMatrix.h:175
Base abstract class for all shapes.
Definition: TGeoShape.h:26
virtual const char * GetName() const
Get the shape name.
Definition: TGeoShape.cxx:248
virtual void Draw(Option_t *option="")
Draw this shape.
Definition: TGeoShape.cxx:721
Spherical shell class.
Definition: TGeoSphere.h:18
TVirtualPad * GetPad() const
void GetVolumeEditor(TGeoVolume *vol)
Get editor for a volume.
TGCompositeFrame * fVolumeTab
void GetMaterialEditor(TGeoMaterial *material)
Get editor for a material.
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.
TGCompositeFrame * GetVolumeTab() const
void GetMediumEditor(TGeoMedium *medium)
Get editor for a medium.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
void GetShapeEditor(TGeoShape *shape)
Get editor for a shape.
void SetTab()
Set a given tab element as active one.
void SetVolTabEnabled(Bool_t flag=kTRUE)
Enable/disable tabs.
void GetMatrixEditor(TGeoMatrix *matrix)
Get editor for a matrix.
Torus segment class.
Definition: TGeoTorus.h:18
Class describing translations.
Definition: TGeoMatrix.h:122
TRAP is a general trapezoid, i.e.
Definition: TGeoArb8.h:90
A trapezoid with only x length varying with z.
Definition: TGeoTrd1.h:18
A trapezoid with both x and y lengths varying with z.
Definition: TGeoTrd2.h:18
static TObject * GetSelected()
static; return selected object
A phi segment of a tube.
Definition: TGeoTube.h:89
Cylindrical tube class.
Definition: TGeoTube.h:18
Volume assemblies.
Definition: TGeoVolume.h:308
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:53
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
Mother of all ROOT objects.
Definition: TObject.h:37
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
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
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
Basic string class.
Definition: TString.h:131
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:2286
virtual void ShowAxis()=0
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
virtual TView * GetView() const =0
TF1 * f1
Definition: legend1.C:11
static constexpr double s
void table()
Definition: table.C:85