Logo ROOT  
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 "TGTab.h"
51#include "TG3DLine.h"
52#include "TGComboBox.h"
53#include "TGButton.h"
54#include "TGButtonGroup.h"
55#include "TGTextEntry.h"
56#include "TGNumberEntry.h"
57#include "TGLabel.h"
58#include "TGShutter.h"
59
60#include "TGeoVolumeEditor.h"
61#include "TGeoNodeEditor.h"
62#include "TGeoTabManager.h"
63#include "TGeoVolume.h"
64#include "TGeoManager.h"
65#include "TGeoMatrix.h"
66#include "TGeoBBox.h"
67#include "TGeoPara.h"
68#include "TGeoArb8.h"
69#include "TGeoTube.h"
70#include "TGeoEltu.h"
71#include "TGeoHype.h"
72#include "TGeoTorus.h"
73#include "TGeoTrd1.h"
74#include "TGeoTrd2.h"
75#include "TGeoCone.h"
76#include "TGeoSphere.h"
77#include "TGeoPcon.h"
78#include "TGeoPgon.h"
79#include "TGeoElement.h"
80#include "TGeoMaterial.h"
81#include "TView.h"
82
83#include "TGeoManagerEditor.h"
84#include "TGedEditor.h"
85
87
106
107////////////////////////////////////////////////////////////////////////////////
108/// Constructor for manager editor.
109
111 Int_t height, UInt_t options, Pixel_t back)
112 : TGedFrame(p, width, height, options | kVerticalFrame, back)
113{
115 fTabMgr = 0;
116 fTab = 0;
118
121 TGLabel *label;
122
123 // TGShutter for categories
125
126 TGCompositeFrame *container;
127 Pixel_t color;
128 // General settings
130 container = (TGCompositeFrame*)si->GetContainer();
132 fCategories->AddItem(si);
133 // TextEntry for manager name
134 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
135 f1->AddFrame(label = new TGLabel(f1, "Name/Title"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
136 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
137 gClient->GetColorByName("#ff0000", color);
138 label->SetTextColor(color);
139 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
140 fManagerName = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_NAME);
142 fManagerName->SetToolTipText("Enter the geometry name");
143 container->AddFrame(fManagerName, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
144 fManagerTitle = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_TITLE);
146 fManagerTitle->SetToolTipText("Enter the geometry name");
147 container->AddFrame(fManagerTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
148 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
149 f1->AddFrame(label = new TGLabel(f1, "Export geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
150 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
151 gClient->GetColorByName("#ff0000", color);
152 label->SetTextColor(color);
153 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 6, 0));
154 TString stitle = "Options";
155 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
156 TGButtonGroup *bg = new TGVButtonGroup(f1, stitle);
157 fExportOption[0] = new TGRadioButton(bg, ".root", kEXPORT_ROOT);
158 fExportOption[1] = new TGRadioButton(bg, ".C", kEXPORT_C);
162 bg->Show();
163 f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
164 f1->AddFrame(fExportButton, new TGLayoutHints(kLHintsLeft, 20, 2, 22, 0));
165 container->AddFrame(f1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
166 // Close geometry
167 f7 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
169 f1->AddFrame(label = new TGLabel(f1, "Close geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
170 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
171 gClient->GetColorByName("#ff0000", color);
172 label->SetTextColor(color);
173 f7->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
175 fLSelTop = new TGLabel(f1, "Select top");
176 gClient->GetColorByName("#0000ff", color);
177 fLSelTop->SetTextColor(color);
179 f1->AddFrame(fLSelTop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
181 fBSelTop->SetToolTipText("Select the top volume");
182 fBSelTop->Associate(this);
183 f1->AddFrame(fBSelTop, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
184 fCloseGeometry = new TGTextButton(f1, "Close");
185 f1->AddFrame(fCloseGeometry, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
186 fCloseGeometry->SetToolTipText("Close geometry to make it ready for tracking");
188 f7->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
189 container->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
190
191
192 si = new TGShutterItem(fCategories, new TGHotString("Shapes"),kCAT_SHAPES);
193 container = (TGCompositeFrame*)si->GetContainer();
195 fCategories->AddItem(si);
196
197 // Shape creators
198 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
199 f1->AddFrame(label = new TGLabel(f1, "Create new shape"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
200 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
201 gClient->GetColorByName("#ff0000", color);
202 label->SetTextColor(color);
203 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
204 TGLayoutHints *lhb = new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0);
205 TGLayoutHints *lhf1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
206 Int_t ipict;
207 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
208 fShapeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geobbox_t.xpm"), kCREATE_BOX);
209 fShapeButton[0]->SetToolTipText("Create a box");
210 fShapeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geopara_t.xpm"), kCREATE_PARA);
211 fShapeButton[1]->SetToolTipText("Create a parallelipiped");
212 fShapeButton[2] = new TGPictureButton(f1, fClient->GetPicture("geotrd1_t.xpm"), kCREATE_TRD1);
213 fShapeButton[2]->SetToolTipText("Create a TRD1 trapezoid");
214 fShapeButton[3] = new TGPictureButton(f1, fClient->GetPicture("geotrd2_t.xpm"), kCREATE_TRD2);
215 fShapeButton[3]->SetToolTipText("Create a TRD2 trapezoid");
216 fShapeButton[4] = new TGPictureButton(f1, fClient->GetPicture("geotrap_t.xpm"), kCREATE_TRAP);
217 fShapeButton[4]->SetToolTipText("Create a general trapezoid");
218 fShapeButton[5] = new TGPictureButton(f1, fClient->GetPicture("geogtra_t.xpm"), kCREATE_GTRA);
219 fShapeButton[5]->SetToolTipText("Create a general twisted trapezoid");
220 for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict],lhb);
221 container->AddFrame(f1, lhf1);
222 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
223 fShapeButton[6] = new TGPictureButton(f1, fClient->GetPicture("geoxtru_t.xpm"), kCREATE_XTRU);
224 fShapeButton[6]->SetToolTipText("Create a extruded polygone");
225 fShapeButton[7] = new TGPictureButton(f1, fClient->GetPicture("geoarb8_t.xpm"), kCREATE_ARB8);
226 fShapeButton[7]->SetToolTipText("Create an arbitrary trapezoid with 8 vertices");
227 fShapeButton[8] = new TGPictureButton(f1, fClient->GetPicture("geotube_t.xpm"), kCREATE_TUBE);
228 fShapeButton[8]->SetToolTipText("Create a cylindrical pipe");
229 fShapeButton[9] = new TGPictureButton(f1, fClient->GetPicture("geotubeseg_t.xpm"), kCREATE_TUBS);
230 fShapeButton[9]->SetToolTipText("Create a cylindrical pipe within a phi range");
231 fShapeButton[10] = new TGPictureButton(f1, fClient->GetPicture("geocone_t.xpm"), kCREATE_CONE);
232 fShapeButton[10]->SetToolTipText("Create a conical pipe");
233 fShapeButton[11] = new TGPictureButton(f1, fClient->GetPicture("geoconeseg_t.xpm"), kCREATE_CONS);
234 fShapeButton[11]->SetToolTipText("Create a conical pipe within a phi range");
235 for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+6],lhb);
236 container->AddFrame(f1, lhf1);
237 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
238 fShapeButton[12] = new TGPictureButton(f1, fClient->GetPicture("geosphere_t.xpm"), kCREATE_SPHE);
239 fShapeButton[12]->SetToolTipText("Create a spherical sector");
240 fShapeButton[13] = new TGPictureButton(f1, fClient->GetPicture("geoctub_t.xpm"), kCREATE_CTUB);
241 fShapeButton[13]->SetToolTipText("Create a cut tube");
242 fShapeButton[14] = new TGPictureButton(f1, fClient->GetPicture("geoeltu_t.xpm"), kCREATE_ELTU);
243 fShapeButton[14]->SetToolTipText("Create an elliptical tube");
244 fShapeButton[15] = new TGPictureButton(f1, fClient->GetPicture("geotorus_t.xpm"), kCREATE_TORUS);
245 fShapeButton[15]->SetToolTipText("Create a toroidal tube with a phi range");
246 fShapeButton[16] = new TGPictureButton(f1, fClient->GetPicture("geopcon_t.xpm"), kCREATE_PCON);
247 fShapeButton[16]->SetToolTipText("Create a polycone shape");
248 fShapeButton[17] = new TGPictureButton(f1, fClient->GetPicture("geopgon_t.xpm"), kCREATE_PGON);
249 fShapeButton[17]->SetToolTipText("Create a polygon shape");
250 for (ipict=0; ipict<6; ipict++) f1->AddFrame(fShapeButton[ipict+12],lhb);
251 container->AddFrame(f1, lhf1);
252 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
253 fShapeButton[18] = new TGPictureButton(f1, fClient->GetPicture("geohype_t.xpm"), kCREATE_HYPE);
254 fShapeButton[18]->SetToolTipText("Create a hyperboloid");
255 fShapeButton[19] = new TGPictureButton(f1, fClient->GetPicture("geoparab_t.xpm"), kCREATE_PARAB);
256 fShapeButton[19]->SetToolTipText("Create a paraboloid");
257 fShapeButton[20] = new TGPictureButton(f1, fClient->GetPicture("geocomposite_t.xpm"), kCREATE_COMP);
258 fShapeButton[20]->SetToolTipText("Create a composite shape");
259 for (ipict=0; ipict<3; ipict++) f1->AddFrame(fShapeButton[ipict+18],lhb);
260 container->AddFrame(f1, lhf1);
261
262 // List of shapes
263 f2 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
265 f1->AddFrame(label = new TGLabel(f1, "Existing shapes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
266 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
267 gClient->GetColorByName("#ff0000", color);
268 label->SetTextColor(color);
269 f2->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
271 fSelectedShape = 0;
272 fLSelShape = new TGLabel(f1, "Select shape");
273 gClient->GetColorByName("#0000ff", color);
274 fLSelShape->SetTextColor(color);
276 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
278 fBSelShape->SetToolTipText("Select one of the existing shapes");
279 fBSelShape->Associate(this);
280 f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
281 fEditShape = new TGTextButton(f1, "Edit");
282 f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
283 fEditShape->SetToolTipText("Edit selected shape");
284 fEditShape->Associate(this);
285 f2->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
286 container->AddFrame(f2, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
287
288 // Volumes category
289 si = new TGShutterItem(fCategories, new TGHotString("Volumes"),kCAT_VOLUMES);
290 container = (TGCompositeFrame*)si->GetContainer();
292 fCategories->AddItem(si);
293
294 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
295 f1->AddFrame(label = new TGLabel(f1, "Create new volume"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
296 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
297 gClient->GetColorByName("#ff0000", color);
298 label->SetTextColor(color);
299 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
300
301 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
302 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
305 fVolumeName->SetToolTipText("Enter the name for the new volume");
306 f1->AddFrame(fVolumeName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
307 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
308
309 // ComboBox for shape component
310 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
311 fSelectedShape2 = 0;
312 fLSelShape2 = new TGLabel(f1, "Select shape");
313 gClient->GetColorByName("#0000ff", color);
316 f1->AddFrame(fLSelShape2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
318 fBSelShape2->SetToolTipText("Select one of the existing shapes");
319 fBSelShape2->Associate(this);
320 f1->AddFrame(fBSelShape2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
321 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
322
323 // ComboBox for medium component
324 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
326 fLSelMedium2 = new TGLabel(f1, "Select medium");
327 gClient->GetColorByName("#0000ff", color);
330 f1->AddFrame(fLSelMedium2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
332 fBSelMedium2->SetToolTipText("Select one of the existing media");
333 fBSelMedium2->Associate(this);
334 f1->AddFrame(fBSelMedium2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
335 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
336 // Picture buttons for different volumes
337 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
338 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
339 fVolumeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geovolume_t.xpm"), kCREATE_VOLUME);
340 fVolumeButton[0]->SetToolTipText("Create a new volume from shape and medium");
341 fVolumeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geoassembly_t.xpm"), kCREATE_ASSEMBLY);
342 fVolumeButton[1]->SetToolTipText("Create a new volume assembly having the selected name");
343 for (ipict=0; ipict<2; ipict++) f1->AddFrame(fVolumeButton[ipict],lhb);
344 container->AddFrame(f1, lhf1);
345 // List of volumes
346 f3 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
348 f1->AddFrame(label = new TGLabel(f1, "Existing volumes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
349 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
350 gClient->GetColorByName("#ff0000", color);
351 label->SetTextColor(color);
352 f3->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
354 fSelectedVolume = 0;
355 fLSelVolume = new TGLabel(f1, "Select volume");
356 gClient->GetColorByName("#0000ff", color);
359 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
361 fBSelVolume->SetToolTipText("Select one of the existing volumes");
362 fBSelVolume->Associate(this);
363 f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
364 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
366 fEditVolume = new TGTextButton(f1, " Edit ");
367 f1->AddFrame(fEditVolume, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 2));
368 fEditVolume->SetToolTipText("Edit selected volume");
369 fEditVolume->Associate(this);
370 fSetTopVolume = new TGTextButton(f1, "Set top");
371 f1->AddFrame(fSetTopVolume, new TGLayoutHints(kLHintsRight, 1, 20, 2, 2));
372 fSetTopVolume->SetToolTipText("Set top volume for geometry");
374 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
375 container->AddFrame(f3, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
376
377 // Materials category
378 si = new TGShutterItem(fCategories, new TGHotString("Materials"),kCAT_MATERIALS);
379 container = (TGCompositeFrame*)si->GetContainer();
381 fCategories->AddItem(si);
382
383 // Material creators
385 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
386 f1->AddFrame(label = new TGLabel(f1, "Create material/mixt."), new TGLayoutHints(kLHintsLeft, 2, 1, 0, 0));
387 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
388 gClient->GetColorByName("#ff0000", color);
389 label->SetTextColor(color);
390 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
391 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
392 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
395 fMaterialName->SetToolTipText("Enter the new material name");
396 f1->AddFrame(fMaterialName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
397 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
398
399 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
400 f1->AddFrame(new TGLabel(f1, "Element"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
404 if (table) {
405 TGeoElement *element;
406 for (Int_t i=0; i<table->GetNelements(); i++) {
407 element = table->GetElement(i);
408 fElementList->AddEntry(element->GetTitle(),i);
409 }
410 }
412 f1->AddFrame(fElementList, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
413 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
414 // Number entry for density
415 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
416 f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
422 nef->SetToolTipText("Enter material/mixture density");
425 f1->AddFrame(fEntryDensity, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
426 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
427 // Buttons for creating materials/mixtures
428 // Picture buttons for different volumes
429 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
430 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
431 fMaterialButton[0] = new TGPictureButton(f1, fClient->GetPicture("geomaterial_t.xpm"), kCREATE_MATERIAL);
432 fMaterialButton[0]->SetToolTipText("Create a new material from element and density");
433 fMaterialButton[1] = new TGPictureButton(f1, fClient->GetPicture("geomixture_t.xpm"), kCREATE_MIXTURE);
434 fMaterialButton[1]->SetToolTipText("Create a new mixture with selected density");
435 for (ipict=0; ipict<2; ipict++) f1->AddFrame(fMaterialButton[ipict],lhb);
436 container->AddFrame(f1, lhf1);
437
438 // List of materials
439 f4 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
441 f1->AddFrame(label = new TGLabel(f1, "Existing materials"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
442 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
443 gClient->GetColorByName("#ff0000", color);
444 label->SetTextColor(color);
445 f4->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
448 fLSelMaterial = new TGLabel(f1, "Select material");
449 gClient->GetColorByName("#0000ff", color);
454 fBSelMaterial->SetToolTipText("Select one of the existing materials");
456 f1->AddFrame(fBSelMaterial, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
457 fEditMaterial = new TGTextButton(f1, "Edit");
458 f1->AddFrame(fEditMaterial, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
459 fEditMaterial->SetToolTipText("Edit selected material");
461 f4->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
462 container->AddFrame(f4, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
463
464 si = new TGShutterItem(fCategories, new TGHotString("Media"),kCAT_MEDIA);
465 container = (TGCompositeFrame*)si->GetContainer();
467 fCategories->AddItem(si);
468
469 // Media category
470 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
471 f1->AddFrame(label = new TGLabel(f1, "Create new medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
472 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
473 gClient->GetColorByName("#ff0000", color);
474 label->SetTextColor(color);
475 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
476
477 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
478 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
481 fMediumName->SetToolTipText("Enter the new medium name");
482 f1->AddFrame(fMediumName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
483
484 fMediumId = new TGNumberEntry(f1, 0., 5, kMEDIUM_ID);
489 nef->SetToolTipText("Enter medium ID");
491 fMediumId->Associate(this);
492 f1->AddFrame(fMediumId, new TGLayoutHints(kLHintsRight, 2, 2, 2 ,2));
493 f1->AddFrame(new TGLabel(f1, "ID"), new TGLayoutHints(kLHintsRight, 1, 1, 6, 0));
494 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
495 // ComboBox for materials
496 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
498 fLSelMaterial2 = new TGLabel(f1, "Select material");
499 gClient->GetColorByName("#0000ff", color);
504 fBSelMaterial2->SetToolTipText("Select one of the existing materials");
506 f1->AddFrame(fBSelMaterial2, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
507 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
508 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
509 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
511 fMediumButton->SetToolTipText("Create a new medium from selected material");
513 f1->AddFrame(fMediumButton, new TGLayoutHints(kLHintsLeft, 5, 2, 2, 2));
514 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
515
516 // List of media
517 f5 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
519 f1->AddFrame(label = new TGLabel(f1, "Existing media"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
520 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
521 gClient->GetColorByName("#ff0000", color);
522 label->SetTextColor(color);
523 f5->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
525 fSelectedMedium = 0;
526 fLSelMedium = new TGLabel(f1, "Select medium");
527 gClient->GetColorByName("#0000ff", color);
530 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
532 fBSelMedium->SetToolTipText("Select one of the existing media");
533 fBSelMedium->Associate(this);
534 f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
535 fEditMedium = new TGTextButton(f1, "Edit");
536 f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
537 fEditMedium->SetToolTipText("Edit selected medium");
538 fEditMedium->Associate(this);
539 f5->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
540 container->AddFrame(f5, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
541
542 // Matrix category
543 si = new TGShutterItem(fCategories, new TGHotString("Matrices"),kCAT_MATRICES);
544 container = (TGCompositeFrame*)si->GetContainer();
546 fCategories->AddItem(si);
547 // Name entry
548 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
549 f1->AddFrame(label = new TGLabel(f1, "Create new matrix"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
550 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
551 gClient->GetColorByName("#ff0000", color);
552 label->SetTextColor(color);
553 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
554
555 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
556 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
559 fMatrixName->SetToolTipText("Enter the new matrix name");
560 f1->AddFrame(fMatrixName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
561 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
562 // Picture buttons for different matrices
563 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
564 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
565 fMatrixButton[0] = new TGPictureButton(f1, fClient->GetPicture("geotranslation_t.xpm"), kCREATE_TRANSLATION);
566 fMatrixButton[0]->SetToolTipText("Create a translation");
567 fMatrixButton[1] = new TGPictureButton(f1, fClient->GetPicture("georotation_t.xpm"), kCREATE_ROTATION);
568 fMatrixButton[1]->SetToolTipText("Create a rotation");
569 fMatrixButton[2] = new TGPictureButton(f1, fClient->GetPicture("geocombi_t.xpm"), kCREATE_COMBI);
570 fMatrixButton[2]->SetToolTipText("Create a rotation + translation");
571 for (ipict=0; ipict<3; ipict++) f1->AddFrame(fMatrixButton[ipict],lhb);
572 container->AddFrame(f1, lhf1);
573 // List of matrices
574 f6 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
576 f1->AddFrame(label = new TGLabel(f1, "Existing matrices"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
577 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
578 gClient->GetColorByName("#ff0000", color);
579 label->SetTextColor(color);
580 f6->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
582 fSelectedMatrix = 0;
583 fLSelMatrix = new TGLabel(f1, "Select matrix");
584 gClient->GetColorByName("#0000ff", color);
587 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
589 fBSelMatrix->SetToolTipText("Select one of the existing matrices");
590 fBSelMatrix->Associate(this);
591 f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
592 fEditMatrix = new TGTextButton(f1, "Edit");
593 f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
594 fEditMatrix->SetToolTipText("Edit selected matrix");
595 fEditMatrix->Associate(this);
596 f6->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
597 container->AddFrame(f6, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
598
599 fCategories->Resize(163,370);
601
603
604 // Set the fTab and disconnect editor from the canvas.
606 TCanvas* edCanvas = fGedEditor->GetCanvas();
608 if (edCanvas != fConnectedCanvas) {
610 if (edCanvas)
611 ConnectSelected(edCanvas);
612 fConnectedCanvas = edCanvas;
613 }
614}
615
616////////////////////////////////////////////////////////////////////////////////
617/// Destructor.
618
620{
621 TGCompositeFrame *cont;
622 cont = (TGCompositeFrame*)fCategories->GetItem("General")->GetContainer();
624 fCategories->GetItem("General")->SetCleanup(0);
625 cont = (TGCompositeFrame*)fCategories->GetItem("Shapes")->GetContainer();
627 fCategories->GetItem("Shapes")->SetCleanup(0);
628 cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
630 fCategories->GetItem("Volumes")->SetCleanup(0);
631 cont = (TGCompositeFrame*)fCategories->GetItem("Materials")->GetContainer();
633 fCategories->GetItem("Materials")->SetCleanup(0);
634 cont = (TGCompositeFrame*)fCategories->GetItem("Media")->GetContainer();
636 fCategories->GetItem("Media")->SetCleanup(0);
637 cont = (TGCompositeFrame*)fCategories->GetItem("Matrices")->GetContainer();
639 fCategories->GetItem("Matrices")->SetCleanup(0);
640
641 delete fExportOption[0]; delete fExportOption[1];
642
643 Cleanup();
644
645 if (fTabMgr) {
647 delete fTabMgr;
648 }
649}
650
651////////////////////////////////////////////////////////////////////////////////
652/// Connected to TCanvas::Selected. TGeoManagerEditor takes this
653/// function from TGedEditor and only uses it if obj is a TGeoVolume.
654
656{
657 if (event == kButton1 && obj->InheritsFrom(TGeoVolume::Class())) {
658 TGeoVolume* v = (TGeoVolume*) obj;
660 fTabMgr->SetTab();
662 v->Draw();
663 }
664}
665
667{
668 // Connect to TCanvas::Selected.
669
670 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGeoManagerEditor",
671 this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
672}
673
675{
676 // Disconnect from TCanvas::Selected.
677
679 Disconnect(fConnectedCanvas, "Selected(TVirtualPad*,TObject*,Int_t)",
680 this, "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
681
682}
683
684////////////////////////////////////////////////////////////////////////////////
685/// Connect signals to slots.
686
688{
689 fManagerName->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
690 fManagerTitle->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
691 fExportButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoExportGeometry()");
692 fCloseGeometry->Connect("Clicked()", "TGeoManagerEditor", this, "DoCloseGeometry()");
693 fShapeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateBox()");
694 fShapeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePara()");
695 fShapeButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd1()");
696 fShapeButton[3]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd2()");
697 fShapeButton[4]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrap()");
698 fShapeButton[5]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateGtra()");
699 fShapeButton[6]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateXtru()");
700 fShapeButton[7]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateArb8()");
701 fShapeButton[8]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTube()");
702 fShapeButton[9]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTubs()");
703 fShapeButton[10]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCone()");
704 fShapeButton[11]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCons()");
705 fShapeButton[12]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateSphe()");
706 fShapeButton[13]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCtub()");
707 fShapeButton[14]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateEltu()");
708 fShapeButton[15]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTorus()");
709 fShapeButton[16]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePcon()");
710 fShapeButton[17]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePgon()");
711 fShapeButton[18]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateHype()");
712 fShapeButton[19]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateParab()");
713 fShapeButton[20]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateComposite()");
714 fMatrixButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTranslation()");
715 fMatrixButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateRotation()");
716 fMatrixButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCombi()");
717 fVolumeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateVolume()");
718 fVolumeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateAssembly()");
719 fBSelTop->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectTopVolume()");
720 fBSelVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectVolume()");
721 fBSelShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape()");
722 fBSelShape2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape2()");
723 fBSelMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMatrix()");
724 fBSelMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial()");
725 fBSelMaterial2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial2()");
726 fBSelMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium()");
727 fBSelMedium2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium2()");
728 fSetTopVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSetTopVolume()");
729 fEditShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditShape()");
730 fEditMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMedium()");
731 fEditMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMaterial()");
732 fEditMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMatrix()");
733 fEditVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditVolume()");
734
735 fMaterialButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMaterial()");
736 fMaterialButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMixture()");
737 fMediumButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMedium()");
738}
739
740////////////////////////////////////////////////////////////////////////////////
741/// Refresh editor according the selected obj.
742
744{
745 fGeometry = (TGeoManager*)obj;
752 // Check if master volume can be set
755 // Check if geometry is already closed
757 else {
760 }
761 // Check if volumes category can be activated
764 else
767 else ShowSelectShape();
769 else ShowSelectVolume();
771 else ShowSelectMedium();
773 else ShowSelectMatrix();
774
775 // Check if media category can be activated
779 } else {
782 }
783
784 fTab->SetTab(0);
786 if (fTabMgr == 0) {
789 }
791 // SetActive();
792}
793
794////////////////////////////////////////////////////////////////////////////////
795/// Change name/title of the geometry
796
798{
801}
802
803////////////////////////////////////////////////////////////////////////////////
804/// Export geometry as .root or .C file
805
807{
808 Bool_t asroot = fExportOption[0]->IsDown();
810 s = s.Strip();
811 s.Remove(20);
812 const char *name;
813 if (asroot) name = TString::Format("%s.root", s.Data());
814 else name = TString::Format("%s.C", s.Data());
816}
817
818////////////////////////////////////////////////////////////////////////////////
819/// Create a box.
820
822{
824 fSelectedShape = new TGeoBBox(TString::Format("box_%i",id), 1., 1., 1.);
826 // Check if volumes category can be activated
829 DoEditShape();
830}
831
832////////////////////////////////////////////////////////////////////////////////
833/// Create a parallelipiped.
834
836{
838 fSelectedShape = new TGeoPara(TString::Format("para_%i",id), 1., 1., 1., 30., 20., 45.);
842 DoEditShape();
843}
844
845////////////////////////////////////////////////////////////////////////////////
846/// Create a Trd1.
847
849{
851 fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i",id), 0.5, 1., 1., 1.);
855 DoEditShape();
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Create a Trd2.
860
862{
864 fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i",id), 0.5, 1., 0.5, 1., 1.);
868 DoEditShape();
869}
870
871////////////////////////////////////////////////////////////////////////////////
872/// Create a general trapezoid.
873
875{
877 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 DoEditShape();
882}
883
884////////////////////////////////////////////////////////////////////////////////
885/// Create a twisted trapezoid.
886
888{
890 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 DoEditShape();
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// Create an extruded polygone.
899
901{
902}
903
904////////////////////////////////////////////////////////////////////////////////
905/// Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel
906/// planes
907
909{
910}
911
912////////////////////////////////////////////////////////////////////////////////
913/// Create a tube.
914
916{
918 fSelectedShape = new TGeoTube(TString::Format("tube_%i",id), 0.5, 1., 1.);
922 DoEditShape();
923}
924
925////////////////////////////////////////////////////////////////////////////////
926/// Create a tube segment.
927
929{
931 fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i",id), 0.5, 1., 1.,0.,45.);
935 DoEditShape();
936}
937
938////////////////////////////////////////////////////////////////////////////////
939/// Create a cone.
940
942{
944 fSelectedShape = new TGeoCone(TString::Format("cone_%i",id), 0.5, 0.5, 1., 1.5, 2.);
948 DoEditShape();
949}
950
951////////////////////////////////////////////////////////////////////////////////
952/// Create a cone segment.
953
955{
957 fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i",id), 0.5, 0.5, 1., 1.5, 2.,0.,45.);
961 DoEditShape();
962}
963
964////////////////////////////////////////////////////////////////////////////////
965/// Create a sphere.
966
968{
970 fSelectedShape = new TGeoSphere(TString::Format("sphere_%i",id), 0.5, 1., 0., 180., 0.,360.);
974 DoEditShape();
975}
976
977////////////////////////////////////////////////////////////////////////////////
978/// Create a cut tube.
979
981{
983 fSelectedShape = new TGeoCtub(TString::Format("ctub_%i",id), 0.5, 1., 1.,0.,45.,0.,0.,-1,0.,0.,1);
987 DoEditShape();
988}
989
990////////////////////////////////////////////////////////////////////////////////
991/// Create an elliptical tube.
992
994{
996 fSelectedShape = new TGeoEltu(TString::Format("para_%i",id), 1., 2., 1.5 );
1000 DoEditShape();
1001}
1002
1003////////////////////////////////////////////////////////////////////////////////
1004/// Create a torus shape.
1005
1007{
1009 fSelectedShape = new TGeoTorus(TString::Format("torus_%i",id), 10., 1., 1.5, 0, 360.);
1012 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1013 DoEditShape();
1014
1015}
1016
1017////////////////////////////////////////////////////////////////////////////////
1018/// Create a polycone shape.
1019
1021{
1023 fSelectedShape = new TGeoPcon(TString::Format("pcon_%i",id), 0., 360., 2);
1024 ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1025 ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1028 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1029 DoEditShape();
1030}
1031
1032////////////////////////////////////////////////////////////////////////////////
1033/// Create a polygone shape.
1034
1036{
1038 fSelectedShape = new TGeoPgon(TString::Format("pgon_%i",id), 0., 360.,6,2);
1039 ((TGeoPcon*)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1040 ((TGeoPcon*)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1043 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1044 DoEditShape();
1045}
1046
1047////////////////////////////////////////////////////////////////////////////////
1048/// Create a hyperboloid.
1049
1051{
1053 fSelectedShape = new TGeoHype(TString::Format("hype_%i",id), 1., 15., 2., 30., 5.);
1056 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1057 DoEditShape();
1058}
1059
1060////////////////////////////////////////////////////////////////////////////////
1061/// Create a paraboloid.
1062
1064{
1065}
1066
1067////////////////////////////////////////////////////////////////////////////////
1068/// Create a composite shape.
1069
1071{
1072}
1073
1074////////////////////////////////////////////////////////////////////////////////
1075/// Create a new material.
1076
1078{
1080 if (!el) {
1081 Error("DoCreateMaterial", "Cannot find selected element in list");
1082 return;
1083 }
1084 Double_t density = fEntryDensity->GetNumber();
1085 const char *name = fMaterialName->GetText();
1086 fSelectedMaterial = new TGeoMaterial(name, el, density);
1091}
1092
1093////////////////////////////////////////////////////////////////////////////////
1094/// Create a new mixture.
1095
1097{
1098 Double_t density = fEntryDensity->GetNumber();
1099 const char *name = fMaterialName->GetText();
1100 fSelectedMaterial = new TGeoMixture(name, 1, density);
1105}
1106
1107////////////////////////////////////////////////////////////////////////////////
1108/// Create a new medium.
1109
1111{
1113 if (!fSelectedMaterial2) return;
1114 const char *name = fMediumName->GetText();
1118 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1119 DoEditMedium();
1121}
1122
1123////////////////////////////////////////////////////////////////////////////////
1124/// Create a new translation.
1125
1127{
1128 const char *name = fMatrixName->GetText();
1129 fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1133 DoEditMatrix();
1135}
1136
1137////////////////////////////////////////////////////////////////////////////////
1138/// Create a new rotation.
1139
1141{
1142 const char *name = fMatrixName->GetText();
1147 DoEditMatrix();
1149}
1150
1151////////////////////////////////////////////////////////////////////////////////
1152/// Create a new volume.
1153
1155{
1156 const char *name = fVolumeName->GetText();
1157 if (!fSelectedShape2 || !fSelectedMedium2) return;
1161 DoEditVolume();
1163}
1164
1165////////////////////////////////////////////////////////////////////////////////
1166/// Create a new volume assembly.
1167
1169{
1170 const char *name = fVolumeName->GetText();
1174 DoEditVolume();
1176}
1177
1178////////////////////////////////////////////////////////////////////////////////
1179/// Create a new translation + rotation.
1180
1182{
1183 const char *name = fMatrixName->GetText();
1184 fSelectedMatrix = new TGeoCombiTrans(name, 0., 0., 0., new TGeoRotation());
1189 DoEditMatrix();
1191}
1192
1193////////////////////////////////////////////////////////////////////////////////
1194/// Set top volume for the geometry.
1195
1197{
1198 if (!fSelectedVolume) return;
1201}
1202
1203////////////////////////////////////////////////////////////////////////////////
1204/// Slot for editing selected shape.
1205
1207{
1208 if (!fSelectedShape) return;
1211 fTabMgr->GetPad()->GetView()->ShowAxis();
1212}
1213
1214////////////////////////////////////////////////////////////////////////////////
1215/// Slot for editing selected volume.
1216
1218{
1219 if (!fSelectedVolume) {
1221 return;
1222 }
1224 fTabMgr->SetTab();
1227}
1228
1229////////////////////////////////////////////////////////////////////////////////
1230/// Slot for editing selected medium.
1231
1233{
1234 if (!fSelectedMedium) return;
1236}
1237
1238////////////////////////////////////////////////////////////////////////////////
1239/// Slot for editing selected material.
1240
1242{
1243 if (!fSelectedMaterial) return;
1245}
1246
1247////////////////////////////////////////////////////////////////////////////////
1248/// Slot for editing selected matrix.
1249
1251{
1252 if (!fSelectedMatrix) return;
1254}
1255
1256////////////////////////////////////////////////////////////////////////////////
1257/// Slot for selecting an existing matrix.
1258
1260{
1261 TGeoMatrix *matrix = fSelectedMatrix;
1262 new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200,300);
1265 else fSelectedMatrix = matrix;
1266}
1267
1268////////////////////////////////////////////////////////////////////////////////
1269/// Slot for selecting an existing shape.
1270
1272{
1273 TGeoShape *shape = fSelectedShape;
1274 new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200,300);
1277 else fSelectedShape = shape;
1278}
1279
1280////////////////////////////////////////////////////////////////////////////////
1281/// Slot for selecting a shape for making a volume.
1282
1284{
1285 TGeoShape *shape = fSelectedShape2;
1286 new TGeoShapeDialog(fBSelShape2, gClient->GetRoot(), 200,300);
1289 else fSelectedShape2 = shape;
1290}
1291
1292////////////////////////////////////////////////////////////////////////////////
1293/// Slot for selecting an existing material.
1294
1296{
1298 new TGeoMaterialDialog(fBSelMaterial, gClient->GetRoot(), 200,300);
1301 else fSelectedMaterial = mat;
1302}
1303
1304////////////////////////////////////////////////////////////////////////////////
1305/// Slot for selecting an existing material and making a medium.
1306
1308{
1310 new TGeoMaterialDialog(fBSelMaterial2, gClient->GetRoot(), 200,300);
1313 else fSelectedMaterial2 = mat;
1314}
1315
1316////////////////////////////////////////////////////////////////////////////////
1317/// Slot for selecting an existing medium.
1318
1320{
1322 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200,300);
1325 else fSelectedMedium = med;
1326}
1327
1328////////////////////////////////////////////////////////////////////////////////
1329/// Slot for selecting an existing medium for making a volume.
1330
1332{
1334 new TGeoMediumDialog(fBSelMedium2, gClient->GetRoot(), 200,300);
1337 else fSelectedMedium2 = med;
1338}
1339
1340////////////////////////////////////////////////////////////////////////////////
1341/// Slot for selecting an existing volume.
1342
1344{
1346 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200,300);
1349 else fSelectedVolume = vol;
1350}
1351
1352////////////////////////////////////////////////////////////////////////////////
1353/// Slot for setting top geometry volume.
1354
1356{
1358 new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200,300);
1361 else fSelectedVolume = vol;
1363}
1364
1365////////////////////////////////////////////////////////////////////////////////
1366/// Slot for closing the geometry.
1367
1369{
1372}
1373
1374////////////////////////////////////////////////////////////////////////////////
1375/// Show/hide interface for shape selection.
1376
1378{
1380 if (show) cont->ShowFrame(f2);
1381 else cont->HideFrame(f2);
1382}
1383
1384////////////////////////////////////////////////////////////////////////////////
1385/// Show/hide interface for volume selection.
1386
1388{
1390 if (show) cont->ShowFrame(f7);
1391 else cont->HideFrame(f7);
1392 cont = (TGCompositeFrame*)fCategories->GetItem("Volumes")->GetContainer();
1393 if (show) cont->ShowFrame(f3);
1394 else cont->HideFrame(f3);
1395}
1396
1397////////////////////////////////////////////////////////////////////////////////
1398/// Show/hide interface for material selection.
1399
1401{
1403 if (show) cont->ShowFrame(f4);
1404 else cont->HideFrame(f4);
1405}
1406
1407////////////////////////////////////////////////////////////////////////////////
1408/// Show/hide interface for medium selection.
1409
1411{
1413 if (show) cont->ShowFrame(f5);
1414 else cont->HideFrame(f5);
1415}
1416
1417////////////////////////////////////////////////////////////////////////////////
1418/// Show/hide interface for matrix selection.
1419
1421{
1423 if (show) cont->ShowFrame(f6);
1424 else cont->HideFrame(f6);
1425}
void Class()
Definition: Class.C:29
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kDoubleBorder
Definition: GuiTypes.h:385
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedHeight
Definition: GuiTypes.h:389
@ kOwnBackground
Definition: GuiTypes.h:391
ULong_t Pixel_t
Definition: GuiTypes.h:39
@ kButton1
Definition: GuiTypes.h:213
#define c(i)
Definition: RSha256.hxx:101
const Bool_t kFALSE
Definition: RtypesCore.h:90
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
@ 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
char name[80]
Definition: TGX11.cxx:109
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:600
The Canvas class.
Definition: TCanvas.h:27
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:397
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:411
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:451
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:1101
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:305
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:667
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGLabel.cxx:360
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:178
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:508
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:324
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
Int_t GetNelements() const
Definition: TGeoElement.h:417
Base class for chemical elements.
Definition: TGeoElement.h:37
Elliptical tube class.
Definition: TGeoEltu.h:18
Gtra is a twisted trapezoid.
Definition: TGeoArb8.h:146
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:43
TList * GetListOfMedia() const
Definition: TGeoManager.h:490
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:491
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:488
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:529
Bool_t IsClosed() const
Definition: TGeoManager.h:303
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:489
TObjArray * GetListOfShapes() const
Definition: TGeoManager.h:493
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:530
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:152
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:92
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:301
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:47
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:523
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:891
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:866
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:1024
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:2311
virtual void ShowAxis()=0
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
virtual TView * GetView() const =0
TF1 * f1
Definition: legend1.C:11
static constexpr double s