Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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
86
152
153////////////////////////////////////////////////////////////////////////////////
154/// Constructor for manager editor.
155
157 : TGedFrame(p, width, height, options | kVerticalFrame, back)
158{
160 fTabMgr = nullptr;
161 fTab = nullptr;
162 fConnectedCanvas = nullptr;
163
166 TGLabel *label;
167
168 // TGShutter for categories
170
171 TGCompositeFrame *container;
172 Pixel_t color;
173 // General settings
175 container = (TGCompositeFrame *)si->GetContainer();
177 fCategories->AddItem(si);
178 // TextEntry for manager name
179 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
180 f1->AddFrame(label = new TGLabel(f1, "Name/Title"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
181 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
182 gClient->GetColorByName("#ff0000", color);
183 label->SetTextColor(color);
184 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
185 fManagerName = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_NAME);
186 fManagerName->Resize(135, fManagerName->GetDefaultHeight());
187 fManagerName->SetToolTipText("Enter the geometry name");
188 container->AddFrame(fManagerName, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
189 fManagerTitle = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_TITLE);
190 fManagerTitle->Resize(135, fManagerTitle->GetDefaultHeight());
191 fManagerTitle->SetToolTipText("Enter the geometry name");
192 container->AddFrame(fManagerTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
193 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
194 f1->AddFrame(label = new TGLabel(f1, "Export geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
195 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
196 gClient->GetColorByName("#ff0000", color);
197 label->SetTextColor(color);
198 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 6, 0));
199 TString stitle = "Options";
200 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
201 TGButtonGroup *bg = new TGVButtonGroup(f1, stitle);
202 fExportOption[0] = new TGRadioButton(bg, ".root", kEXPORT_ROOT);
203 fExportOption[1] = new TGRadioButton(bg, ".C", kEXPORT_C);
207 bg->Show();
208 f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
209 f1->AddFrame(fExportButton, new TGLayoutHints(kLHintsLeft, 20, 2, 22, 0));
210 container->AddFrame(f1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
211 // Close geometry
212 f7 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
214 f1->AddFrame(label = new TGLabel(f1, "Close geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
215 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
216 gClient->GetColorByName("#ff0000", color);
217 label->SetTextColor(color);
218 f7->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
220 fLSelTop = new TGLabel(f1, "Select top");
221 gClient->GetColorByName("#0000ff", color);
222 fLSelTop->SetTextColor(color);
223 fLSelTop->ChangeOptions(kSunkenFrame | kDoubleBorder);
224 f1->AddFrame(fLSelTop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
225 fBSelTop = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_TOP_SELECT);
226 fBSelTop->SetToolTipText("Select the top volume");
227 fBSelTop->Associate(this);
228 f1->AddFrame(fBSelTop, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
229 fCloseGeometry = new TGTextButton(f1, "Close");
230 f1->AddFrame(fCloseGeometry, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
231 fCloseGeometry->SetToolTipText("Close geometry to make it ready for tracking");
232 fCloseGeometry->Associate(this);
233 f7->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
234 container->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
235
236 si = new TGShutterItem(fCategories, new TGHotString("Shapes"), kCAT_SHAPES);
237 container = (TGCompositeFrame *)si->GetContainer();
239 fCategories->AddItem(si);
240
241 // Shape creators
242 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
243 f1->AddFrame(label = new TGLabel(f1, "Create new shape"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
244 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
245 gClient->GetColorByName("#ff0000", color);
246 label->SetTextColor(color);
247 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
248 TGLayoutHints *lhb = new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0);
249 TGLayoutHints *lhf1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
250 Int_t ipict;
251 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
252 fShapeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geobbox_t.xpm"), kCREATE_BOX);
253 fShapeButton[0]->SetToolTipText("Create a box");
254 fShapeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geopara_t.xpm"), kCREATE_PARA);
255 fShapeButton[1]->SetToolTipText("Create a parallelipiped");
256 fShapeButton[2] = new TGPictureButton(f1, fClient->GetPicture("geotrd1_t.xpm"), kCREATE_TRD1);
257 fShapeButton[2]->SetToolTipText("Create a TRD1 trapezoid");
258 fShapeButton[3] = new TGPictureButton(f1, fClient->GetPicture("geotrd2_t.xpm"), kCREATE_TRD2);
259 fShapeButton[3]->SetToolTipText("Create a TRD2 trapezoid");
260 fShapeButton[4] = new TGPictureButton(f1, fClient->GetPicture("geotrap_t.xpm"), kCREATE_TRAP);
261 fShapeButton[4]->SetToolTipText("Create a general trapezoid");
262 fShapeButton[5] = new TGPictureButton(f1, fClient->GetPicture("geogtra_t.xpm"), kCREATE_GTRA);
263 fShapeButton[5]->SetToolTipText("Create a general twisted trapezoid");
264 for (ipict = 0; ipict < 6; ipict++)
265 f1->AddFrame(fShapeButton[ipict], lhb);
266 container->AddFrame(f1, lhf1);
267 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
268 fShapeButton[6] = new TGPictureButton(f1, fClient->GetPicture("geoxtru_t.xpm"), kCREATE_XTRU);
269 fShapeButton[6]->SetToolTipText("Create a extruded polygone");
270 fShapeButton[7] = new TGPictureButton(f1, fClient->GetPicture("geoarb8_t.xpm"), kCREATE_ARB8);
271 fShapeButton[7]->SetToolTipText("Create an arbitrary trapezoid with 8 vertices");
272 fShapeButton[8] = new TGPictureButton(f1, fClient->GetPicture("geotube_t.xpm"), kCREATE_TUBE);
273 fShapeButton[8]->SetToolTipText("Create a cylindrical pipe");
274 fShapeButton[9] = new TGPictureButton(f1, fClient->GetPicture("geotubeseg_t.xpm"), kCREATE_TUBS);
275 fShapeButton[9]->SetToolTipText("Create a cylindrical pipe within a phi range");
276 fShapeButton[10] = new TGPictureButton(f1, fClient->GetPicture("geocone_t.xpm"), kCREATE_CONE);
277 fShapeButton[10]->SetToolTipText("Create a conical pipe");
278 fShapeButton[11] = new TGPictureButton(f1, fClient->GetPicture("geoconeseg_t.xpm"), kCREATE_CONS);
279 fShapeButton[11]->SetToolTipText("Create a conical pipe within a phi range");
280 for (ipict = 0; ipict < 6; ipict++)
281 f1->AddFrame(fShapeButton[ipict + 6], lhb);
282 container->AddFrame(f1, lhf1);
283 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
284 fShapeButton[12] = new TGPictureButton(f1, fClient->GetPicture("geosphere_t.xpm"), kCREATE_SPHE);
285 fShapeButton[12]->SetToolTipText("Create a spherical sector");
286 fShapeButton[13] = new TGPictureButton(f1, fClient->GetPicture("geoctub_t.xpm"), kCREATE_CTUB);
287 fShapeButton[13]->SetToolTipText("Create a cut tube");
288 fShapeButton[14] = new TGPictureButton(f1, fClient->GetPicture("geoeltu_t.xpm"), kCREATE_ELTU);
289 fShapeButton[14]->SetToolTipText("Create an elliptical tube");
290 fShapeButton[15] = new TGPictureButton(f1, fClient->GetPicture("geotorus_t.xpm"), kCREATE_TORUS);
291 fShapeButton[15]->SetToolTipText("Create a toroidal tube with a phi range");
292 fShapeButton[16] = new TGPictureButton(f1, fClient->GetPicture("geopcon_t.xpm"), kCREATE_PCON);
293 fShapeButton[16]->SetToolTipText("Create a polycone shape");
294 fShapeButton[17] = new TGPictureButton(f1, fClient->GetPicture("geopgon_t.xpm"), kCREATE_PGON);
295 fShapeButton[17]->SetToolTipText("Create a polygon shape");
296 for (ipict = 0; ipict < 6; ipict++)
297 f1->AddFrame(fShapeButton[ipict + 12], lhb);
298 container->AddFrame(f1, lhf1);
299 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
300 fShapeButton[18] = new TGPictureButton(f1, fClient->GetPicture("geohype_t.xpm"), kCREATE_HYPE);
301 fShapeButton[18]->SetToolTipText("Create a hyperboloid");
302 fShapeButton[19] = new TGPictureButton(f1, fClient->GetPicture("geoparab_t.xpm"), kCREATE_PARAB);
303 fShapeButton[19]->SetToolTipText("Create a paraboloid");
304 fShapeButton[20] = new TGPictureButton(f1, fClient->GetPicture("geocomposite_t.xpm"), kCREATE_COMP);
305 fShapeButton[20]->SetToolTipText("Create a composite shape");
306 for (ipict = 0; ipict < 3; ipict++)
307 f1->AddFrame(fShapeButton[ipict + 18], lhb);
308 container->AddFrame(f1, lhf1);
309
310 // List of shapes
311 f2 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
313 f1->AddFrame(label = new TGLabel(f1, "Existing shapes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
314 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
315 gClient->GetColorByName("#ff0000", color);
316 label->SetTextColor(color);
317 f2->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
319 fSelectedShape = nullptr;
320 fLSelShape = new TGLabel(f1, "Select shape");
321 gClient->GetColorByName("#0000ff", color);
322 fLSelShape->SetTextColor(color);
323 fLSelShape->ChangeOptions(kSunkenFrame | kDoubleBorder);
324 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
325 fBSelShape = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_SHAPE_SELECT);
326 fBSelShape->SetToolTipText("Select one of the existing shapes");
327 fBSelShape->Associate(this);
328 f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
329 fEditShape = new TGTextButton(f1, "Edit");
330 f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
331 fEditShape->SetToolTipText("Edit selected shape");
332 fEditShape->Associate(this);
333 f2->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
334 container->AddFrame(f2, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
335
336 // Volumes category
337 si = new TGShutterItem(fCategories, new TGHotString("Volumes"), kCAT_VOLUMES);
338 container = (TGCompositeFrame *)si->GetContainer();
340 fCategories->AddItem(si);
341
342 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
343 f1->AddFrame(label = new TGLabel(f1, "Create new volume"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
344 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
345 gClient->GetColorByName("#ff0000", color);
346 label->SetTextColor(color);
347 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
348
349 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
350 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
352 fVolumeName->Resize(100, fVolumeName->GetDefaultHeight());
353 fVolumeName->SetToolTipText("Enter the name for the new volume");
354 f1->AddFrame(fVolumeName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
355 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
356
357 // ComboBox for shape component
358 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
359 fSelectedShape2 = nullptr;
360 fLSelShape2 = new TGLabel(f1, "Select shape");
361 gClient->GetColorByName("#0000ff", color);
362 fLSelShape2->SetTextColor(color);
363 fLSelShape2->ChangeOptions(kSunkenFrame | kDoubleBorder);
364 f1->AddFrame(fLSelShape2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
365 fBSelShape2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_SHAPE_SELECT2);
366 fBSelShape2->SetToolTipText("Select one of the existing shapes");
367 fBSelShape2->Associate(this);
368 f1->AddFrame(fBSelShape2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
369 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
370
371 // ComboBox for medium component
372 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
373 fSelectedMedium2 = nullptr;
374 fLSelMedium2 = new TGLabel(f1, "Select medium");
375 gClient->GetColorByName("#0000ff", color);
376 fLSelMedium2->SetTextColor(color);
377 fLSelMedium2->ChangeOptions(kSunkenFrame | kDoubleBorder);
378 f1->AddFrame(fLSelMedium2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
379 fBSelMedium2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MEDIUM_SELECT2);
380 fBSelMedium2->SetToolTipText("Select one of the existing media");
381 fBSelMedium2->Associate(this);
382 f1->AddFrame(fBSelMedium2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
383 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
384 // Picture buttons for different volumes
385 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
386 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
387 fVolumeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geovolume_t.xpm"), kCREATE_VOLUME);
388 fVolumeButton[0]->SetToolTipText("Create a new volume from shape and medium");
389 fVolumeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geoassembly_t.xpm"), kCREATE_ASSEMBLY);
390 fVolumeButton[1]->SetToolTipText("Create a new volume assembly having the selected name");
391 for (ipict = 0; ipict < 2; ipict++)
392 f1->AddFrame(fVolumeButton[ipict], lhb);
393 container->AddFrame(f1, lhf1);
394 // List of volumes
395 f3 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
397 f1->AddFrame(label = new TGLabel(f1, "Existing volumes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
398 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
399 gClient->GetColorByName("#ff0000", color);
400 label->SetTextColor(color);
401 f3->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
403 fSelectedVolume = nullptr;
404 fLSelVolume = new TGLabel(f1, "Select volume");
405 gClient->GetColorByName("#0000ff", color);
406 fLSelVolume->SetTextColor(color);
407 fLSelVolume->ChangeOptions(kSunkenFrame | kDoubleBorder);
408 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
409 fBSelVolume = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_VOLUME_SELECT);
410 fBSelVolume->SetToolTipText("Select one of the existing volumes");
411 fBSelVolume->Associate(this);
412 f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
413 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
415 fEditVolume = new TGTextButton(f1, " Edit ");
416 f1->AddFrame(fEditVolume, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 2));
417 fEditVolume->SetToolTipText("Edit selected volume");
418 fEditVolume->Associate(this);
419 fSetTopVolume = new TGTextButton(f1, "Set top");
420 f1->AddFrame(fSetTopVolume, new TGLayoutHints(kLHintsRight, 1, 20, 2, 2));
421 fSetTopVolume->SetToolTipText("Set top volume for geometry");
422 fSetTopVolume->Associate(this);
423 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
424 container->AddFrame(f3, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
425
426 // Materials category
427 si = new TGShutterItem(fCategories, new TGHotString("Materials"), kCAT_MATERIALS);
428 container = (TGCompositeFrame *)si->GetContainer();
430 fCategories->AddItem(si);
431
432 // Material creators
433 gGeoManager->BuildDefaultMaterials();
434 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
435 f1->AddFrame(label = new TGLabel(f1, "Create material/mixt."), new TGLayoutHints(kLHintsLeft, 2, 1, 0, 0));
436 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
437 gClient->GetColorByName("#ff0000", color);
438 label->SetTextColor(color);
439 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
440 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
441 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
443 fMaterialName->Resize(100, fMaterialName->GetDefaultHeight());
444 fMaterialName->SetToolTipText("Enter the new material name");
445 f1->AddFrame(fMaterialName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
446 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
447
448 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
449 f1->AddFrame(new TGLabel(f1, "Element"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
451 fElementList->Resize(100, fManagerName->GetDefaultHeight());
452 TGeoElementTable *table = gGeoManager->GetElementTable();
453 if (table) {
454 TGeoElement *element;
455 for (Int_t i = 0; i < table->GetNelements(); i++) {
456 element = table->GetElement(i);
457 fElementList->AddEntry(element->GetTitle(), i);
458 }
459 }
460 fElementList->Select(0);
461 f1->AddFrame(fElementList, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
462 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
463 // Number entry for density
464 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
465 f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
469 fEntryDensity->Resize(100, fEntryDensity->GetDefaultHeight());
470 TGTextEntry *nef = (TGTextEntry *)fEntryDensity->GetNumberEntry();
471 nef->SetToolTipText("Enter material/mixture density");
472 fEntryDensity->SetNumber(0);
473 fEntryDensity->Associate(this);
474 f1->AddFrame(fEntryDensity, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
475 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
476 // Buttons for creating materials/mixtures
477 // Picture buttons for different volumes
478 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
479 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
480 fMaterialButton[0] = new TGPictureButton(f1, fClient->GetPicture("geomaterial_t.xpm"), kCREATE_MATERIAL);
481 fMaterialButton[0]->SetToolTipText("Create a new material from element and density");
482 fMaterialButton[1] = new TGPictureButton(f1, fClient->GetPicture("geomixture_t.xpm"), kCREATE_MIXTURE);
483 fMaterialButton[1]->SetToolTipText("Create a new mixture with selected density");
484 for (ipict = 0; ipict < 2; ipict++)
485 f1->AddFrame(fMaterialButton[ipict], lhb);
486 container->AddFrame(f1, lhf1);
487
488 // List of materials
489 f4 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
491 f1->AddFrame(label = new TGLabel(f1, "Existing materials"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
492 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
493 gClient->GetColorByName("#ff0000", color);
494 label->SetTextColor(color);
495 f4->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
497 fSelectedMaterial = nullptr;
498 fLSelMaterial = new TGLabel(f1, "Select material");
499 gClient->GetColorByName("#0000ff", color);
500 fLSelMaterial->SetTextColor(color);
501 fLSelMaterial->ChangeOptions(kSunkenFrame | kDoubleBorder);
503 fBSelMaterial = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATERIAL_SELECT);
504 fBSelMaterial->SetToolTipText("Select one of the existing materials");
505 fBSelMaterial->Associate(this);
506 f1->AddFrame(fBSelMaterial, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
507 fEditMaterial = new TGTextButton(f1, "Edit");
508 f1->AddFrame(fEditMaterial, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
509 fEditMaterial->SetToolTipText("Edit selected material");
510 fEditMaterial->Associate(this);
511 f4->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
512 container->AddFrame(f4, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
513
514 si = new TGShutterItem(fCategories, new TGHotString("Media"), kCAT_MEDIA);
515 container = (TGCompositeFrame *)si->GetContainer();
517 fCategories->AddItem(si);
518
519 // Media category
520 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
521 f1->AddFrame(label = new TGLabel(f1, "Create new medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
522 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
523 gClient->GetColorByName("#ff0000", color);
524 label->SetTextColor(color);
525 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
526
527 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
528 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
530 fMediumName->Resize(60, fMediumName->GetDefaultHeight());
531 fMediumName->SetToolTipText("Enter the new medium name");
532 f1->AddFrame(fMediumName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
533
534 fMediumId = new TGNumberEntry(f1, 0., 5, kMEDIUM_ID);
537 fMediumId->Resize(35, fMediumId->GetDefaultHeight());
538 nef = (TGTextEntry *)fMediumId->GetNumberEntry();
539 nef->SetToolTipText("Enter medium ID");
540 fMediumId->SetNumber(fGeometry->GetListOfMedia()->GetSize());
541 fMediumId->Associate(this);
542 f1->AddFrame(fMediumId, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
543 f1->AddFrame(new TGLabel(f1, "ID"), new TGLayoutHints(kLHintsRight, 1, 1, 6, 0));
544 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
545 // ComboBox for materials
546 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
547 fSelectedMaterial2 = nullptr;
548 fLSelMaterial2 = new TGLabel(f1, "Select material");
549 gClient->GetColorByName("#0000ff", color);
550 fLSelMaterial2->SetTextColor(color);
551 fLSelMaterial2->ChangeOptions(kSunkenFrame | kDoubleBorder);
553 fBSelMaterial2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATERIAL_SELECT2);
554 fBSelMaterial2->SetToolTipText("Select one of the existing materials");
555 fBSelMaterial2->Associate(this);
556 f1->AddFrame(fBSelMaterial2, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
557 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
558 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
559 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
560 fMediumButton = new TGPictureButton(f1, fClient->GetPicture("geomedium_t.xpm"), kCREATE_MEDIUM);
561 fMediumButton->SetToolTipText("Create a new medium from selected material");
562 fMediumButton->Associate(this);
563 f1->AddFrame(fMediumButton, new TGLayoutHints(kLHintsLeft, 5, 2, 2, 2));
564 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
565
566 // List of media
567 f5 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
569 f1->AddFrame(label = new TGLabel(f1, "Existing media"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
570 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
571 gClient->GetColorByName("#ff0000", color);
572 label->SetTextColor(color);
573 f5->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
575 fSelectedMedium = nullptr;
576 fLSelMedium = new TGLabel(f1, "Select medium");
577 gClient->GetColorByName("#0000ff", color);
578 fLSelMedium->SetTextColor(color);
579 fLSelMedium->ChangeOptions(kSunkenFrame | kDoubleBorder);
580 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
581 fBSelMedium = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MEDIA_SELECT);
582 fBSelMedium->SetToolTipText("Select one of the existing media");
583 fBSelMedium->Associate(this);
584 f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
585 fEditMedium = new TGTextButton(f1, "Edit");
586 f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
587 fEditMedium->SetToolTipText("Edit selected medium");
588 fEditMedium->Associate(this);
589 f5->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
590 container->AddFrame(f5, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
591
592 // Matrix category
593 si = new TGShutterItem(fCategories, new TGHotString("Matrices"), kCAT_MATRICES);
594 container = (TGCompositeFrame *)si->GetContainer();
596 fCategories->AddItem(si);
597 // Name entry
598 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
599 f1->AddFrame(label = new TGLabel(f1, "Create new matrix"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
600 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
601 gClient->GetColorByName("#ff0000", color);
602 label->SetTextColor(color);
603 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
604
605 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
606 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
608 fMatrixName->Resize(100, fMatrixName->GetDefaultHeight());
609 fMatrixName->SetToolTipText("Enter the new matrix name");
610 f1->AddFrame(fMatrixName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
611 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
612 // Picture buttons for different matrices
613 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
614 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
615 fMatrixButton[0] = new TGPictureButton(f1, fClient->GetPicture("geotranslation_t.xpm"), kCREATE_TRANSLATION);
616 fMatrixButton[0]->SetToolTipText("Create a translation");
617 fMatrixButton[1] = new TGPictureButton(f1, fClient->GetPicture("georotation_t.xpm"), kCREATE_ROTATION);
618 fMatrixButton[1]->SetToolTipText("Create a rotation");
619 fMatrixButton[2] = new TGPictureButton(f1, fClient->GetPicture("geocombi_t.xpm"), kCREATE_COMBI);
620 fMatrixButton[2]->SetToolTipText("Create a rotation + translation");
621 for (ipict = 0; ipict < 3; ipict++)
622 f1->AddFrame(fMatrixButton[ipict], lhb);
623 container->AddFrame(f1, lhf1);
624 // List of matrices
625 f6 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
627 f1->AddFrame(label = new TGLabel(f1, "Existing matrices"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
628 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
629 gClient->GetColorByName("#ff0000", color);
630 label->SetTextColor(color);
631 f6->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
633 fSelectedMatrix = nullptr;
634 fLSelMatrix = new TGLabel(f1, "Select matrix");
635 gClient->GetColorByName("#0000ff", color);
636 fLSelMatrix->SetTextColor(color);
637 fLSelMatrix->ChangeOptions(kSunkenFrame | kDoubleBorder);
638 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
639 fBSelMatrix = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATRIX_SELECT);
640 fBSelMatrix->SetToolTipText("Select one of the existing matrices");
641 fBSelMatrix->Associate(this);
642 f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
643 fEditMatrix = new TGTextButton(f1, "Edit");
644 f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
645 fEditMatrix->SetToolTipText("Edit selected matrix");
646 fEditMatrix->Associate(this);
647 f6->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
648 container->AddFrame(f6, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
649
650 fCategories->Resize(163, 370);
652
654
655 // Set the fTab and disconnect editor from the canvas.
656 fTab = fGedEditor->GetTab();
657 TCanvas *edCanvas = fGedEditor->GetCanvas();
658 fGedEditor->DisconnectFromCanvas();
659 if (edCanvas != fConnectedCanvas) {
661 if (edCanvas)
662 ConnectSelected(edCanvas);
663 fConnectedCanvas = edCanvas;
664 }
665}
666
667////////////////////////////////////////////////////////////////////////////////
668/// Destructor.
669
671{
672 TGCompositeFrame *cont;
673 cont = (TGCompositeFrame *)fCategories->GetItem("General")->GetContainer();
675 fCategories->GetItem("General")->SetCleanup(0);
676 cont = (TGCompositeFrame *)fCategories->GetItem("Shapes")->GetContainer();
678 fCategories->GetItem("Shapes")->SetCleanup(0);
679 cont = (TGCompositeFrame *)fCategories->GetItem("Volumes")->GetContainer();
681 fCategories->GetItem("Volumes")->SetCleanup(0);
682 cont = (TGCompositeFrame *)fCategories->GetItem("Materials")->GetContainer();
684 fCategories->GetItem("Materials")->SetCleanup(0);
685 cont = (TGCompositeFrame *)fCategories->GetItem("Media")->GetContainer();
687 fCategories->GetItem("Media")->SetCleanup(0);
688 cont = (TGCompositeFrame *)fCategories->GetItem("Matrices")->GetContainer();
690 fCategories->GetItem("Matrices")->SetCleanup(0);
691
692 delete fExportOption[0];
693 delete fExportOption[1];
694
695 Cleanup();
696
697 if (fTabMgr) {
698 fTabMgr->GetVolumeTab()->Cleanup();
699 delete fTabMgr;
700 }
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Connected to TCanvas::Selected. TGeoManagerEditor takes this
705/// function from TGedEditor and only uses it if obj is a TGeoVolume.
706
708{
709 if (event == kButton1 && obj->InheritsFrom(TGeoVolume::Class())) {
710 TGeoVolume *v = (TGeoVolume *)obj;
711 fTabMgr->SetVolTabEnabled();
712 fTabMgr->SetTab();
713 fTabMgr->GetVolumeEditor(v);
714 v->Draw();
715 }
716}
717
719{
720 // Connect to TCanvas::Selected.
721
722 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGeoManagerEditor", this,
723 "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
724}
725
727{
728 // Disconnect from TCanvas::Selected.
729
731 Disconnect(fConnectedCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this,
732 "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// Connect signals to slots.
737
739{
740 fManagerName->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
741 fManagerTitle->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
742 fExportButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoExportGeometry()");
743 fCloseGeometry->Connect("Clicked()", "TGeoManagerEditor", this, "DoCloseGeometry()");
744 fShapeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateBox()");
745 fShapeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePara()");
746 fShapeButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd1()");
747 fShapeButton[3]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd2()");
748 fShapeButton[4]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrap()");
749 fShapeButton[5]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateGtra()");
750 fShapeButton[6]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateXtru()");
751 fShapeButton[7]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateArb8()");
752 fShapeButton[8]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTube()");
753 fShapeButton[9]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTubs()");
754 fShapeButton[10]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCone()");
755 fShapeButton[11]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCons()");
756 fShapeButton[12]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateSphe()");
757 fShapeButton[13]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCtub()");
758 fShapeButton[14]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateEltu()");
759 fShapeButton[15]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTorus()");
760 fShapeButton[16]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePcon()");
761 fShapeButton[17]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePgon()");
762 fShapeButton[18]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateHype()");
763 fShapeButton[19]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateParab()");
764 fShapeButton[20]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateComposite()");
765 fMatrixButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTranslation()");
766 fMatrixButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateRotation()");
767 fMatrixButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCombi()");
768 fVolumeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateVolume()");
769 fVolumeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateAssembly()");
770 fBSelTop->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectTopVolume()");
771 fBSelVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectVolume()");
772 fBSelShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape()");
773 fBSelShape2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape2()");
774 fBSelMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMatrix()");
775 fBSelMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial()");
776 fBSelMaterial2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial2()");
777 fBSelMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium()");
778 fBSelMedium2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium2()");
779 fSetTopVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSetTopVolume()");
780 fEditShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditShape()");
781 fEditMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMedium()");
782 fEditMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMaterial()");
783 fEditMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMatrix()");
784 fEditVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditVolume()");
785
786 fMaterialButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMaterial()");
787 fMaterialButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMixture()");
788 fMediumButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMedium()");
789}
790
791////////////////////////////////////////////////////////////////////////////////
792/// Refresh editor according the selected obj.
793
795{
796 fGeometry = (TGeoManager *)obj;
797 fManagerName->SetText(fGeometry->GetName());
798 fManagerTitle->SetText(fGeometry->GetTitle());
799 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
800 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
801 fMediumName->SetText(TString::Format("medium%i", fGeometry->GetListOfMedia()->GetSize()));
802 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
803 // Check if master volume can be set
804 if (fGeometry->GetMasterVolume())
805 fSetTopVolume->SetEnabled(kFALSE);
806 else
807 fSetTopVolume->SetEnabled(kTRUE);
808 // Check if geometry is already closed
809 if (!fGeometry->IsClosed())
810 fCloseGeometry->SetEnabled(kTRUE);
811 else {
812 fCloseGeometry->SetEnabled(kFALSE);
813 fBSelTop->SetEnabled(kFALSE);
814 }
815 // Check if volumes category can be activated
816 if (!fGeometry->GetListOfShapes()->GetEntries() || !fGeometry->GetListOfMedia()->GetSize())
817 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kFALSE);
818 else
819 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
820 if (!fGeometry->GetListOfShapes()->GetEntries())
822 else
824 if (!fGeometry->GetListOfVolumes()->GetEntries())
826 else
828 if (!fGeometry->GetListOfMedia()->GetSize())
830 else
832 if (!fGeometry->GetListOfMatrices()->GetEntries())
834 else
836
837 // Check if media category can be activated
838 if (!fGeometry->GetListOfMaterials()->GetSize()) {
839 fCategories->GetItem("Media")->GetButton()->SetEnabled(kFALSE);
841 } else {
842 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
844 }
845
846 fTab->SetTab(0);
847 fCategories->Layout();
848 if (fTabMgr == nullptr) {
850 fTabMgr->fVolumeTab = fVolumeTab;
851 }
852 if (fInit)
854 // SetActive();
855}
856
857////////////////////////////////////////////////////////////////////////////////
858/// Change name/title of the geometry
859
861{
862 fGeometry->SetName(fManagerName->GetText());
863 fGeometry->SetTitle(fManagerTitle->GetText());
864}
865
866////////////////////////////////////////////////////////////////////////////////
867/// Export geometry as .root or .C file
868
870{
871 Bool_t asroot = fExportOption[0]->IsDown();
872 TString s = fGeometry->GetName();
873 s = s.Strip();
874 s.Remove(20);
875 const char *name;
876 if (asroot)
877 name = TString::Format("%s.root", s.Data());
878 else
879 name = TString::Format("%s.C", s.Data());
880 fGeometry->Export(name);
881}
882
883////////////////////////////////////////////////////////////////////////////////
884/// Create a box.
885
887{
888 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
889 fSelectedShape = new TGeoBBox(TString::Format("box_%i", id), 1., 1., 1.);
891 // Check if volumes category can be activated
892 if (fGeometry->GetListOfMedia()->GetSize())
893 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
894 DoEditShape();
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// Create a parallelipiped.
899
901{
902 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
903 fSelectedShape = new TGeoPara(TString::Format("para_%i", id), 1., 1., 1., 30., 20., 45.);
905 if (fGeometry->GetListOfMedia()->GetSize())
906 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
907 DoEditShape();
908}
909
910////////////////////////////////////////////////////////////////////////////////
911/// Create a Trd1.
912
914{
915 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
916 fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i", id), 0.5, 1., 1., 1.);
918 if (fGeometry->GetListOfMedia()->GetSize())
919 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
920 DoEditShape();
921}
922
923////////////////////////////////////////////////////////////////////////////////
924/// Create a Trd2.
925
927{
928 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
929 fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i", id), 0.5, 1., 0.5, 1., 1.);
931 if (fGeometry->GetListOfMedia()->GetSize())
932 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
933 DoEditShape();
934}
935
936////////////////////////////////////////////////////////////////////////////////
937/// Create a general trapezoid.
938
940{
941 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
942 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.);
944 if (fGeometry->GetListOfMedia()->GetSize())
945 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
946 DoEditShape();
947}
948
949////////////////////////////////////////////////////////////////////////////////
950/// Create a twisted trapezoid.
951
953{
954 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
956 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.);
958 if (fGeometry->GetListOfMedia()->GetSize())
959 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
960 DoEditShape();
961}
962
963////////////////////////////////////////////////////////////////////////////////
964/// Create an extruded polygone.
965
967
968////////////////////////////////////////////////////////////////////////////////
969/// Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel
970/// planes
971
973
974////////////////////////////////////////////////////////////////////////////////
975/// Create a tube.
976
978{
979 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
980 fSelectedShape = new TGeoTube(TString::Format("tube_%i", id), 0.5, 1., 1.);
982 if (fGeometry->GetListOfMedia()->GetSize())
983 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
984 DoEditShape();
985}
986
987////////////////////////////////////////////////////////////////////////////////
988/// Create a tube segment.
989
991{
992 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
993 fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i", id), 0.5, 1., 1., 0., 45.);
995 if (fGeometry->GetListOfMedia()->GetSize())
996 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
997 DoEditShape();
998}
999
1000////////////////////////////////////////////////////////////////////////////////
1001/// Create a cone.
1002
1004{
1005 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1006 fSelectedShape = new TGeoCone(TString::Format("cone_%i", id), 0.5, 0.5, 1., 1.5, 2.);
1008 if (fGeometry->GetListOfMedia()->GetSize())
1009 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1010 DoEditShape();
1011}
1012
1013////////////////////////////////////////////////////////////////////////////////
1014/// Create a cone segment.
1015
1017{
1018 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1019 fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i", id), 0.5, 0.5, 1., 1.5, 2., 0., 45.);
1021 if (fGeometry->GetListOfMedia()->GetSize())
1022 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1023 DoEditShape();
1024}
1025
1026////////////////////////////////////////////////////////////////////////////////
1027/// Create a sphere.
1028
1030{
1031 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1032 fSelectedShape = new TGeoSphere(TString::Format("sphere_%i", id), 0.5, 1., 0., 180., 0., 360.);
1034 if (fGeometry->GetListOfMedia()->GetSize())
1035 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1036 DoEditShape();
1037}
1038
1039////////////////////////////////////////////////////////////////////////////////
1040/// Create a cut tube.
1041
1043{
1044 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1045 fSelectedShape = new TGeoCtub(TString::Format("ctub_%i", id), 0.5, 1., 1., 0., 45., 0., 0., -1, 0., 0., 1);
1047 if (fGeometry->GetListOfMedia()->GetSize())
1048 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1049 DoEditShape();
1050}
1051
1052////////////////////////////////////////////////////////////////////////////////
1053/// Create an elliptical tube.
1054
1056{
1057 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1058 fSelectedShape = new TGeoEltu(TString::Format("para_%i", id), 1., 2., 1.5);
1060 if (fGeometry->GetListOfMedia()->GetSize())
1061 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1062 DoEditShape();
1063}
1064
1065////////////////////////////////////////////////////////////////////////////////
1066/// Create a torus shape.
1067
1069{
1070 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1071 fSelectedShape = new TGeoTorus(TString::Format("torus_%i", id), 10., 1., 1.5, 0, 360.);
1073 if (fGeometry->GetListOfMedia()->GetSize())
1074 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1075 DoEditShape();
1076}
1077
1078////////////////////////////////////////////////////////////////////////////////
1079/// Create a polycone shape.
1080
1082{
1083 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1084 fSelectedShape = new TGeoPcon(TString::Format("pcon_%i", id), 0., 360., 2);
1085 ((TGeoPcon *)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1086 ((TGeoPcon *)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1088 if (fGeometry->GetListOfMedia()->GetSize())
1089 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1090 DoEditShape();
1091}
1092
1093////////////////////////////////////////////////////////////////////////////////
1094/// Create a polygone shape.
1095
1097{
1098 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1099 fSelectedShape = new TGeoPgon(TString::Format("pgon_%i", id), 0., 360., 6, 2);
1100 ((TGeoPcon *)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1101 ((TGeoPcon *)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1103 if (fGeometry->GetListOfMedia()->GetSize())
1104 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1105 DoEditShape();
1106}
1107
1108////////////////////////////////////////////////////////////////////////////////
1109/// Create a hyperboloid.
1110
1112{
1113 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1114 fSelectedShape = new TGeoHype(TString::Format("hype_%i", id), 1., 15., 2., 30., 5.);
1116 if (fGeometry->GetListOfMedia()->GetSize())
1117 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1118 DoEditShape();
1119}
1120
1121////////////////////////////////////////////////////////////////////////////////
1122/// Create a paraboloid.
1123
1125
1126////////////////////////////////////////////////////////////////////////////////
1127/// Create a composite shape.
1128
1130
1131////////////////////////////////////////////////////////////////////////////////
1132/// Create a new material.
1133
1135{
1136 TGeoElement *el = fGeometry->GetElementTable()->GetElement(fElementList->GetSelected());
1137 if (!el) {
1138 Error("DoCreateMaterial", "Cannot find selected element in list");
1139 return;
1140 }
1141 Double_t density = fEntryDensity->GetNumber();
1142 const char *name = fMaterialName->GetText();
1143 fSelectedMaterial = new TGeoMaterial(name, el, density);
1145 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1147 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
1148}
1149
1150////////////////////////////////////////////////////////////////////////////////
1151/// Create a new mixture.
1152
1154{
1155 Double_t density = fEntryDensity->GetNumber();
1156 const char *name = fMaterialName->GetText();
1157 fSelectedMaterial = new TGeoMixture(name, 1, density);
1159 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1161 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
1162}
1163
1164////////////////////////////////////////////////////////////////////////////////
1165/// Create a new medium.
1166
1168{
1169 Int_t id = fMediumId->GetIntNumber();
1170 if (!fSelectedMaterial2)
1171 return;
1172 const char *name = fMediumName->GetText();
1175 if (fGeometry->GetListOfShapes()->GetEntries())
1176 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1177 DoEditMedium();
1178 fMediumName->SetText(TString::Format("medium%i", fGeometry->GetListOfMedia()->GetSize()));
1179}
1180
1181////////////////////////////////////////////////////////////////////////////////
1182/// Create a new translation.
1183
1185{
1186 const char *name = fMatrixName->GetText();
1187 fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1189 fSelectedMatrix->RegisterYourself();
1191 DoEditMatrix();
1192 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1193}
1194
1195////////////////////////////////////////////////////////////////////////////////
1196/// Create a new rotation.
1197
1199{
1200 const char *name = fMatrixName->GetText();
1203 fSelectedMatrix->RegisterYourself();
1205 DoEditMatrix();
1206 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1207}
1208
1209////////////////////////////////////////////////////////////////////////////////
1210/// Create a new volume.
1211
1213{
1214 const char *name = fVolumeName->GetText();
1216 return;
1218 fLSelVolume->SetText(name);
1220 DoEditVolume();
1221 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
1222}
1223
1224////////////////////////////////////////////////////////////////////////////////
1225/// Create a new volume assembly.
1226
1228{
1229 const char *name = fVolumeName->GetText();
1231 fLSelVolume->SetText(name);
1233 DoEditVolume();
1234 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
1235}
1236
1237////////////////////////////////////////////////////////////////////////////////
1238/// Create a new translation + rotation.
1239
1241{
1242 const char *name = fMatrixName->GetText();
1243 fSelectedMatrix = new TGeoCombiTrans(name, 0., 0., 0., new TGeoRotation());
1244 fSelectedMatrix->RegisterYourself();
1248 DoEditMatrix();
1249 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1250}
1251
1252////////////////////////////////////////////////////////////////////////////////
1253/// Set top volume for the geometry.
1254
1256{
1257 if (!fSelectedVolume)
1258 return;
1259 fGeometry->SetTopVolume(fSelectedVolume);
1260 fSetTopVolume->SetEnabled(kFALSE);
1261}
1262
1263////////////////////////////////////////////////////////////////////////////////
1264/// Slot for editing selected shape.
1265
1267{
1268 if (!fSelectedShape)
1269 return;
1270 fTabMgr->GetShapeEditor(fSelectedShape);
1271 fSelectedShape->Draw();
1272 fTabMgr->GetPad()->GetView()->ShowAxis();
1273}
1274
1275////////////////////////////////////////////////////////////////////////////////
1276/// Slot for editing selected volume.
1277
1279{
1280 if (!fSelectedVolume) {
1281 fTabMgr->SetVolTabEnabled(kFALSE);
1282 return;
1283 }
1284 fTabMgr->SetVolTabEnabled();
1285 fTabMgr->SetTab();
1286 fTabMgr->GetVolumeEditor(fSelectedVolume);
1287 fSelectedVolume->Draw();
1288}
1289
1290////////////////////////////////////////////////////////////////////////////////
1291/// Slot for editing selected medium.
1292
1294{
1295 if (!fSelectedMedium)
1296 return;
1297 fTabMgr->GetMediumEditor(fSelectedMedium);
1298}
1299
1300////////////////////////////////////////////////////////////////////////////////
1301/// Slot for editing selected material.
1302
1304{
1305 if (!fSelectedMaterial)
1306 return;
1307 fTabMgr->GetMaterialEditor(fSelectedMaterial);
1308}
1309
1310////////////////////////////////////////////////////////////////////////////////
1311/// Slot for editing selected matrix.
1312
1314{
1315 if (!fSelectedMatrix)
1316 return;
1317 fTabMgr->GetMatrixEditor(fSelectedMatrix);
1318}
1319
1320////////////////////////////////////////////////////////////////////////////////
1321/// Slot for selecting an existing matrix.
1322
1324{
1325 TGeoMatrix *matrix = fSelectedMatrix;
1326 new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200, 300);
1328 if (fSelectedMatrix)
1329 fLSelMatrix->SetText(fSelectedMatrix->GetName());
1330 else
1331 fSelectedMatrix = matrix;
1332}
1333
1334////////////////////////////////////////////////////////////////////////////////
1335/// Slot for selecting an existing shape.
1336
1338{
1339 TGeoShape *shape = fSelectedShape;
1340 new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200, 300);
1342 if (fSelectedShape)
1343 fLSelShape->SetText(fSelectedShape->GetName());
1344 else
1345 fSelectedShape = shape;
1346}
1347
1348////////////////////////////////////////////////////////////////////////////////
1349/// Slot for selecting a shape for making a volume.
1350
1352{
1353 TGeoShape *shape = fSelectedShape2;
1354 new TGeoShapeDialog(fBSelShape2, gClient->GetRoot(), 200, 300);
1356 if (fSelectedShape2)
1357 fLSelShape2->SetText(fSelectedShape2->GetName());
1358 else
1359 fSelectedShape2 = shape;
1360}
1361
1362////////////////////////////////////////////////////////////////////////////////
1363/// Slot for selecting an existing material.
1364
1375
1376////////////////////////////////////////////////////////////////////////////////
1377/// Slot for selecting an existing material and making a medium.
1378
1389
1390////////////////////////////////////////////////////////////////////////////////
1391/// Slot for selecting an existing medium.
1392
1394{
1396 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200, 300);
1398 if (fSelectedMedium)
1399 fLSelMedium->SetText(fSelectedMedium->GetName());
1400 else
1401 fSelectedMedium = med;
1402}
1403
1404////////////////////////////////////////////////////////////////////////////////
1405/// Slot for selecting an existing medium for making a volume.
1406
1408{
1410 new TGeoMediumDialog(fBSelMedium2, gClient->GetRoot(), 200, 300);
1412 if (fSelectedMedium2)
1413 fLSelMedium2->SetText(fSelectedMedium2->GetName());
1414 else
1415 fSelectedMedium2 = med;
1416}
1417
1418////////////////////////////////////////////////////////////////////////////////
1419/// Slot for selecting an existing volume.
1420
1422{
1424 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200, 300);
1426 if (fSelectedVolume)
1427 fLSelVolume->SetText(fSelectedVolume->GetName());
1428 else
1429 fSelectedVolume = vol;
1430}
1431
1432////////////////////////////////////////////////////////////////////////////////
1433/// Slot for setting top geometry volume.
1434
1436{
1437 TGeoVolume *vol = fGeometry->GetTopVolume();
1438 new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200, 300);
1440 if (fSelectedVolume)
1441 fLSelTop->SetText(fSelectedVolume->GetName());
1442 else
1443 fSelectedVolume = vol;
1444 if (fSelectedVolume && (fSelectedVolume != vol))
1445 fGeometry->SetTopVolume(fSelectedVolume);
1446}
1447
1448////////////////////////////////////////////////////////////////////////////////
1449/// Slot for closing the geometry.
1450
1452{
1453 if (!fGeometry->IsClosed())
1454 fGeometry->CloseGeometry();
1455 fCloseGeometry->SetEnabled(kFALSE);
1456}
1457
1458////////////////////////////////////////////////////////////////////////////////
1459/// Show/hide interface for shape selection.
1460
1462{
1463 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Shapes")->GetContainer();
1464 if (show)
1465 cont->ShowFrame(f2);
1466 else
1467 cont->HideFrame(f2);
1468}
1469
1470////////////////////////////////////////////////////////////////////////////////
1471/// Show/hide interface for volume selection.
1472
1474{
1475 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("General")->GetContainer();
1476 if (show)
1477 cont->ShowFrame(f7);
1478 else
1479 cont->HideFrame(f7);
1480 cont = (TGCompositeFrame *)fCategories->GetItem("Volumes")->GetContainer();
1481 if (show)
1482 cont->ShowFrame(f3);
1483 else
1484 cont->HideFrame(f3);
1485}
1486
1487////////////////////////////////////////////////////////////////////////////////
1488/// Show/hide interface for material selection.
1489
1491{
1492 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Materials")->GetContainer();
1493 if (show)
1494 cont->ShowFrame(f4);
1495 else
1496 cont->HideFrame(f4);
1497}
1498
1499////////////////////////////////////////////////////////////////////////////////
1500/// Show/hide interface for medium selection.
1501
1503{
1504 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Media")->GetContainer();
1505 if (show)
1506 cont->ShowFrame(f5);
1507 else
1508 cont->HideFrame(f5);
1509}
1510
1511////////////////////////////////////////////////////////////////////////////////
1512/// Show/hide interface for matrix selection.
1513
1515{
1516 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Matrices")->GetContainer();
1517 if (show)
1518 cont->ShowFrame(f6);
1519 else
1520 cont->HideFrame(f6);
1521}
1522
1523////////////////////////////////////////////////////////////////////////////////
1524/// Dummy static function, used to load plugin
1525
@ kSunkenFrame
Definition GuiTypes.h:384
@ kVerticalFrame
Definition GuiTypes.h:382
@ kDoubleBorder
Definition GuiTypes.h:386
@ kFixedWidth
Definition GuiTypes.h:388
@ kFitWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:383
@ kFixedHeight
Definition GuiTypes.h:390
@ kOwnBackground
Definition GuiTypes.h:392
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
@ kButton1
Definition GuiTypes.h:215
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define gClient
Definition TGClient.h:157
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
char name[80]
Definition TGX11.cxx:148
@ 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
@ 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
@ kCAT_MATRICES
@ kMANAGER_TOP_SELECT
@ kCREATE_BOX
@ kMANAGER_EDIT_SHAPE
@ kMANAGER_SHAPE_SELECT
@ kCREATE_MATERIAL
@ kCREATE_PARA
@ kCAT_GENERAL
@ kMANAGER_UNDO
@ kCREATE_TRD2
@ kCREATE_MIXTURE
externTGeoManager * gGeoManager
The Canvas class.
Definition TCanvas.h:23
Organizes TGButton widgets in a group.
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...
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1196
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:304
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
This class handles GUI labels.
Definition TGLabel.h:24
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition TGLabel.cxx:361
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
@ kNEAPositive
Positive number.
@ kNEANonNegative
Non-negative number.
@ kNESRealThree
Fixed fraction real, three digit.
@ kNESInteger
Style of number entry field.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Yield an action as soon as it is clicked.
Definition TGButton.h:228
Selects different options.
Definition TGButton.h:321
TGFrame * GetContainer() const
Definition TGShutter.h:45
A shutter widget contains a set of shutter items that can be open and closed like a shutter.
Definition TGShutter.h:55
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Organizes TGButton widgets in a group with one vertical column.
ROOT GUI Window base class.
Definition TGWindow.h:23
TGedEditor * fGedEditor
manager of this frame
Definition TGedFrame.h:48
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
TGedFrame(const TGedFrame &)=delete
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
Class describing rotation + translation.
Definition TGeoMatrix.h:318
table of elements
TGeoElement * GetElement(Int_t z)
Int_t GetNelements() const
Base class for chemical elements.
Definition TGeoElement.h:31
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.
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.
void SetModel(TObject *obj) override
Refresh editor according the selected obj.
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
~TGeoManagerEditor() override
Destructor.
void ShowSelectMedium(Bool_t show=kTRUE)
Show/hide interface for medium selection.
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.
static void LoadLib()
Dummy static function, used to load plugin.
TGPictureButton * fMaterialButton[2]
TGNumberEntry * fEntryDensity
void DoEditShape()
Slot for editing selected shape.
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.
TGeoManagerEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for manager editor.
The manager class for any TGeo geometry.
Definition TGeoManager.h:46
Base class describing materials.
Geometrical transformation package.
Definition TGeoMatrix.h:39
@ kGeoTranslation
Definition TGeoMatrix.h:44
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
Mixtures of elements.
Class describing rotations.
Definition TGeoMatrix.h:169
Base abstract class for all shapes.
Definition TGeoShape.h:25
static TGeoTabManager * GetMakeTabManager(TGedEditor *ged)
Static method to return the tab manager currently appended to the pad or create one if not existing.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
Class describing translations.
Definition TGeoMatrix.h:117
static TObject * GetSelected()
static; return selected object
Volume assemblies.
Definition TGeoVolume.h:317
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
static TClass * Class()
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
Mother of all ROOT objects.
Definition TObject.h:42
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:549
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
Basic string class.
Definition TString.h:138
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition TString.cxx:1170
const char * Data() const
Definition TString.h:384
TString & Remove(Ssiz_t pos)
Definition TString.h:694
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:2385
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
TF1 * f1
Definition legend1.C:11