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);
187 fManagerName->Resize(135, fManagerName->GetDefaultHeight());
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);
191 fManagerTitle->Resize(135, fManagerTitle->GetDefaultHeight());
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);
224 fLSelTop->ChangeOptions(kSunkenFrame | kDoubleBorder);
225 f1->AddFrame(fLSelTop, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
226 fBSelTop = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_TOP_SELECT);
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");
233 fCloseGeometry->Associate(this);
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);
324 fLSelShape->ChangeOptions(kSunkenFrame | kDoubleBorder);
325 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
326 fBSelShape = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_SHAPE_SELECT);
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));
353 fVolumeName->Resize(100, fVolumeName->GetDefaultHeight());
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);
363 fLSelShape2->SetTextColor(color);
364 fLSelShape2->ChangeOptions(kSunkenFrame | kDoubleBorder);
365 f1->AddFrame(fLSelShape2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
366 fBSelShape2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_SHAPE_SELECT2);
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);
377 fLSelMedium2->SetTextColor(color);
378 fLSelMedium2->ChangeOptions(kSunkenFrame | kDoubleBorder);
379 f1->AddFrame(fLSelMedium2, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
380 fBSelMedium2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MEDIUM_SELECT2);
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);
407 fLSelVolume->SetTextColor(color);
408 fLSelVolume->ChangeOptions(kSunkenFrame | kDoubleBorder);
409 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
410 fBSelVolume = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_VOLUME_SELECT);
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");
423 fSetTopVolume->Associate(this);
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
434 gGeoManager->BuildDefaultMaterials();
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));
444 fMaterialName->Resize(100, fMaterialName->GetDefaultHeight());
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));
452 fElementList->Resize(100, fManagerName->GetDefaultHeight());
453 TGeoElementTable *table = gGeoManager->GetElementTable();
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 }
461 fElementList->Select(0);
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));
470 fEntryDensity->Resize(100, fEntryDensity->GetDefaultHeight());
471 TGTextEntry *nef = (TGTextEntry *)fEntryDensity->GetNumberEntry();
472 nef->SetToolTipText("Enter material/mixture density");
473 fEntryDensity->SetNumber(0);
474 fEntryDensity->Associate(this);
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);
501 fLSelMaterial->SetTextColor(color);
502 fLSelMaterial->ChangeOptions(kSunkenFrame | kDoubleBorder);
504 fBSelMaterial = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATERIAL_SELECT);
505 fBSelMaterial->SetToolTipText("Select one of the existing materials");
506 fBSelMaterial->Associate(this);
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");
511 fEditMaterial->Associate(this);
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));
531 fMediumName->Resize(60, fMediumName->GetDefaultHeight());
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);
538 fMediumId->Resize(35, fMediumId->GetDefaultHeight());
539 nef = (TGTextEntry *)fMediumId->GetNumberEntry();
540 nef->SetToolTipText("Enter medium ID");
541 fMediumId->SetNumber(fGeometry->GetListOfMedia()->GetSize());
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);
551 fLSelMaterial2->SetTextColor(color);
552 fLSelMaterial2->ChangeOptions(kSunkenFrame | kDoubleBorder);
554 fBSelMaterial2 = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATERIAL_SELECT2);
555 fBSelMaterial2->SetToolTipText("Select one of the existing materials");
556 fBSelMaterial2->Associate(this);
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));
561 fMediumButton = new TGPictureButton(f1, fClient->GetPicture("geomedium_t.xpm"), kCREATE_MEDIUM);
562 fMediumButton->SetToolTipText("Create a new medium from selected material");
563 fMediumButton->Associate(this);
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);
579 fLSelMedium->SetTextColor(color);
580 fLSelMedium->ChangeOptions(kSunkenFrame | kDoubleBorder);
581 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
582 fBSelMedium = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MEDIA_SELECT);
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));
609 fMatrixName->Resize(100, fMatrixName->GetDefaultHeight());
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);
637 fLSelMatrix->SetTextColor(color);
638 fLSelMatrix->ChangeOptions(kSunkenFrame | kDoubleBorder);
639 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
640 fBSelMatrix = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kMANAGER_MATRIX_SELECT);
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.
657 fTab = fGedEditor->GetTab();
658 TCanvas *edCanvas = fGedEditor->GetCanvas();
659 fGedEditor->DisconnectFromCanvas();
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) {
699 fTabMgr->GetVolumeTab()->Cleanup();
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;
712 fTabMgr->SetVolTabEnabled();
713 fTabMgr->SetTab();
714 fTabMgr->GetVolumeEditor(v);
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;
798 fManagerName->SetText(fGeometry->GetName());
799 fManagerTitle->SetText(fGeometry->GetTitle());
800 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
801 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
802 fMediumName->SetText(TString::Format("medium%i", fGeometry->GetListOfMedia()->GetSize()));
803 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
804 // Check if master volume can be set
805 if (fGeometry->GetMasterVolume())
806 fSetTopVolume->SetEnabled(kFALSE);
807 else
808 fSetTopVolume->SetEnabled(kTRUE);
809 // Check if geometry is already closed
810 if (!fGeometry->IsClosed())
811 fCloseGeometry->SetEnabled(kTRUE);
812 else {
813 fCloseGeometry->SetEnabled(kFALSE);
814 fBSelTop->SetEnabled(kFALSE);
815 }
816 // Check if volumes category can be activated
817 if (!fGeometry->GetListOfShapes()->GetEntries() || !fGeometry->GetListOfMedia()->GetSize())
818 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kFALSE);
819 else
820 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
821 if (!fGeometry->GetListOfShapes()->GetEntries())
823 else
825 if (!fGeometry->GetListOfVolumes()->GetEntries())
827 else
829 if (!fGeometry->GetListOfMedia()->GetSize())
831 else
833 if (!fGeometry->GetListOfMatrices()->GetEntries())
835 else
837
838 // Check if media category can be activated
839 if (!fGeometry->GetListOfMaterials()->GetSize()) {
840 fCategories->GetItem("Media")->GetButton()->SetEnabled(kFALSE);
842 } else {
843 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
845 }
846
847 fTab->SetTab(0);
848 fCategories->Layout();
849 if (fTabMgr == nullptr) {
851 fTabMgr->fVolumeTab = fVolumeTab;
852 }
853 if (fInit)
855 // SetActive();
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Change name/title of the geometry
860
862{
863 fGeometry->SetName(fManagerName->GetText());
864 fGeometry->SetTitle(fManagerTitle->GetText());
865}
866
867////////////////////////////////////////////////////////////////////////////////
868/// Export geometry as .root or .C file
869
871{
872 Bool_t asroot = fExportOption[0]->IsDown();
873 TString s = fGeometry->GetName();
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());
881 fGeometry->Export(name);
882}
883
884////////////////////////////////////////////////////////////////////////////////
885/// Create a box.
886
888{
889 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
890 fSelectedShape = new TGeoBBox(TString::Format("box_%i", id), 1., 1., 1.);
892 // Check if volumes category can be activated
893 if (fGeometry->GetListOfMedia()->GetSize())
894 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
895 DoEditShape();
896}
897
898////////////////////////////////////////////////////////////////////////////////
899/// Create a parallelipiped.
900
902{
903 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
904 fSelectedShape = new TGeoPara(TString::Format("para_%i", id), 1., 1., 1., 30., 20., 45.);
906 if (fGeometry->GetListOfMedia()->GetSize())
907 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
908 DoEditShape();
909}
910
911////////////////////////////////////////////////////////////////////////////////
912/// Create a Trd1.
913
915{
916 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
917 fSelectedShape = new TGeoTrd1(TString::Format("trd1_%i", id), 0.5, 1., 1., 1.);
919 if (fGeometry->GetListOfMedia()->GetSize())
920 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
921 DoEditShape();
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// Create a Trd2.
926
928{
929 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
930 fSelectedShape = new TGeoTrd2(TString::Format("trd2_%i", id), 0.5, 1., 0.5, 1., 1.);
932 if (fGeometry->GetListOfMedia()->GetSize())
933 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
934 DoEditShape();
935}
936
937////////////////////////////////////////////////////////////////////////////////
938/// Create a general trapezoid.
939
941{
942 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
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.);
945 if (fGeometry->GetListOfMedia()->GetSize())
946 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
947 DoEditShape();
948}
949
950////////////////////////////////////////////////////////////////////////////////
951/// Create a twisted trapezoid.
952
954{
955 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
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.);
959 if (fGeometry->GetListOfMedia()->GetSize())
960 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
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{
980 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
981 fSelectedShape = new TGeoTube(TString::Format("tube_%i", id), 0.5, 1., 1.);
983 if (fGeometry->GetListOfMedia()->GetSize())
984 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
985 DoEditShape();
986}
987
988////////////////////////////////////////////////////////////////////////////////
989/// Create a tube segment.
990
992{
993 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
994 fSelectedShape = new TGeoTubeSeg(TString::Format("tubs_%i", id), 0.5, 1., 1., 0., 45.);
996 if (fGeometry->GetListOfMedia()->GetSize())
997 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
998 DoEditShape();
999}
1000
1001////////////////////////////////////////////////////////////////////////////////
1002/// Create a cone.
1003
1005{
1006 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1007 fSelectedShape = new TGeoCone(TString::Format("cone_%i", id), 0.5, 0.5, 1., 1.5, 2.);
1009 if (fGeometry->GetListOfMedia()->GetSize())
1010 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1011 DoEditShape();
1012}
1013
1014////////////////////////////////////////////////////////////////////////////////
1015/// Create a cone segment.
1016
1018{
1019 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1020 fSelectedShape = new TGeoConeSeg(TString::Format("cons_%i", id), 0.5, 0.5, 1., 1.5, 2., 0., 45.);
1022 if (fGeometry->GetListOfMedia()->GetSize())
1023 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1024 DoEditShape();
1025}
1026
1027////////////////////////////////////////////////////////////////////////////////
1028/// Create a sphere.
1029
1031{
1032 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1033 fSelectedShape = new TGeoSphere(TString::Format("sphere_%i", id), 0.5, 1., 0., 180., 0., 360.);
1035 if (fGeometry->GetListOfMedia()->GetSize())
1036 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1037 DoEditShape();
1038}
1039
1040////////////////////////////////////////////////////////////////////////////////
1041/// Create a cut tube.
1042
1044{
1045 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1046 fSelectedShape = new TGeoCtub(TString::Format("ctub_%i", id), 0.5, 1., 1., 0., 45., 0., 0., -1, 0., 0., 1);
1048 if (fGeometry->GetListOfMedia()->GetSize())
1049 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1050 DoEditShape();
1051}
1052
1053////////////////////////////////////////////////////////////////////////////////
1054/// Create an elliptical tube.
1055
1057{
1058 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1059 fSelectedShape = new TGeoEltu(TString::Format("para_%i", id), 1., 2., 1.5);
1061 if (fGeometry->GetListOfMedia()->GetSize())
1062 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1063 DoEditShape();
1064}
1065
1066////////////////////////////////////////////////////////////////////////////////
1067/// Create a torus shape.
1068
1070{
1071 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1072 fSelectedShape = new TGeoTorus(TString::Format("torus_%i", id), 10., 1., 1.5, 0, 360.);
1074 if (fGeometry->GetListOfMedia()->GetSize())
1075 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1076 DoEditShape();
1077}
1078
1079////////////////////////////////////////////////////////////////////////////////
1080/// Create a polycone shape.
1081
1083{
1084 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
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);
1089 if (fGeometry->GetListOfMedia()->GetSize())
1090 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1091 DoEditShape();
1092}
1093
1094////////////////////////////////////////////////////////////////////////////////
1095/// Create a polygone shape.
1096
1098{
1099 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
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);
1104 if (fGeometry->GetListOfMedia()->GetSize())
1105 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1106 DoEditShape();
1107}
1108
1109////////////////////////////////////////////////////////////////////////////////
1110/// Create a hyperboloid.
1111
1113{
1114 Int_t id = gGeoManager->GetListOfShapes()->GetEntries();
1115 fSelectedShape = new TGeoHype(TString::Format("hype_%i", id), 1., 15., 2., 30., 5.);
1117 if (fGeometry->GetListOfMedia()->GetSize())
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{
1137 TGeoElement *el = fGeometry->GetElementTable()->GetElement(fElementList->GetSelected());
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);
1146 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1148 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
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);
1160 fCategories->GetItem("Media")->GetButton()->SetEnabled(kTRUE);
1162 fMaterialName->SetText(TString::Format("material%i", fGeometry->GetListOfMaterials()->GetSize()));
1163}
1164
1165////////////////////////////////////////////////////////////////////////////////
1166/// Create a new medium.
1167
1169{
1170 Int_t id = fMediumId->GetIntNumber();
1171 if (!fSelectedMaterial2)
1172 return;
1173 const char *name = fMediumName->GetText();
1176 if (fGeometry->GetListOfShapes()->GetEntries())
1177 fCategories->GetItem("Volumes")->GetButton()->SetEnabled(kTRUE);
1178 DoEditMedium();
1179 fMediumName->SetText(TString::Format("medium%i", fGeometry->GetListOfMedia()->GetSize()));
1180}
1181
1182////////////////////////////////////////////////////////////////////////////////
1183/// Create a new translation.
1184
1186{
1187 const char *name = fMatrixName->GetText();
1188 fSelectedMatrix = new TGeoTranslation(name, 0., 0., 0.);
1190 fSelectedMatrix->RegisterYourself();
1192 DoEditMatrix();
1193 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1194}
1195
1196////////////////////////////////////////////////////////////////////////////////
1197/// Create a new rotation.
1198
1200{
1201 const char *name = fMatrixName->GetText();
1204 fSelectedMatrix->RegisterYourself();
1206 DoEditMatrix();
1207 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1208}
1209
1210////////////////////////////////////////////////////////////////////////////////
1211/// Create a new volume.
1212
1214{
1215 const char *name = fVolumeName->GetText();
1217 return;
1219 fLSelVolume->SetText(name);
1221 DoEditVolume();
1222 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
1223}
1224
1225////////////////////////////////////////////////////////////////////////////////
1226/// Create a new volume assembly.
1227
1229{
1230 const char *name = fVolumeName->GetText();
1232 fLSelVolume->SetText(name);
1234 DoEditVolume();
1235 fVolumeName->SetText(TString::Format("volume%i", fGeometry->GetListOfVolumes()->GetEntries()));
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());
1245 fSelectedMatrix->RegisterYourself();
1249 DoEditMatrix();
1250 fMatrixName->SetText(TString::Format("matrix%i", fGeometry->GetListOfMatrices()->GetEntries()));
1251}
1252
1253////////////////////////////////////////////////////////////////////////////////
1254/// Set top volume for the geometry.
1255
1257{
1258 if (!fSelectedVolume)
1259 return;
1260 fGeometry->SetTopVolume(fSelectedVolume);
1261 fSetTopVolume->SetEnabled(kFALSE);
1262}
1263
1264////////////////////////////////////////////////////////////////////////////////
1265/// Slot for editing selected shape.
1266
1268{
1269 if (!fSelectedShape)
1270 return;
1271 fTabMgr->GetShapeEditor(fSelectedShape);
1272 fSelectedShape->Draw();
1273 fTabMgr->GetPad()->GetView()->ShowAxis();
1274}
1275
1276////////////////////////////////////////////////////////////////////////////////
1277/// Slot for editing selected volume.
1278
1280{
1281 if (!fSelectedVolume) {
1282 fTabMgr->SetVolTabEnabled(kFALSE);
1283 return;
1284 }
1285 fTabMgr->SetVolTabEnabled();
1286 fTabMgr->SetTab();
1287 fTabMgr->GetVolumeEditor(fSelectedVolume);
1288 fSelectedVolume->Draw();
1289}
1290
1291////////////////////////////////////////////////////////////////////////////////
1292/// Slot for editing selected medium.
1293
1295{
1296 if (!fSelectedMedium)
1297 return;
1298 fTabMgr->GetMediumEditor(fSelectedMedium);
1299}
1300
1301////////////////////////////////////////////////////////////////////////////////
1302/// Slot for editing selected material.
1303
1305{
1306 if (!fSelectedMaterial)
1307 return;
1308 fTabMgr->GetMaterialEditor(fSelectedMaterial);
1309}
1310
1311////////////////////////////////////////////////////////////////////////////////
1312/// Slot for editing selected matrix.
1313
1315{
1316 if (!fSelectedMatrix)
1317 return;
1318 fTabMgr->GetMatrixEditor(fSelectedMatrix);
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)
1330 fLSelMatrix->SetText(fSelectedMatrix->GetName());
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)
1344 fLSelShape->SetText(fSelectedShape->GetName());
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)
1358 fLSelShape2->SetText(fSelectedShape2->GetName());
1359 else
1360 fSelectedShape2 = shape;
1361}
1362
1363////////////////////////////////////////////////////////////////////////////////
1364/// Slot for selecting an existing material.
1365
1376
1377////////////////////////////////////////////////////////////////////////////////
1378/// Slot for selecting an existing material and making a medium.
1379
1390
1391////////////////////////////////////////////////////////////////////////////////
1392/// Slot for selecting an existing medium.
1393
1395{
1397 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200, 300);
1399 if (fSelectedMedium)
1400 fLSelMedium->SetText(fSelectedMedium->GetName());
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)
1414 fLSelMedium2->SetText(fSelectedMedium2->GetName());
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)
1428 fLSelVolume->SetText(fSelectedVolume->GetName());
1429 else
1430 fSelectedVolume = vol;
1431}
1432
1433////////////////////////////////////////////////////////////////////////////////
1434/// Slot for setting top geometry volume.
1435
1437{
1438 TGeoVolume *vol = fGeometry->GetTopVolume();
1439 new TGeoVolumeDialog(fBSelTop, gClient->GetRoot(), 200, 300);
1441 if (fSelectedVolume)
1442 fLSelTop->SetText(fSelectedVolume->GetName());
1443 else
1444 fSelectedVolume = vol;
1445 if (fSelectedVolume && (fSelectedVolume != vol))
1446 fGeometry->SetTopVolume(fSelectedVolume);
1447}
1448
1449////////////////////////////////////////////////////////////////////////////////
1450/// Slot for closing the geometry.
1451
1453{
1454 if (!fGeometry->IsClosed())
1455 fGeometry->CloseGeometry();
1456 fCloseGeometry->SetEnabled(kFALSE);
1457}
1458
1459////////////////////////////////////////////////////////////////////////////////
1460/// Show/hide interface for shape selection.
1461
1463{
1464 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Shapes")->GetContainer();
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{
1476 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("General")->GetContainer();
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{
1493 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Materials")->GetContainer();
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{
1505 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Media")->GetContainer();
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{
1517 TGCompositeFrame *cont = (TGCompositeFrame *)fCategories->GetItem("Matrices")->GetContainer();
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
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
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
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
Int_t i
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:1117
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1204
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
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
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
Box class.
Definition TGeoBBox.h:17
Class describing rotation + translation.
Definition TGeoMatrix.h:317
A cone segment is a cone having a range in phi.
Definition TGeoCone.h:99
The cones are defined by 5 parameters:
Definition TGeoCone.h:17
The cut tubes constructor has the form:
Definition TGeoTube.h:173
Table of elements.
TGeoElement * GetElement(Int_t z)
Int_t GetNelements() const
Base class for chemical elements.
Definition TGeoElement.h:36
An elliptical tube is defined by the two semi-axes A and B.
Definition TGeoEltu.h:17
A twisted trapezoid.
Definition TGeoArb8.h:149
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
Definition TGeoHype.h:17
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
Base class describing materials.
Geometrical transformation package.
Definition TGeoMatrix.h:38
@ kGeoTranslation
Definition TGeoMatrix.h:43
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
Mixtures of elements.
Parallelepiped class.
Definition TGeoPara.h:17
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Definition TGeoPcon.h:17
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
Definition TGeoPgon.h:20
Class describing rotations.
Definition TGeoMatrix.h:168
Base abstract class for all shapes.
Definition TGeoShape.h:25
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Definition TGeoSphere.h:17
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.
The torus is defined by its axial radius, its inner and outer radius.
Definition TGeoTorus.h:17
Class describing translations.
Definition TGeoMatrix.h:116
A general trapezoid.
Definition TGeoArb8.h:96
A trapezoid with only X varying with Z.
Definition TGeoTrd1.h:17
A trapezoid with only X varying with Z.
Definition TGeoTrd2.h:17
static TObject * GetSelected()
static; return selected object
A tube segment is a tube having a range in phi.
Definition TGeoTube.h:94
Cylindrical tube class.
Definition TGeoTube.h:17
Volume assemblies.
Definition TGeoVolume.h:316
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:48
Mother of all ROOT objects.
Definition TObject.h:41
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:525
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
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
TF1 * f1
Definition legend1.C:11