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
87
153
154////////////////////////////////////////////////////////////////////////////////
155/// Constructor for manager editor.
156
158 : TGedFrame(p, width, height, options | kVerticalFrame, back)
159{
161 fTabMgr = nullptr;
162 fTab = nullptr;
163 fConnectedCanvas = nullptr;
164
167 TGLabel *label;
168
169 // TGShutter for categories
171
172 TGCompositeFrame *container;
173 Pixel_t color;
174 // General settings
176 container = (TGCompositeFrame *)si->GetContainer();
178 fCategories->AddItem(si);
179 // TextEntry for manager name
180 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
181 f1->AddFrame(label = new TGLabel(f1, "Name/Title"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
182 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
183 gClient->GetColorByName("#ff0000", color);
184 label->SetTextColor(color);
185 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
186 fManagerName = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_NAME);
188 fManagerName->SetToolTipText("Enter the geometry name");
189 container->AddFrame(fManagerName, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
190 fManagerTitle = new TGTextEntry(container, new TGTextBuffer(50), kMANAGER_TITLE);
192 fManagerTitle->SetToolTipText("Enter the geometry name");
193 container->AddFrame(fManagerTitle, new TGLayoutHints(kLHintsLeft, 3, 1, 0, 0));
194 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
195 f1->AddFrame(label = new TGLabel(f1, "Export geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
196 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
197 gClient->GetColorByName("#ff0000", color);
198 label->SetTextColor(color);
199 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 6, 0));
200 TString stitle = "Options";
201 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
202 TGButtonGroup *bg = new TGVButtonGroup(f1, stitle);
203 fExportOption[0] = new TGRadioButton(bg, ".root", kEXPORT_ROOT);
204 fExportOption[1] = new TGRadioButton(bg, ".C", kEXPORT_C);
208 bg->Show();
209 f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
210 f1->AddFrame(fExportButton, new TGLayoutHints(kLHintsLeft, 20, 2, 22, 0));
211 container->AddFrame(f1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
212 // Close geometry
213 f7 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
215 f1->AddFrame(label = new TGLabel(f1, "Close geometry"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
216 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
217 gClient->GetColorByName("#ff0000", color);
218 label->SetTextColor(color);
219 f7->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
221 fLSelTop = new TGLabel(f1, "Select top");
222 gClient->GetColorByName("#0000ff", color);
223 fLSelTop->SetTextColor(color);
225 f1->AddFrame(fLSelTop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
227 fBSelTop->SetToolTipText("Select the top volume");
228 fBSelTop->Associate(this);
229 f1->AddFrame(fBSelTop, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
230 fCloseGeometry = new TGTextButton(f1, "Close");
231 f1->AddFrame(fCloseGeometry, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
232 fCloseGeometry->SetToolTipText("Close geometry to make it ready for tracking");
234 f7->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
235 container->AddFrame(f7, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
236
237 si = new TGShutterItem(fCategories, new TGHotString("Shapes"), kCAT_SHAPES);
238 container = (TGCompositeFrame *)si->GetContainer();
240 fCategories->AddItem(si);
241
242 // Shape creators
243 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
244 f1->AddFrame(label = new TGLabel(f1, "Create new shape"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
245 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
246 gClient->GetColorByName("#ff0000", color);
247 label->SetTextColor(color);
248 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
249 TGLayoutHints *lhb = new TGLayoutHints(kLHintsLeft, 0, 4, 0, 0);
250 TGLayoutHints *lhf1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2);
251 Int_t ipict;
252 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
253 fShapeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geobbox_t.xpm"), kCREATE_BOX);
254 fShapeButton[0]->SetToolTipText("Create a box");
255 fShapeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geopara_t.xpm"), kCREATE_PARA);
256 fShapeButton[1]->SetToolTipText("Create a parallelipiped");
257 fShapeButton[2] = new TGPictureButton(f1, fClient->GetPicture("geotrd1_t.xpm"), kCREATE_TRD1);
258 fShapeButton[2]->SetToolTipText("Create a TRD1 trapezoid");
259 fShapeButton[3] = new TGPictureButton(f1, fClient->GetPicture("geotrd2_t.xpm"), kCREATE_TRD2);
260 fShapeButton[3]->SetToolTipText("Create a TRD2 trapezoid");
261 fShapeButton[4] = new TGPictureButton(f1, fClient->GetPicture("geotrap_t.xpm"), kCREATE_TRAP);
262 fShapeButton[4]->SetToolTipText("Create a general trapezoid");
263 fShapeButton[5] = new TGPictureButton(f1, fClient->GetPicture("geogtra_t.xpm"), kCREATE_GTRA);
264 fShapeButton[5]->SetToolTipText("Create a general twisted trapezoid");
265 for (ipict = 0; ipict < 6; ipict++)
266 f1->AddFrame(fShapeButton[ipict], lhb);
267 container->AddFrame(f1, lhf1);
268 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
269 fShapeButton[6] = new TGPictureButton(f1, fClient->GetPicture("geoxtru_t.xpm"), kCREATE_XTRU);
270 fShapeButton[6]->SetToolTipText("Create a extruded polygone");
271 fShapeButton[7] = new TGPictureButton(f1, fClient->GetPicture("geoarb8_t.xpm"), kCREATE_ARB8);
272 fShapeButton[7]->SetToolTipText("Create an arbitrary trapezoid with 8 vertices");
273 fShapeButton[8] = new TGPictureButton(f1, fClient->GetPicture("geotube_t.xpm"), kCREATE_TUBE);
274 fShapeButton[8]->SetToolTipText("Create a cylindrical pipe");
275 fShapeButton[9] = new TGPictureButton(f1, fClient->GetPicture("geotubeseg_t.xpm"), kCREATE_TUBS);
276 fShapeButton[9]->SetToolTipText("Create a cylindrical pipe within a phi range");
277 fShapeButton[10] = new TGPictureButton(f1, fClient->GetPicture("geocone_t.xpm"), kCREATE_CONE);
278 fShapeButton[10]->SetToolTipText("Create a conical pipe");
279 fShapeButton[11] = new TGPictureButton(f1, fClient->GetPicture("geoconeseg_t.xpm"), kCREATE_CONS);
280 fShapeButton[11]->SetToolTipText("Create a conical pipe within a phi range");
281 for (ipict = 0; ipict < 6; ipict++)
282 f1->AddFrame(fShapeButton[ipict + 6], lhb);
283 container->AddFrame(f1, lhf1);
284 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
285 fShapeButton[12] = new TGPictureButton(f1, fClient->GetPicture("geosphere_t.xpm"), kCREATE_SPHE);
286 fShapeButton[12]->SetToolTipText("Create a spherical sector");
287 fShapeButton[13] = new TGPictureButton(f1, fClient->GetPicture("geoctub_t.xpm"), kCREATE_CTUB);
288 fShapeButton[13]->SetToolTipText("Create a cut tube");
289 fShapeButton[14] = new TGPictureButton(f1, fClient->GetPicture("geoeltu_t.xpm"), kCREATE_ELTU);
290 fShapeButton[14]->SetToolTipText("Create an elliptical tube");
291 fShapeButton[15] = new TGPictureButton(f1, fClient->GetPicture("geotorus_t.xpm"), kCREATE_TORUS);
292 fShapeButton[15]->SetToolTipText("Create a toroidal tube with a phi range");
293 fShapeButton[16] = new TGPictureButton(f1, fClient->GetPicture("geopcon_t.xpm"), kCREATE_PCON);
294 fShapeButton[16]->SetToolTipText("Create a polycone shape");
295 fShapeButton[17] = new TGPictureButton(f1, fClient->GetPicture("geopgon_t.xpm"), kCREATE_PGON);
296 fShapeButton[17]->SetToolTipText("Create a polygon shape");
297 for (ipict = 0; ipict < 6; ipict++)
298 f1->AddFrame(fShapeButton[ipict + 12], lhb);
299 container->AddFrame(f1, lhf1);
300 f1 = new TGCompositeFrame(container, 118, 30, kHorizontalFrame);
301 fShapeButton[18] = new TGPictureButton(f1, fClient->GetPicture("geohype_t.xpm"), kCREATE_HYPE);
302 fShapeButton[18]->SetToolTipText("Create a hyperboloid");
303 fShapeButton[19] = new TGPictureButton(f1, fClient->GetPicture("geoparab_t.xpm"), kCREATE_PARAB);
304 fShapeButton[19]->SetToolTipText("Create a paraboloid");
305 fShapeButton[20] = new TGPictureButton(f1, fClient->GetPicture("geocomposite_t.xpm"), kCREATE_COMP);
306 fShapeButton[20]->SetToolTipText("Create a composite shape");
307 for (ipict = 0; ipict < 3; ipict++)
308 f1->AddFrame(fShapeButton[ipict + 18], lhb);
309 container->AddFrame(f1, lhf1);
310
311 // List of shapes
312 f2 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
314 f1->AddFrame(label = new TGLabel(f1, "Existing shapes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
315 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
316 gClient->GetColorByName("#ff0000", color);
317 label->SetTextColor(color);
318 f2->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
320 fSelectedShape = nullptr;
321 fLSelShape = new TGLabel(f1, "Select shape");
322 gClient->GetColorByName("#0000ff", color);
323 fLSelShape->SetTextColor(color);
325 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
327 fBSelShape->SetToolTipText("Select one of the existing shapes");
328 fBSelShape->Associate(this);
329 f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
330 fEditShape = new TGTextButton(f1, "Edit");
331 f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
332 fEditShape->SetToolTipText("Edit selected shape");
333 fEditShape->Associate(this);
334 f2->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
335 container->AddFrame(f2, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
336
337 // Volumes category
338 si = new TGShutterItem(fCategories, new TGHotString("Volumes"), kCAT_VOLUMES);
339 container = (TGCompositeFrame *)si->GetContainer();
341 fCategories->AddItem(si);
342
343 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
344 f1->AddFrame(label = new TGLabel(f1, "Create new volume"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
345 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
346 gClient->GetColorByName("#ff0000", color);
347 label->SetTextColor(color);
348 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
349
350 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
351 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
354 fVolumeName->SetToolTipText("Enter the name for the new volume");
355 f1->AddFrame(fVolumeName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
356 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
357
358 // ComboBox for shape component
359 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
360 fSelectedShape2 = nullptr;
361 fLSelShape2 = new TGLabel(f1, "Select shape");
362 gClient->GetColorByName("#0000ff", color);
365 f1->AddFrame(fLSelShape2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
367 fBSelShape2->SetToolTipText("Select one of the existing shapes");
368 fBSelShape2->Associate(this);
369 f1->AddFrame(fBSelShape2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
370 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
371
372 // ComboBox for medium component
373 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
374 fSelectedMedium2 = nullptr;
375 fLSelMedium2 = new TGLabel(f1, "Select medium");
376 gClient->GetColorByName("#0000ff", color);
379 f1->AddFrame(fLSelMedium2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
381 fBSelMedium2->SetToolTipText("Select one of the existing media");
382 fBSelMedium2->Associate(this);
383 f1->AddFrame(fBSelMedium2, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
384 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
385 // Picture buttons for different volumes
386 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
387 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
388 fVolumeButton[0] = new TGPictureButton(f1, fClient->GetPicture("geovolume_t.xpm"), kCREATE_VOLUME);
389 fVolumeButton[0]->SetToolTipText("Create a new volume from shape and medium");
390 fVolumeButton[1] = new TGPictureButton(f1, fClient->GetPicture("geoassembly_t.xpm"), kCREATE_ASSEMBLY);
391 fVolumeButton[1]->SetToolTipText("Create a new volume assembly having the selected name");
392 for (ipict = 0; ipict < 2; ipict++)
393 f1->AddFrame(fVolumeButton[ipict], lhb);
394 container->AddFrame(f1, lhf1);
395 // List of volumes
396 f3 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
398 f1->AddFrame(label = new TGLabel(f1, "Existing volumes"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
399 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
400 gClient->GetColorByName("#ff0000", color);
401 label->SetTextColor(color);
402 f3->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
404 fSelectedVolume = nullptr;
405 fLSelVolume = new TGLabel(f1, "Select volume");
406 gClient->GetColorByName("#0000ff", color);
409 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
411 fBSelVolume->SetToolTipText("Select one of the existing volumes");
412 fBSelVolume->Associate(this);
413 f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
414 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
416 fEditVolume = new TGTextButton(f1, " Edit ");
417 f1->AddFrame(fEditVolume, new TGLayoutHints(kLHintsLeft, 20, 1, 2, 2));
418 fEditVolume->SetToolTipText("Edit selected volume");
419 fEditVolume->Associate(this);
420 fSetTopVolume = new TGTextButton(f1, "Set top");
421 f1->AddFrame(fSetTopVolume, new TGLayoutHints(kLHintsRight, 1, 20, 2, 2));
422 fSetTopVolume->SetToolTipText("Set top volume for geometry");
424 f3->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
425 container->AddFrame(f3, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
426
427 // Materials category
428 si = new TGShutterItem(fCategories, new TGHotString("Materials"), kCAT_MATERIALS);
429 container = (TGCompositeFrame *)si->GetContainer();
431 fCategories->AddItem(si);
432
433 // Material creators
435 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
436 f1->AddFrame(label = new TGLabel(f1, "Create material/mixt."), new TGLayoutHints(kLHintsLeft, 2, 1, 0, 0));
437 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
438 gClient->GetColorByName("#ff0000", color);
439 label->SetTextColor(color);
440 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
441 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
442 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
445 fMaterialName->SetToolTipText("Enter the new material name");
446 f1->AddFrame(fMaterialName, new TGLayoutHints(kLHintsRight, 3, 1, 2, 5));
447 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
448
449 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
450 f1->AddFrame(new TGLabel(f1, "Element"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
454 if (table) {
455 TGeoElement *element;
456 for (Int_t i = 0; i < table->GetNelements(); i++) {
457 element = table->GetElement(i);
458 fElementList->AddEntry(element->GetTitle(), i);
459 }
460 }
462 f1->AddFrame(fElementList, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
463 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
464 // Number entry for density
465 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
466 f1->AddFrame(new TGLabel(f1, "Density"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
472 nef->SetToolTipText("Enter material/mixture density");
475 f1->AddFrame(fEntryDensity, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
476 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
477 // Buttons for creating materials/mixtures
478 // Picture buttons for different volumes
479 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
480 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
481 fMaterialButton[0] = new TGPictureButton(f1, fClient->GetPicture("geomaterial_t.xpm"), kCREATE_MATERIAL);
482 fMaterialButton[0]->SetToolTipText("Create a new material from element and density");
483 fMaterialButton[1] = new TGPictureButton(f1, fClient->GetPicture("geomixture_t.xpm"), kCREATE_MIXTURE);
484 fMaterialButton[1]->SetToolTipText("Create a new mixture with selected density");
485 for (ipict = 0; ipict < 2; ipict++)
486 f1->AddFrame(fMaterialButton[ipict], lhb);
487 container->AddFrame(f1, lhf1);
488
489 // List of materials
490 f4 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
492 f1->AddFrame(label = new TGLabel(f1, "Existing materials"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
493 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
494 gClient->GetColorByName("#ff0000", color);
495 label->SetTextColor(color);
496 f4->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
498 fSelectedMaterial = nullptr;
499 fLSelMaterial = new TGLabel(f1, "Select material");
500 gClient->GetColorByName("#0000ff", color);
505 fBSelMaterial->SetToolTipText("Select one of the existing materials");
507 f1->AddFrame(fBSelMaterial, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
508 fEditMaterial = new TGTextButton(f1, "Edit");
509 f1->AddFrame(fEditMaterial, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
510 fEditMaterial->SetToolTipText("Edit selected material");
512 f4->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
513 container->AddFrame(f4, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
514
515 si = new TGShutterItem(fCategories, new TGHotString("Media"), kCAT_MEDIA);
516 container = (TGCompositeFrame *)si->GetContainer();
518 fCategories->AddItem(si);
519
520 // Media category
521 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
522 f1->AddFrame(label = new TGLabel(f1, "Create new medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
523 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
524 gClient->GetColorByName("#ff0000", color);
525 label->SetTextColor(color);
526 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
527
528 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
529 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
532 fMediumName->SetToolTipText("Enter the new medium name");
533 f1->AddFrame(fMediumName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
534
535 fMediumId = new TGNumberEntry(f1, 0., 5, kMEDIUM_ID);
540 nef->SetToolTipText("Enter medium ID");
542 fMediumId->Associate(this);
543 f1->AddFrame(fMediumId, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
544 f1->AddFrame(new TGLabel(f1, "ID"), new TGLayoutHints(kLHintsRight, 1, 1, 6, 0));
545 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
546 // ComboBox for materials
547 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
548 fSelectedMaterial2 = nullptr;
549 fLSelMaterial2 = new TGLabel(f1, "Select material");
550 gClient->GetColorByName("#0000ff", color);
555 fBSelMaterial2->SetToolTipText("Select one of the existing materials");
557 f1->AddFrame(fBSelMaterial2, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
558 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
559 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
560 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
562 fMediumButton->SetToolTipText("Create a new medium from selected material");
564 f1->AddFrame(fMediumButton, new TGLayoutHints(kLHintsLeft, 5, 2, 2, 2));
565 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
566
567 // List of media
568 f5 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
570 f1->AddFrame(label = new TGLabel(f1, "Existing media"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
571 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
572 gClient->GetColorByName("#ff0000", color);
573 label->SetTextColor(color);
574 f5->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
576 fSelectedMedium = nullptr;
577 fLSelMedium = new TGLabel(f1, "Select medium");
578 gClient->GetColorByName("#0000ff", color);
581 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
583 fBSelMedium->SetToolTipText("Select one of the existing media");
584 fBSelMedium->Associate(this);
585 f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
586 fEditMedium = new TGTextButton(f1, "Edit");
587 f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
588 fEditMedium->SetToolTipText("Edit selected medium");
589 fEditMedium->Associate(this);
590 f5->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
591 container->AddFrame(f5, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
592
593 // Matrix category
594 si = new TGShutterItem(fCategories, new TGHotString("Matrices"), kCAT_MATRICES);
595 container = (TGCompositeFrame *)si->GetContainer();
597 fCategories->AddItem(si);
598 // Name entry
599 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
600 f1->AddFrame(label = new TGLabel(f1, "Create new matrix"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
601 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
602 gClient->GetColorByName("#ff0000", color);
603 label->SetTextColor(color);
604 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
605
606 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
607 f1->AddFrame(new TGLabel(f1, "Name"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
610 fMatrixName->SetToolTipText("Enter the new matrix name");
611 f1->AddFrame(fMatrixName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
612 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
613 // Picture buttons for different matrices
614 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
615 f1->AddFrame(new TGLabel(f1, "Create..."), new TGLayoutHints(kLHintsLeft, 1, 5, 6, 0));
616 fMatrixButton[0] = new TGPictureButton(f1, fClient->GetPicture("geotranslation_t.xpm"), kCREATE_TRANSLATION);
617 fMatrixButton[0]->SetToolTipText("Create a translation");
618 fMatrixButton[1] = new TGPictureButton(f1, fClient->GetPicture("georotation_t.xpm"), kCREATE_ROTATION);
619 fMatrixButton[1]->SetToolTipText("Create a rotation");
620 fMatrixButton[2] = new TGPictureButton(f1, fClient->GetPicture("geocombi_t.xpm"), kCREATE_COMBI);
621 fMatrixButton[2]->SetToolTipText("Create a rotation + translation");
622 for (ipict = 0; ipict < 3; ipict++)
623 f1->AddFrame(fMatrixButton[ipict], lhb);
624 container->AddFrame(f1, lhf1);
625 // List of matrices
626 f6 = new TGCompositeFrame(container, 155, 10, kVerticalFrame | kFixedWidth);
628 f1->AddFrame(label = new TGLabel(f1, "Existing matrices"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
629 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
630 gClient->GetColorByName("#ff0000", color);
631 label->SetTextColor(color);
632 f6->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
634 fSelectedMatrix = nullptr;
635 fLSelMatrix = new TGLabel(f1, "Select matrix");
636 gClient->GetColorByName("#0000ff", color);
639 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
641 fBSelMatrix->SetToolTipText("Select one of the existing matrices");
642 fBSelMatrix->Associate(this);
643 f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
644 fEditMatrix = new TGTextButton(f1, "Edit");
645 f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
646 fEditMatrix->SetToolTipText("Edit selected matrix");
647 fEditMatrix->Associate(this);
648 f6->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
649 container->AddFrame(f6, new TGLayoutHints(kLHintsLeft, 0, 0, 6, 0));
650
651 fCategories->Resize(163, 370);
653
655
656 // Set the fTab and disconnect editor from the canvas.
658 TCanvas *edCanvas = fGedEditor->GetCanvas();
660 if (edCanvas != fConnectedCanvas) {
662 if (edCanvas)
663 ConnectSelected(edCanvas);
664 fConnectedCanvas = edCanvas;
665 }
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// Destructor.
670
672{
673 TGCompositeFrame *cont;
674 cont = (TGCompositeFrame *)fCategories->GetItem("General")->GetContainer();
676 fCategories->GetItem("General")->SetCleanup(0);
677 cont = (TGCompositeFrame *)fCategories->GetItem("Shapes")->GetContainer();
679 fCategories->GetItem("Shapes")->SetCleanup(0);
680 cont = (TGCompositeFrame *)fCategories->GetItem("Volumes")->GetContainer();
682 fCategories->GetItem("Volumes")->SetCleanup(0);
683 cont = (TGCompositeFrame *)fCategories->GetItem("Materials")->GetContainer();
685 fCategories->GetItem("Materials")->SetCleanup(0);
686 cont = (TGCompositeFrame *)fCategories->GetItem("Media")->GetContainer();
688 fCategories->GetItem("Media")->SetCleanup(0);
689 cont = (TGCompositeFrame *)fCategories->GetItem("Matrices")->GetContainer();
691 fCategories->GetItem("Matrices")->SetCleanup(0);
692
693 delete fExportOption[0];
694 delete fExportOption[1];
695
696 Cleanup();
697
698 if (fTabMgr) {
700 delete fTabMgr;
701 }
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// Connected to TCanvas::Selected. TGeoManagerEditor takes this
706/// function from TGedEditor and only uses it if obj is a TGeoVolume.
707
709{
710 if (event == kButton1 && obj->InheritsFrom(TGeoVolume::Class())) {
711 TGeoVolume *v = (TGeoVolume *)obj;
713 fTabMgr->SetTab();
715 v->Draw();
716 }
717}
718
720{
721 // Connect to TCanvas::Selected.
722
723 c->Connect("Selected(TVirtualPad*,TObject*,Int_t)", "TGeoManagerEditor", this,
724 "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
725}
726
728{
729 // Disconnect from TCanvas::Selected.
730
732 Disconnect(fConnectedCanvas, "Selected(TVirtualPad*,TObject*,Int_t)", this,
733 "SelectedSlot(TVirtualPad*,TObject*,Int_t)");
734}
735
736////////////////////////////////////////////////////////////////////////////////
737/// Connect signals to slots.
738
740{
741 fManagerName->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
742 fManagerTitle->Connect("TextChanged(const char *)", "TGeoManagerEditor", this, "DoName()");
743 fExportButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoExportGeometry()");
744 fCloseGeometry->Connect("Clicked()", "TGeoManagerEditor", this, "DoCloseGeometry()");
745 fShapeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateBox()");
746 fShapeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePara()");
747 fShapeButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd1()");
748 fShapeButton[3]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrd2()");
749 fShapeButton[4]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTrap()");
750 fShapeButton[5]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateGtra()");
751 fShapeButton[6]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateXtru()");
752 fShapeButton[7]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateArb8()");
753 fShapeButton[8]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTube()");
754 fShapeButton[9]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTubs()");
755 fShapeButton[10]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCone()");
756 fShapeButton[11]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCons()");
757 fShapeButton[12]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateSphe()");
758 fShapeButton[13]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCtub()");
759 fShapeButton[14]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateEltu()");
760 fShapeButton[15]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTorus()");
761 fShapeButton[16]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePcon()");
762 fShapeButton[17]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreatePgon()");
763 fShapeButton[18]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateHype()");
764 fShapeButton[19]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateParab()");
765 fShapeButton[20]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateComposite()");
766 fMatrixButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateTranslation()");
767 fMatrixButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateRotation()");
768 fMatrixButton[2]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateCombi()");
769 fVolumeButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateVolume()");
770 fVolumeButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateAssembly()");
771 fBSelTop->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectTopVolume()");
772 fBSelVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectVolume()");
773 fBSelShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape()");
774 fBSelShape2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectShape2()");
775 fBSelMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMatrix()");
776 fBSelMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial()");
777 fBSelMaterial2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMaterial2()");
778 fBSelMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium()");
779 fBSelMedium2->Connect("Clicked()", "TGeoManagerEditor", this, "DoSelectMedium2()");
780 fSetTopVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoSetTopVolume()");
781 fEditShape->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditShape()");
782 fEditMedium->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMedium()");
783 fEditMaterial->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMaterial()");
784 fEditMatrix->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditMatrix()");
785 fEditVolume->Connect("Clicked()", "TGeoManagerEditor", this, "DoEditVolume()");
786
787 fMaterialButton[0]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMaterial()");
788 fMaterialButton[1]->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMixture()");
789 fMediumButton->Connect("Clicked()", "TGeoManagerEditor", this, "DoCreateMedium()");
790}
791
792////////////////////////////////////////////////////////////////////////////////
793/// Refresh editor according the selected obj.
794
796{
797 fGeometry = (TGeoManager *)obj;
804 // Check if master volume can be set
807 else
809 // Check if geometry is already closed
810 if (!fGeometry->IsClosed())
812 else {
815 }
816 // Check if volumes category can be activated
819 else
823 else
827 else
831 else
835 else
837
838 // Check if media category can be activated
842 } else {
845 }
846
847 fTab->SetTab(0);
849 if (fTabMgr == nullptr) {
852 }
853 if (fInit)
855 // SetActive();
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Change name/title of the geometry
860
862{
865}
866
867////////////////////////////////////////////////////////////////////////////////
868/// Export geometry as .root or .C file
869
871{
872 Bool_t asroot = fExportOption[0]->IsDown();
874 s = s.Strip();
875 s.Remove(20);
876 const char *name;
877 if (asroot)
878 name = TString::Format("%s.root", s.Data());
879 else
880 name = TString::Format("%s.C", s.Data());
882}
883
884////////////////////////////////////////////////////////////////////////////////
885/// Create a box.
886
888{
890 fSelectedShape = new TGeoBBox(TString::Format("box_%i", id), 1., 1., 1.);
892 // Check if volumes category can be activated
895 DoEditShape();
896}
897
898////////////////////////////////////////////////////////////////////////////////
899/// Create a parallelipiped.
900
902{
904 fSelectedShape = new TGeoPara(TString::Format("para_%i", id), 1., 1., 1., 30., 20., 45.);
908 DoEditShape();
909}
910
911////////////////////////////////////////////////////////////////////////////////
912/// Create a Trd1.
913
915{
917 fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i", id), 0.5, 1., 1., 1.);
921 DoEditShape();
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// Create a Trd2.
926
928{
930 fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i", id), 0.5, 1., 0.5, 1., 1.);
934 DoEditShape();
935}
936
937////////////////////////////////////////////////////////////////////////////////
938/// Create a general trapezoid.
939
941{
943 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.);
947 DoEditShape();
948}
949
950////////////////////////////////////////////////////////////////////////////////
951/// Create a twisted trapezoid.
952
954{
957 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.);
961 DoEditShape();
962}
963
964////////////////////////////////////////////////////////////////////////////////
965/// Create an extruded polygone.
966
968
969////////////////////////////////////////////////////////////////////////////////
970/// Create an arbitrary polygone with maximum 8 vertices sitting on 2 parallel
971/// planes
972
974
975////////////////////////////////////////////////////////////////////////////////
976/// Create a tube.
977
979{
981 fSelectedShape = new TGeoTube(TString::Format("tube_%i", id), 0.5, 1., 1.);
985 DoEditShape();
986}
987
988////////////////////////////////////////////////////////////////////////////////
989/// Create a tube segment.
990
992{
994 fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i", id), 0.5, 1., 1., 0., 45.);
998 DoEditShape();
999}
1000
1001////////////////////////////////////////////////////////////////////////////////
1002/// Create a cone.
1003
1005{
1007 fSelectedShape = new TGeoCone(TString::Format("cone_%i", id), 0.5, 0.5, 1., 1.5, 2.);
1010 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1011 DoEditShape();
1012}
1013
1014////////////////////////////////////////////////////////////////////////////////
1015/// Create a cone segment.
1016
1018{
1020 fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i", id), 0.5, 0.5, 1., 1.5, 2., 0., 45.);
1023 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1024 DoEditShape();
1025}
1026
1027////////////////////////////////////////////////////////////////////////////////
1028/// Create a sphere.
1029
1031{
1033 fSelectedShape = new TGeoSphere(TString::Format("sphere_%i", id), 0.5, 1., 0., 180., 0., 360.);
1036 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1037 DoEditShape();
1038}
1039
1040////////////////////////////////////////////////////////////////////////////////
1041/// Create a cut tube.
1042
1044{
1046 fSelectedShape = new TGeoCtub(TString::Format("ctub_%i", id), 0.5, 1., 1., 0., 45., 0., 0., -1, 0., 0., 1);
1049 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1050 DoEditShape();
1051}
1052
1053////////////////////////////////////////////////////////////////////////////////
1054/// Create an elliptical tube.
1055
1057{
1059 fSelectedShape = new TGeoEltu(TString::Format("para_%i", id), 1., 2., 1.5);
1062 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1063 DoEditShape();
1064}
1065
1066////////////////////////////////////////////////////////////////////////////////
1067/// Create a torus shape.
1068
1070{
1072 fSelectedShape = new TGeoTorus(TString::Format("torus_%i", id), 10., 1., 1.5, 0, 360.);
1075 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1076 DoEditShape();
1077}
1078
1079////////////////////////////////////////////////////////////////////////////////
1080/// Create a polycone shape.
1081
1083{
1085 fSelectedShape = new TGeoPcon(TString::Format("pcon_%i", id), 0., 360., 2);
1086 ((TGeoPcon *)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1087 ((TGeoPcon *)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1090 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1091 DoEditShape();
1092}
1093
1094////////////////////////////////////////////////////////////////////////////////
1095/// Create a polygone shape.
1096
1098{
1100 fSelectedShape = new TGeoPgon(TString::Format("pgon_%i", id), 0., 360., 6, 2);
1101 ((TGeoPcon *)fSelectedShape)->DefineSection(0, -1, 0.5, 1.);
1102 ((TGeoPcon *)fSelectedShape)->DefineSection(1, 1, 0.2, 0.5);
1105 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1106 DoEditShape();
1107}
1108
1109////////////////////////////////////////////////////////////////////////////////
1110/// Create a hyperboloid.
1111
1113{
1115 fSelectedShape = new TGeoHype(TString::Format("hype_%i", id), 1., 15., 2., 30., 5.);
1118 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1119 DoEditShape();
1120}
1121
1122////////////////////////////////////////////////////////////////////////////////
1123/// Create a paraboloid.
1124
1126
1127////////////////////////////////////////////////////////////////////////////////
1128/// Create a composite shape.
1129
1131
1132////////////////////////////////////////////////////////////////////////////////
1133/// Create a new material.
1134
1136{
1138 if (!el) {
1139 Error("DoCreateMaterial", "Cannot find selected element in list");
1140 return;
1141 }
1142 Double_t density = fEntryDensity->GetNumber();
1143 const char *name = fMaterialName->GetText();
1144 fSelectedMaterial = new TGeoMaterial(name, el, density);
1149}
1150
1151////////////////////////////////////////////////////////////////////////////////
1152/// Create a new mixture.
1153
1155{
1156 Double_t density = fEntryDensity->GetNumber();
1157 const char *name = fMaterialName->GetText();
1158 fSelectedMaterial = new TGeoMixture(name, 1, density);
1163}
1164
1165////////////////////////////////////////////////////////////////////////////////
1166/// Create a new medium.
1167
1169{
1171 if (!fSelectedMaterial2)
1172 return;
1173 const char *name = fMediumName->GetText();
1177 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1178 DoEditMedium();
1180}
1181
1182////////////////////////////////////////////////////////////////////////////////
1183/// Create a new translation.
1184
1186{
1187 const char *name = fMatrixName->GetText();
1188 fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1192 DoEditMatrix();
1194}
1195
1196////////////////////////////////////////////////////////////////////////////////
1197/// Create a new rotation.
1198
1200{
1201 const char *name = fMatrixName->GetText();
1206 DoEditMatrix();
1208}
1209
1210////////////////////////////////////////////////////////////////////////////////
1211/// Create a new volume.
1212
1214{
1215 const char *name = fVolumeName->GetText();
1217 return;
1221 DoEditVolume();
1223}
1224
1225////////////////////////////////////////////////////////////////////////////////
1226/// Create a new volume assembly.
1227
1229{
1230 const char *name = fVolumeName->GetText();
1234 DoEditVolume();
1236}
1237
1238////////////////////////////////////////////////////////////////////////////////
1239/// Create a new translation + rotation.
1240
1242{
1243 const char *name = fMatrixName->GetText();
1244 fSelectedMatrix = new TGeoCombiTrans(name, 0., 0., 0., new TGeoRotation());
1249 DoEditMatrix();
1251}
1252
1253////////////////////////////////////////////////////////////////////////////////
1254/// Set top volume for the geometry.
1255
1257{
1258 if (!fSelectedVolume)
1259 return;
1262}
1263
1264////////////////////////////////////////////////////////////////////////////////
1265/// Slot for editing selected shape.
1266
1268{
1269 if (!fSelectedShape)
1270 return;
1273 fTabMgr->GetPad()->GetView()->ShowAxis();
1274}
1275
1276////////////////////////////////////////////////////////////////////////////////
1277/// Slot for editing selected volume.
1278
1280{
1281 if (!fSelectedVolume) {
1283 return;
1284 }
1286 fTabMgr->SetTab();
1289}
1290
1291////////////////////////////////////////////////////////////////////////////////
1292/// Slot for editing selected medium.
1293
1295{
1296 if (!fSelectedMedium)
1297 return;
1299}
1300
1301////////////////////////////////////////////////////////////////////////////////
1302/// Slot for editing selected material.
1303
1305{
1306 if (!fSelectedMaterial)
1307 return;
1309}
1310
1311////////////////////////////////////////////////////////////////////////////////
1312/// Slot for editing selected matrix.
1313
1315{
1316 if (!fSelectedMatrix)
1317 return;
1319}
1320
1321////////////////////////////////////////////////////////////////////////////////
1322/// Slot for selecting an existing matrix.
1323
1325{
1326 TGeoMatrix *matrix = fSelectedMatrix;
1327 new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200, 300);
1329 if (fSelectedMatrix)
1331 else
1332 fSelectedMatrix = matrix;
1333}
1334
1335////////////////////////////////////////////////////////////////////////////////
1336/// Slot for selecting an existing shape.
1337
1339{
1340 TGeoShape *shape = fSelectedShape;
1341 new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200, 300);
1343 if (fSelectedShape)
1345 else
1346 fSelectedShape = shape;
1347}
1348
1349////////////////////////////////////////////////////////////////////////////////
1350/// Slot for selecting a shape for making a volume.
1351
1353{
1354 TGeoShape *shape = fSelectedShape2;
1355 new TGeoShapeDialog(fBSelShape2, gClient->GetRoot(), 200, 300);
1357 if (fSelectedShape2)
1359 else
1360 fSelectedShape2 = shape;
1361}
1362
1363////////////////////////////////////////////////////////////////////////////////
1364/// Slot for selecting an existing material.
1365
1367{
1369 new TGeoMaterialDialog(fBSelMaterial, gClient->GetRoot(), 200, 300);
1373 else
1374 fSelectedMaterial = mat;
1375}
1376
1377////////////////////////////////////////////////////////////////////////////////
1378/// Slot for selecting an existing material and making a medium.
1379
1381{
1383 new TGeoMaterialDialog(fBSelMaterial2, gClient->GetRoot(), 200, 300);
1387 else
1388 fSelectedMaterial2 = mat;
1389}
1390
1391////////////////////////////////////////////////////////////////////////////////
1392/// Slot for selecting an existing medium.
1393
1395{
1397 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200, 300);
1399 if (fSelectedMedium)
1401 else
1402 fSelectedMedium = med;
1403}
1404
1405////////////////////////////////////////////////////////////////////////////////
1406/// Slot for selecting an existing medium for making a volume.
1407
1409{
1411 new TGeoMediumDialog(fBSelMedium2, gClient->GetRoot(), 200, 300);
1413 if (fSelectedMedium2)
1415 else
1416 fSelectedMedium2 = med;
1417}
1418
1419////////////////////////////////////////////////////////////////////////////////
1420/// Slot for selecting an existing volume.
1421
1423{
1425 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200, 300);
1427 if (fSelectedVolume)
1429 else
1430 fSelectedVolume = vol;
1431}
1432
1433////////////////////////////////////////////////////////////////////////////////
1434/// Slot for setting top geometry volume.
1435
1437{
1439 new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200, 300);
1441 if (fSelectedVolume)
1443 else
1444 fSelectedVolume = vol;
1445 if (fSelectedVolume && (fSelectedVolume != vol))
1447}
1448
1449////////////////////////////////////////////////////////////////////////////////
1450/// Slot for closing the geometry.
1451
1453{
1454 if (!fGeometry->IsClosed())
1457}
1458
1459////////////////////////////////////////////////////////////////////////////////
1460/// Show/hide interface for shape selection.
1461
1463{
1465 if (show)
1466 cont->ShowFrame(f2);
1467 else
1468 cont->HideFrame(f2);
1469}
1470
1471////////////////////////////////////////////////////////////////////////////////
1472/// Show/hide interface for volume selection.
1473
1475{
1477 if (show)
1478 cont->ShowFrame(f7);
1479 else
1480 cont->HideFrame(f7);
1481 cont = (TGCompositeFrame *)fCategories->GetItem("Volumes")->GetContainer();
1482 if (show)
1483 cont->ShowFrame(f3);
1484 else
1485 cont->HideFrame(f3);
1486}
1487
1488////////////////////////////////////////////////////////////////////////////////
1489/// Show/hide interface for material selection.
1490
1492{
1494 if (show)
1495 cont->ShowFrame(f4);
1496 else
1497 cont->HideFrame(f4);
1498}
1499
1500////////////////////////////////////////////////////////////////////////////////
1501/// Show/hide interface for medium selection.
1502
1504{
1506 if (show)
1507 cont->ShowFrame(f5);
1508 else
1509 cont->HideFrame(f5);
1510}
1511
1512////////////////////////////////////////////////////////////////////////////////
1513/// Show/hide interface for matrix selection.
1514
1516{
1518 if (show)
1519 cont->ShowFrame(f6);
1520 else
1521 cont->HideFrame(f6);
1522}
1523
1524////////////////////////////////////////////////////////////////////////////////
1525/// Dummy static function, used to load plugin
1526
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kFitWidth
Definition GuiTypes.h:386
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedHeight
Definition GuiTypes.h:389
@ kOwnBackground
Definition GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
#define c(i)
Definition RSha256.hxx:101
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
#define gClient
Definition TGClient.h:156
@ 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
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
@ 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
R__EXTERN TGeoManager * gGeoManager
The Canvas class.
Definition TCanvas.h:23
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
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...
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:445
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:459
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:289
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 Int_t GetSelected() const
Definition TGComboBox.h:114
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
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...
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1072
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:321
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:312
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
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:362
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:180
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.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
void Associate(const TGWindow *w) override
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
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
UInt_t GetDefaultHeight() const override
void SetNumStyle(EStyle style)
@ 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
Bool_t IsDown() const override
Definition TGButton.h:370
TGButton * GetButton() const
Definition TGShutter.h:44
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
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Definition TGShutter.cxx:73
TGShutterItem * GetItem(const char *name)
returns a shutter item by name (name is hot string of shutter item)
void Layout() override
Layout shutter items.
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:558
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
const char * GetText() const
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.
Organizes TGButton widgets in a group with one vertical column.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
TCanvas * GetCanvas() const override
Definition TGedEditor.h:77
TGTab * GetTab() const
Definition TGedEditor.h:73
virtual void DisconnectFromCanvas()
Disconnect this editor from the Selected signal of fCanvas.
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
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'.
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
Class describing rotation + translation.
Definition TGeoMatrix.h:317
Table of elements.
TGeoElement * GetElement(Int_t z)
Int_t GetNelements() const
Base class for chemical elements.
Definition TGeoElement.h:36
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.
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:44
TList * GetListOfMedia() const
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
TObjArray * GetListOfVolumes() const
TObjArray * GetListOfMatrices() const
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
Export this geometry to a file.
TGeoVolume * GetMasterVolume() const
Bool_t IsClosed() const
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
TObjArray * GetListOfShapes() const
TGeoVolume * GetTopVolume() const
Base class describing materials.
Geometrical transformation package.
Definition TGeoMatrix.h:38
@ kGeoTranslation
Definition TGeoMatrix.h:43
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
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:168
Base abstract class for all shapes.
Definition TGeoShape.h:25
void Draw(Option_t *option="") override
Draw this shape.
const char * GetName() const override
Get the shape name.
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.
Class describing translations.
Definition TGeoMatrix.h:116
static TObject * GetSelected()
static; return selected object
Volume assemblies.
Definition TGeoVolume.h:316
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void Draw(Option_t *option="") override
draw top volume according to option
static TClass * Class()
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
Int_t GetEntries() const override
Return the number of objects in array (i.e.
Mother of all ROOT objects.
Definition TObject.h:41
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:786
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:530
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:869
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:139
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition TString.cxx:1163
const char * Data() const
Definition TString.h:376
TString & Remove(Ssiz_t pos)
Definition TString.h:685
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:2378
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