Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoVolumeEditor.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 TGeoVolumeEditor
13\ingroup Geometry_builder
14
15Editor for geometry volumes and assemblies of volumes. Besides the volume
16name and line attributes, a TGeoVolume has the following editable categories
17split vertically by a shutter:
18
19 - Properties: one can edit the shape and medium components from here. It is
20 also possible to change the existing ones.
21 - Daughters: the main category allowing defining, editing, removing or
22 positioning daughter volumes inside the current edited volume. To add a
23 daughter, one needs to select first a volume and a matrix. Currently no check
24 is performed if the daughter volume creates an extrusion (illegal for tracking).
25 To remove or change the position of an existing daughter, one should simply
26 select the desired daughter from the combo box with the existing ones, then
27 simply click the appropriate button.
28 - Visualization: One can set the visibility of the volume and of its daughters,
29 set the visibility depth and the view type. Selecting "All" will draw the
30 volume and all visible daughters down to the selected level starting from the
31 edited volume. Selecting "Leaves" will draw just the deepest daughters within
32 the selected visibility level, without displaying the containers, while "Only"
33 will just draw the edited volume.
34 - Division: The category becomes active only if there are no daughters of the
35 edited volume added by normal positioning (e.g. from `<Daughters>` category). The
36 minimum allowed starting value for the selected division axis is automatically
37 selected, while the slicing step is set to 0 - meaning that only the number
38 of slices matter.
39*/
40
41#include "TGeoVolumeEditor.h"
42#include "TGeoVolume.h"
43#include "TGeoPatternFinder.h"
44#include "TGeoManager.h"
45#include "TGeoMatrix.h"
46#include "TGTab.h"
47#include "TGComboBox.h"
48#include "TGButton.h"
49#include "TGButtonGroup.h"
50#include "TGTextEntry.h"
51#include "TGNumberEntry.h"
52#include "TGLabel.h"
53#include "TGShutter.h"
54#include "TG3DLine.h"
55#include "TGeoTabManager.h"
56#include "TGedEditor.h"
57
59
85
86////////////////////////////////////////////////////////////////////////////////
87/// Constructor for volume editor.
88
90 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
91{
92 fGeometry = nullptr;
93 fVolume = nullptr;
94
98
99 // TGShutter for categories
101 TGCompositeFrame *container, *f1;
102 Pixel_t color;
103 TGLabel *label;
104
105 // General settings
106 TGShutterItem *si = new TGShutterItem(fCategories, new TGHotString("Properties"), kCAT_GENERAL);
107 container = (TGCompositeFrame *)si->GetContainer();
109 fCategories->AddItem(si);
110
111 // TextEntry for volume name
112 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
113 f1->AddFrame(label = new TGLabel(f1, "Volume name"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
114 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
115 gClient->GetColorByName("#ff0000", color);
116 label->SetTextColor(color);
117 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
118 fVolumeName = new TGTextEntry(container, "", kVOL_NAME);
119 fVolumeName->SetDefaultSize(135, fVolumeName->GetDefaultHeight());
120 fVolumeName->SetToolTipText("Enter the volume name");
121 container->AddFrame(fVolumeName, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 3, 1, 2, 5));
122
123 // Current shape
124 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
125 f1->AddFrame(label = new TGLabel(f1, "Shape and medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
126 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
127 gClient->GetColorByName("#ff0000", color);
128 label->SetTextColor(color);
129 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 10, 0));
130 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame);
131 fSelectedShape = nullptr;
132 fLSelShape = new TGLabel(f1, "Select shape");
133 gClient->GetColorByName("#0000ff", color);
134 fLSelShape->SetTextColor(color);
135 fLSelShape->ChangeOptions(kSunkenFrame | kDoubleBorder);
136 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
137 fBSelShape = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_SHAPE_SELECT);
138 fBSelShape->SetToolTipText("Replace with one of the existing shapes");
139 fBSelShape->Associate(this);
140 f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
141 fEditShape = new TGTextButton(f1, "Edit");
142 f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
143 fEditShape->SetToolTipText("Edit selected shape");
144 fEditShape->Associate(this);
145 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
146
147 // Current medium
148 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame);
149 fSelectedMedium = nullptr;
150 fLSelMedium = new TGLabel(f1, "Select medium");
151 gClient->GetColorByName("#0000ff", color);
152 fLSelMedium->SetTextColor(color);
153 fLSelMedium->ChangeOptions(kSunkenFrame | kDoubleBorder);
154 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
155 fBSelMedium = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_MEDIA_SELECT);
156 fBSelMedium->SetToolTipText("Replace with one of the existing media");
157 fBSelMedium->Associate(this);
158 f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
159 fEditMedium = new TGTextButton(f1, "Edit");
160 f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
161 fEditMedium->SetToolTipText("Edit selected medium");
162 fEditMedium->Associate(this);
163 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
164
165 // List of daughters
166 si = new TGShutterItem(fCategories, new TGHotString("Daughters"), kCAT_DAUGHTERS);
167 container = (TGCompositeFrame *)si->GetContainer();
169 fCategories->AddItem(si);
170
171 // Existing daughters
172 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
173 f1->AddFrame(label = new TGLabel(f1, "Existing daughters"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
174 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
175 gClient->GetColorByName("#ff0000", color);
176 label->SetTextColor(color);
177 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
178
179 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kRaisedFrame);
181 fNodeList->Resize(100, fVolumeName->GetDefaultHeight());
182 fNodeList->Associate(this);
183 f1->AddFrame(fNodeList, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
184 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
185 // Buttons for editing matrix and removing node
186 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kSunkenFrame | kFixedWidth);
187 fEditMatrix = new TGTextButton(f1, "Position");
188 f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
189 fEditMatrix->SetToolTipText("Edit the position of selected node");
190 fEditMatrix->Associate(this);
191 fRemoveNode = new TGTextButton(f1, "Remove");
192 f1->AddFrame(fRemoveNode, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
193 fRemoveNode->SetToolTipText("Remove the selected node. Cannot undo !)");
194 fRemoveNode->Associate(this);
195 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
196
197 // Adding daughters
198 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
199 f1->AddFrame(label = new TGLabel(f1, "Add daughter"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
200 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
201 gClient->GetColorByName("#ff0000", color);
202 label->SetTextColor(color);
203 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 10, 0));
204
205 // Select from existing volumes
206 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
207 fSelectedVolume = nullptr;
208 fLSelVolume = new TGLabel(f1, "Select volume");
209 gClient->GetColorByName("#0000ff", color);
210 fLSelVolume->SetTextColor(color);
211 fLSelVolume->ChangeOptions(kSunkenFrame | kDoubleBorder);
212 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
213 fBSelVolume = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_VOL_SELECT);
214 fBSelVolume->SetToolTipText("Select one of the existing volumes");
215 fBSelVolume->Associate(this);
216 f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
217 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
218
219 // Matrix selection for nodes
220 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
221 fSelectedMatrix = nullptr;
222 fLSelMatrix = new TGLabel(f1, "Select matrix");
223 gClient->GetColorByName("#0000ff", color);
224 fLSelMatrix->SetTextColor(color);
225 fLSelMatrix->ChangeOptions(kSunkenFrame | kDoubleBorder);
226 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
227 fBSelMatrix = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_MATRIX_SELECT);
228 fBSelMatrix->SetToolTipText("Select one of the existing matrices");
229 fBSelMatrix->Associate(this);
230 f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
231 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
232
233 // Copy number
234 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
235 f1->AddFrame(new TGLabel(f1, "Node id"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
239 fCopyNumber->Resize(20, fCopyNumber->GetDefaultHeight());
240 TGTextEntry *nef = (TGTextEntry *)fCopyNumber->GetNumberEntry();
241 nef->SetToolTipText("Enter node copy number");
242 fCopyNumber->Associate(this);
243 f1->AddFrame(fCopyNumber, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
244 fAddNode = new TGTextButton(f1, "Add");
245 f1->AddFrame(fAddNode, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
246 fAddNode->Associate(this);
247 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
248
249 // Visualization
250 si = new TGShutterItem(fCategories, new TGHotString("Visualization"), kCAT_VIS);
251 container = (TGCompositeFrame *)si->GetContainer();
253 fCategories->AddItem(si);
254
255 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
256 f1->AddFrame(/* label = */ new TGLabel(f1, "Visibility"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
257 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
258 // gClient->GetColorByName("#ff0000", color);
259 // label->SetTextColor(color);
260 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
261
263 fBVis[0] = new TGCheckButton(f1, "Volume");
264 fBVis[1] = new TGCheckButton(f1, "Nodes");
265 f1->AddFrame(fBVis[0], new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
266 f1->AddFrame(fBVis[1], new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
267 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
268
269 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
270 f1->AddFrame(new TGLabel(f1, "Depth"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
271 // gClient->GetColorByName("#0000ff", color);
272 // label->SetTextColor(color);
276 fEVisLevel->Resize(40, fEVisLevel->GetDefaultHeight());
277 nef = (TGTextEntry *)fEVisLevel->GetNumberEntry();
278 nef->SetToolTipText("Set visibility level here");
279 fEVisLevel->SetNumber(3);
280 fEVisLevel->Associate(this);
281 f1->AddFrame(fEVisLevel, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
282 fBAuto = new TGCheckButton(f1, "Auto");
283 f1->AddFrame(fBAuto, new TGLayoutHints(kLHintsRight, 0, 0, 2, 0));
284 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
285
286 TString stitle = "View";
287 TGButtonGroup *bg = new TGVButtonGroup(container, stitle);
288 fBView[0] = new TGRadioButton(bg, "All");
289 fBView[1] = new TGRadioButton(bg, "Leaves");
290 fBView[2] = new TGRadioButton(bg, "Only");
292 bg->Show();
293 container->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
294
296 fBRaytrace = new TGCheckButton(f1, "Raytrace");
297 f1->AddFrame(fBRaytrace, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
298 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
299
300 // Division
301 si = new TGShutterItem(fCategories, new TGHotString("Division"), kCAT_DIVISION);
302 container = (TGCompositeFrame *)si->GetContainer();
304 fCategories->AddItem(si);
305 // TextEntry for division name
306 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
307 f1->AddFrame(label = new TGLabel(f1, "Division name"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
308 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
309 gClient->GetColorByName("#ff0000", color);
310 label->SetTextColor(color);
311 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
312 fDivName = new TGTextEntry(container, new TGTextBuffer(50), kDIV_NAME);
313 fDivName->Resize(135, fVolumeName->GetDefaultHeight());
314 fDivName->SetToolTipText("Enter the volume name");
315 container->AddFrame(fDivName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
316 // Axis selection
317 stitle = "Axis";
318 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
319 bg = new TGVButtonGroup(f1, stitle);
320 fBDiv[0] = new TGRadioButton(bg, "Axis 1");
321 fBDiv[1] = new TGRadioButton(bg, "Axis 2");
322 fBDiv[2] = new TGRadioButton(bg, "Axis 3");
323 bg->Insert(fBDiv[0]);
324 bg->Insert(fBDiv[1]);
325 bg->Insert(fBDiv[2]);
327 f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
328 fApplyDiv = new TGTextButton(f1, "Apply");
329 fApplyDiv->SetToolTipText("Apply new division settings");
330 f1->AddFrame(fApplyDiv, new TGLayoutHints(kLHintsRight, 0, 2, 30, 0));
331 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
332 // Division range
333 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
334 f1->AddFrame(/* label = */ new TGLabel(f1, "Division parameters"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
335 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
336 // gClient->GetColorByName("#ff0000", color);
337 // label->SetTextColor(color);
338 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
339 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
340 f1->AddFrame(/* label = */ new TGLabel(f1, "From"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
341 // gClient->GetColorByName("#0000ff", color);
342 // label->SetTextColor(color);
344 // fEDivFrom->SetNumStyle(TGNumberFormat::kNESInteger);
345 // fEDivFrom->SetNumAttr(TGNumberFormat::kNEAPositive);
346 fEDivFrom->Resize(100, fEDivFrom->GetDefaultHeight());
347 nef = (TGTextEntry *)fEDivFrom->GetNumberEntry();
348 nef->SetToolTipText("Set start value");
349 fEDivFrom->Associate(this);
350 f1->AddFrame(fEDivFrom, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
351 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
352
353 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
354 f1->AddFrame(/* label = */ new TGLabel(f1, "Step"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
355 // gClient->GetColorByName("#0000ff", color);
356 // label->SetTextColor(color);
358 // fEDivFrom->SetNumStyle(TGNumberFormat::kNESInteger);
360 fEDivStep->Resize(100, fEDivStep->GetDefaultHeight());
361 nef = (TGTextEntry *)fEDivStep->GetNumberEntry();
362 nef->SetToolTipText("Set division step");
363 fEDivStep->Associate(this);
364 f1->AddFrame(fEDivStep, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
365 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
366
367 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
368 f1->AddFrame(/* label = */ new TGLabel(f1, "Nslices"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
369 // gClient->GetColorByName("#0000ff", color);
370 // label->SetTextColor(color);
371 fEDivN = new TGNumberEntry(f1, 0, 5, kVOL_DIVN);
374 fEDivN->Resize(100, fEDivN->GetDefaultHeight());
375 nef = (TGTextEntry *)fEDivN->GetNumberEntry();
376 nef->SetToolTipText("Set number of slices");
377 fEDivN->Associate(this);
378 f1->AddFrame(fEDivN, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
379 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
380
381 fCategories->Resize(163, 340);
383
384 fCategories->Layout();
385 fCategories->SetDefaultSize(GetDefaultWidth(), GetDefaultHeight());
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// Destructor
390
392{
393 TGCompositeFrame *cont;
394 cont = (TGCompositeFrame *)fCategories->GetItem("Properties")->GetContainer();
396 fCategories->GetItem("Properties")->SetCleanup(0);
397 cont = (TGCompositeFrame *)fCategories->GetItem("Daughters")->GetContainer();
399 fCategories->GetItem("Daughters")->SetCleanup(0);
400 cont = (TGCompositeFrame *)fCategories->GetItem("Visualization")->GetContainer();
402 fCategories->GetItem("Visualization")->SetCleanup(0);
403 cont = (TGCompositeFrame *)fCategories->GetItem("Division")->GetContainer();
405 fCategories->GetItem("Division")->SetCleanup(0);
406
407 delete fBView[0];
408 delete fBView[1];
409 delete fBView[2];
410 delete fBDiv[0];
411 delete fBDiv[1];
412 delete fBDiv[2];
413 Cleanup();
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Connect signals to slots.
418
420{
421 fVolumeName->Connect("TextChanged(const char *)", "TGeoVolumeEditor", this, "DoVolumeName()");
422 fDivName->Connect("TextChanged(const char *)", "TGeoVolumeEditor", this, "DoDivName()");
423 fEditMedium->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditMedium()");
424 fEditShape->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditShape()");
425 fEditMatrix->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditMatrix()");
426 fAddNode->Connect("Clicked()", "TGeoVolumeEditor", this, "DoAddNode()");
427 fRemoveNode->Connect("Clicked()", "TGeoVolumeEditor", this, "DoRemoveNode()");
428 fBSelShape->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectShape()");
429 fBSelMedium->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectMedium()");
430 fBSelVolume->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectVolume()");
431 fBSelMatrix->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectMatrix()");
432 fBVis[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisVolume()");
433 fBVis[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisDaughters()");
434 fBAuto->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisAuto()");
435 fEVisLevel->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoVisLevel()");
436 fBView[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewAll()");
437 fBView[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewLeaves()");
438 fBView[2]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewOnly()");
439 fBDiv[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
440 fBDiv[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
441 fBDiv[2]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
442 fEDivFrom->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivFromTo()");
443 fEDivStep->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivStep()");
444 fEDivN->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivN()");
445 fBRaytrace->Connect("Clicked()", "TGeoVolumeEditor", this, "DoRaytrace()");
446 fApplyDiv->Connect("Clicked()", "TGeoVolumeEditor", this, "DoApplyDiv()");
447}
448
449////////////////////////////////////////////////////////////////////////////////
450/// Connect to the picked volume.
451
453{
454 if (obj == nullptr || !obj->InheritsFrom(TGeoVolume::Class())) {
456 return;
457 }
458 fVolume = (TGeoVolume *)obj;
459 fGeometry = fVolume->GetGeoManager();
460 const char *vname = fVolume->GetName();
461 fVolumeName->SetText(vname);
462 fSelectedShape = fVolume->GetShape();
463 if (fSelectedShape)
464 fLSelShape->SetText(fSelectedShape->GetName());
465 fSelectedMedium = fVolume->GetMedium();
466 if (fSelectedMedium)
467 fLSelMedium->SetText(fSelectedMedium->GetName());
468
469 fNodeList->RemoveEntries(0, fNodeList->GetNumberOfEntries() + 1);
470 TIter next2(fVolume->GetNodes());
471 TGeoNode *node;
472 Int_t icrt = 0;
473 while ((node = (TGeoNode *)next2()))
474 fNodeList->AddEntry(node->GetName(), icrt++);
475 fNodeList->Select(0);
476 fCopyNumber->SetNumber(fVolume->GetNdaughters() + 1);
477 if (!fVolume->GetNdaughters() || fVolume->GetFinder()) {
478 fEditMatrix->SetEnabled(kFALSE);
479 fRemoveNode->SetEnabled(kFALSE);
480 } else {
481 fEditMatrix->SetEnabled(kTRUE);
482 fRemoveNode->SetEnabled(kTRUE);
483 }
484 if (!fSelectedVolume)
485 fAddNode->SetEnabled(kFALSE);
486 if (fVolume->IsAssembly()) {
487 fBSelShape->SetEnabled(kFALSE);
488 fBSelMedium->SetEnabled(kFALSE);
489 }
490 fBVis[0]->SetState((fVolume->IsVisible()) ? kButtonDown : kButtonUp);
491 fBVis[1]->SetState((fVolume->IsVisibleDaughters()) ? kButtonDown : kButtonUp);
492 fBView[0]->SetState((fVolume->IsVisContainers()) ? kButtonDown : kButtonUp, kTRUE);
493 fBView[1]->SetState((fVolume->IsVisLeaves()) ? kButtonDown : kButtonUp, kTRUE);
494 fBView[2]->SetState((fVolume->IsVisOnly()) ? kButtonDown : kButtonUp, kTRUE);
495 fBRaytrace->SetState((fVolume->IsRaytracing()) ? kButtonDown : kButtonUp);
496 fBAuto->SetState((fGeometry->GetVisLevel()) ? kButtonUp : kButtonDown);
497 fEVisLevel->SetNumber(fGeometry->GetVisLevel());
498 fApplyDiv->SetEnabled(kFALSE);
499 if ((!fVolume->GetFinder() && fVolume->GetNdaughters()) || fVolume->IsAssembly()) {
500 fCategories->GetItem("Division")->GetButton()->SetEnabled(kFALSE);
501 } else {
502 fCategories->GetItem("Division")->GetButton()->SetEnabled(kTRUE);
503 Double_t start = 0., step = 0., end = 0.;
504 Int_t ndiv = 2, iaxis = 1;
505 TString axis_name;
506 for (Int_t i = 0; i < 3; i++) {
507 axis_name = fVolume->GetShape()->GetAxisName(i + 1);
508 fBDiv[i]->SetText(axis_name);
509 }
510
511 if (fVolume->GetFinder()) {
512 fDivName->SetText(fVolume->GetNode(0)->GetVolume()->GetName());
513 iaxis = fVolume->GetFinder()->GetDivAxis();
514 start = fVolume->GetFinder()->GetStart();
515 step = fVolume->GetFinder()->GetStep();
516 ndiv = fVolume->GetFinder()->GetNdiv();
517 } else {
518 fDivName->SetText("Enter name");
519 fSelectedShape->GetAxisRange(iaxis, start, end);
520 step = 0;
521 }
522 fBDiv[iaxis - 1]->SetState(kButtonDown, kTRUE);
523 fEDivFrom->SetNumber(start);
524 fEDivStep->SetNumber(step);
525 fEDivN->SetNumber(ndiv);
526 }
527
528 if (fInit)
530 SetActive();
531 if (GetParent() == fTabMgr->GetVolumeTab())
532 fTab->Layout();
533}
534
535////////////////////////////////////////////////////////////////////////////////
536/// Add editors to fGedFrame and exclude TLineEditor.
537
543
544////////////////////////////////////////////////////////////////////////////////
545/// Modify volume name.
546
548{
549 fVolume->SetName(fVolumeName->GetText());
550}
551
552////////////////////////////////////////////////////////////////////////////////
553/// Select a new shape.
554
556{
557 TGeoShape *shape = fSelectedShape;
558 new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200, 300);
560 if (fSelectedShape)
561 fLSelShape->SetText(fSelectedShape->GetName());
562 else
563 fSelectedShape = shape;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Select a new medium.
568
570{
572 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200, 300);
574 if (fSelectedMedium)
575 fLSelMedium->SetText(fSelectedMedium->GetName());
576 else
577 fSelectedMedium = med;
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Select a matrix for positioning.
582
584{
585 TGeoMatrix *matrix = fSelectedMatrix;
586 new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200, 300);
588 if (fSelectedMatrix)
589 fLSelMatrix->SetText(fSelectedMatrix->GetName());
590 else
591 fSelectedMatrix = matrix;
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Select a daughter volume.
596
598{
600 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200, 300);
602 if (fSelectedVolume)
603 fLSelVolume->SetText(fSelectedVolume->GetName());
604 else
605 fSelectedVolume = vol;
606 if (fSelectedVolume)
607 fAddNode->SetEnabled(kTRUE);
608}
609
610////////////////////////////////////////////////////////////////////////////////
611/// Edit the shape of the volume.
612
614{
615 fTabMgr->GetShapeEditor(fVolume->GetShape());
616}
617
618////////////////////////////////////////////////////////////////////////////////
619/// Edit the medium of the volume.
620
622{
623 fTabMgr->GetMediumEditor(fVolume->GetMedium());
624}
625
626////////////////////////////////////////////////////////////////////////////////
627/// Edit the position of the selected node.
628
630{
631 if (!fVolume->GetNdaughters())
632 return;
633 Int_t i = fNodeList->GetSelected();
634 if (i < 0)
635 return;
636 fTabMgr->GetMatrixEditor(fVolume->GetNode(i)->GetMatrix());
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Add a daughter.
641
643{
644 if (!fSelectedVolume || fVolume->GetFinder())
645 return;
646 Int_t icopy = fCopyNumber->GetIntNumber();
647 fVolume->AddNode(fSelectedVolume, icopy, fSelectedMatrix);
648 Int_t nd = fVolume->GetNdaughters();
649 fNodeList->AddEntry(fVolume->GetNode(nd - 1)->GetName(), nd - 1);
650 fNodeList->Select(nd - 1);
651 fCopyNumber->SetNumber(nd + 1);
652 if (fSelectedMatrix)
653 fEditMatrix->SetEnabled(kTRUE);
654 fRemoveNode->SetEnabled(kTRUE);
655 fGeometry->SetTopVisible();
656 fEditMatrix->SetEnabled(kTRUE);
657 fRemoveNode->SetEnabled(kTRUE);
658 Update();
659}
660
661////////////////////////////////////////////////////////////////////////////////
662/// Remove a daughter.
663
665{
666 if (!fVolume->GetNdaughters() || fVolume->GetFinder()) {
667 fRemoveNode->SetEnabled(kFALSE);
668 fEditMatrix->SetEnabled(kFALSE);
669 return;
670 }
671 Int_t i = fNodeList->GetSelected();
672 if (i < 0)
673 return;
674 fVolume->RemoveNode(fVolume->GetNode(i));
675 fNodeList->RemoveEntries(0, fNodeList->GetNumberOfEntries() + 1);
676 TIter next(fVolume->GetNodes());
677 TGeoNode *node;
678 i = 0;
679 while ((node = (TGeoNode *)next()))
680 fNodeList->AddEntry(node->GetName(), i++);
681 fNodeList->Select(0);
682 fCopyNumber->SetNumber(fVolume->GetNdaughters() + 1);
683 if (!fVolume->GetNdaughters()) {
684 fRemoveNode->SetEnabled(kFALSE);
685 fEditMatrix->SetEnabled(kFALSE);
686 fCategories->GetItem("Division")->GetButton()->SetEnabled(kTRUE);
687 Double_t start = 0., step = 0., end = 0.;
688 Int_t ndiv = 2, iaxis = 1;
689 fSelectedShape->GetAxisRange(iaxis, start, end);
690 step = end - start;
691 fBDiv[iaxis - 1]->SetState(kButtonDown, kTRUE);
692 fEDivFrom->SetNumber(start);
693 fEDivStep->SetNumber(step);
694 fEDivN->SetNumber(ndiv);
695 }
696 Update();
697}
698
699////////////////////////////////////////////////////////////////////////////////
700/// Slot for setting volume visible/invisible.
701
703{
704 Bool_t on = (fBVis[0]->GetState() == kButtonDown) ? kTRUE : kFALSE;
705 if (fVolume->IsVisible() == on)
706 return;
707 fVolume->SetVisibility(on);
708 Update();
709}
710
711////////////////////////////////////////////////////////////////////////////////
712/// Slot for setting daughters visible/invisible.
713
715{
716 Bool_t on = (fBVis[1]->GetState() == kButtonDown) ? kTRUE : kFALSE;
717 if (fVolume->IsVisibleDaughters() == on)
718 return;
719 fVolume->VisibleDaughters(on);
720 Update();
721}
722
723////////////////////////////////////////////////////////////////////////////////
724/// Slot for setting visibility depth auto.
725
727{
728 Bool_t on = (fBAuto->GetState() == kButtonDown) ? kTRUE : kFALSE;
729 if ((fGeometry->GetVisLevel() == 0) == on)
730 return;
731 if (on)
732 fGeometry->SetVisLevel(0);
733 else
734 fGeometry->SetVisLevel(fEVisLevel->GetIntNumber());
735 Update();
736}
737
738////////////////////////////////////////////////////////////////////////////////
739/// Slot for visibility level.
740
742{
743 fBAuto->SetState(kButtonUp);
744 fGeometry->SetVisLevel(fEVisLevel->GetIntNumber());
745 Update();
746}
747
748////////////////////////////////////////////////////////////////////////////////
749/// Slot for viewing volume and containers.
750
752{
753 Bool_t on = (fBView[0]->GetState() == kButtonDown) ? kTRUE : kFALSE;
754 if (!on)
755 return;
756 if (fVolume->IsVisContainers() == on)
757 return;
758 if (fVolume->IsRaytracing()) {
759 fVolume->Raytrace(kFALSE);
760 fBRaytrace->SetState(kButtonUp);
761 }
762 fVolume->SetVisContainers(on);
763 Update();
764}
765
766////////////////////////////////////////////////////////////////////////////////
767/// Slot for viewing last leaves only.
768
770{
771 Bool_t on = (fBView[1]->GetState() == kButtonDown) ? kTRUE : kFALSE;
772 if (!on)
773 return;
774 if (fVolume->IsVisLeaves() == on)
775 return;
776 if (fVolume->IsRaytracing()) {
777 fVolume->Raytrace(kFALSE);
778 fBRaytrace->SetState(kButtonUp);
779 }
780 fVolume->SetVisLeaves(on);
781 Update();
782}
783
784////////////////////////////////////////////////////////////////////////////////
785/// Slot for viewing volume only.
786
788{
789 Bool_t on = (fBView[2]->GetState() == kButtonDown) ? kTRUE : kFALSE;
790 if (!on)
791 return;
792 if (fVolume->IsVisOnly() == on)
793 return;
794 if (fVolume->IsRaytracing()) {
795 fVolume->Raytrace(kFALSE);
796 fBRaytrace->SetState(kButtonUp);
797 }
798 fVolume->SetVisOnly(on);
799 Update();
800}
801
802////////////////////////////////////////////////////////////////////////////////
803/// Slot for raytracing.
804
806{
807 Bool_t on = (fBRaytrace->GetState() == kButtonDown) ? kTRUE : kFALSE;
808 if (fVolume->IsRaytracing() == on)
809 return;
810 fVolume->Raytrace(on);
811 Update();
812}
813
814////////////////////////////////////////////////////////////////////////////////
815/// Modify division name.
816
818{
819 fApplyDiv->SetEnabled(kTRUE);
820}
821
822////////////////////////////////////////////////////////////////////////////////
823/// Change division axis and preserve number of slices.
824
826{
827 Int_t iaxis = 1;
828 for (Int_t i = 0; i < 3; i++) {
829 if (fBDiv[i]->GetState() != kButtonDown)
830 continue;
831 iaxis = i + 1;
832 break;
833 }
834 TGeoShape *shape = fVolume->GetShape();
835 if (!shape) {
836 fApplyDiv->SetEnabled(kFALSE);
837 return;
838 }
839 Double_t xlo, xhi;
840 shape->GetAxisRange(iaxis, xlo, xhi);
841 if (xhi <= xlo) {
842 fApplyDiv->SetEnabled(kFALSE);
843 return;
844 }
845 fEDivFrom->SetNumber(xlo);
846 fEDivStep->SetNumber(0);
847 fApplyDiv->SetEnabled(kTRUE);
848}
849
850////////////////////////////////////////////////////////////////////////////////
851/// Handle division range modification.
852
854{
855 Double_t min, max, xlo, xhi, step;
856 Int_t iaxis = 1;
857 Int_t ndiv;
858 for (Int_t i = 0; i < 3; i++) {
859 if (fBDiv[i]->GetState() != kButtonDown)
860 continue;
861 iaxis = i + 1;
862 break;
863 }
864 TGeoShape *shape = fVolume->GetShape();
865 if (!shape) {
866 fApplyDiv->SetEnabled(kFALSE);
867 return;
868 }
869 shape->GetAxisRange(iaxis, xlo, xhi);
870 if (xhi - xlo <= 0) {
871 fApplyDiv->SetEnabled(kFALSE);
872 return;
873 }
874 min = fEDivFrom->GetNumber();
875 step = fEDivStep->GetNumber();
876 ndiv = fEDivN->GetIntNumber();
877 if (min < xlo) {
878 min = xlo;
879 fEDivFrom->SetNumber(xlo);
880 }
881 max = min + ndiv * step;
882 if (max > xhi) {
883 max = xhi;
884 step = (max - min) / ndiv;
885 fEDivStep->SetNumber(step);
886 }
887 if (min >= max) {
888 fApplyDiv->SetEnabled(kFALSE);
889 return;
890 }
891 fApplyDiv->SetEnabled(kTRUE);
892}
893
894////////////////////////////////////////////////////////////////////////////////
895/// Handle division step modification.
896
898{
899 Double_t min, max, xlo, xhi;
900 Int_t iaxis = 1;
901 for (Int_t i = 0; i < 3; i++) {
902 if (fBDiv[i]->GetState() != kButtonDown)
903 continue;
904 iaxis = i + 1;
905 break;
906 }
907 TGeoShape *shape = fVolume->GetShape();
908 if (!shape) {
909 fApplyDiv->SetEnabled(kFALSE);
910 return;
911 }
912 shape->GetAxisRange(iaxis, xlo, xhi);
913 if (xhi - xlo <= 0) {
914 fApplyDiv->SetEnabled(kFALSE);
915 return;
916 }
917 min = fEDivFrom->GetNumber();
918 Double_t step = fEDivStep->GetNumber();
919 Int_t ndiv = fEDivN->GetIntNumber();
920 max = min + ndiv * step;
921
922 // Check if ndiv*step < max-min
923 if (max <= xhi) {
924 fApplyDiv->SetEnabled(kTRUE);
925 return;
926 }
927 // Step too big - set value to fit range
928 max = xhi;
929 step = (max - min) / ndiv;
930 fEDivStep->SetNumber(step);
931 if (step < 0) {
932 fApplyDiv->SetEnabled(kFALSE);
933 return;
934 }
935 fApplyDiv->SetEnabled(kTRUE);
936}
937
938////////////////////////////////////////////////////////////////////////////////
939/// Handle division N modification.
940
942{
943 Double_t min, max, xlo, xhi;
944 Int_t iaxis = 1;
945 for (Int_t i = 0; i < 3; i++) {
946 if (fBDiv[i]->GetState() != kButtonDown)
947 continue;
948 iaxis = i + 1;
949 break;
950 }
951 TGeoShape *shape = fVolume->GetShape();
952 if (!shape) {
953 fApplyDiv->SetEnabled(kFALSE);
954 return;
955 }
956 shape->GetAxisRange(iaxis, xlo, xhi);
957 if (xhi - xlo <= 0) {
958 fApplyDiv->SetEnabled(kFALSE);
959 return;
960 }
961 Double_t step = fEDivStep->GetNumber();
962 // If step=0 it is discounted
963 if (step == 0) {
964 fApplyDiv->SetEnabled(kTRUE);
965 return;
966 }
967 Int_t ndiv = fEDivN->GetIntNumber();
968 min = fEDivFrom->GetNumber();
969 max = min + ndiv * step;
970 // Check if ndiv*step < max-min
971 if (max <= xhi) {
972 fApplyDiv->SetEnabled(kTRUE);
973 return;
974 }
975 max = xhi;
976 ndiv = (Int_t)((max - min) / step);
977 fEDivN->SetNumber(ndiv);
978 fApplyDiv->SetEnabled(kTRUE);
979}
980
981////////////////////////////////////////////////////////////////////////////////
982/// Apply current division settings
983
985{
986 Double_t xlo, xhi, step;
987 Int_t iaxis = 1;
988 Int_t ndiv;
989 for (Int_t i = 0; i < 3; i++) {
990 if (fBDiv[i]->GetState() != kButtonDown)
991 continue;
992 iaxis = i + 1;
993 break;
994 }
995 TGeoShape *shape = fVolume->GetShape();
996 if (!shape) {
997 fApplyDiv->SetEnabled(kFALSE);
998 return;
999 }
1000 shape->GetAxisRange(iaxis, xlo, xhi);
1001 if (xhi - xlo <= 0) {
1002 fApplyDiv->SetEnabled(kFALSE);
1003 return;
1004 }
1005 xlo = fEDivFrom->GetNumber();
1006 step = fEDivStep->GetNumber();
1007 ndiv = fEDivN->GetIntNumber();
1008 TGeoPatternFinder *finder = fVolume->GetFinder();
1009 if (finder) {
1010 // we have to remove first the existing division
1011 TObjArray *nodes = fVolume->GetNodes();
1012 nodes->Delete();
1013 nodes->Clear();
1014 delete finder;
1015 fVolume->SetFinder(nullptr);
1016 }
1017 fVolume->Divide(fDivName->GetText(), iaxis, ndiv, xlo, step);
1018 fApplyDiv->SetEnabled(kFALSE);
1019 fGeometry->SetTopVisible();
1020 Update();
1021 // fVolume->Draw();
1022}
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
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
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
#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 TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
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
@ kCAT_GENERAL
@ kVOL_NODEID
@ kVOL_DIVSTEP
@ kCAT_VIS
@ kVOL_DIVEND
@ kVOL_EDIT_SHAPE
@ kVOL_EDIT_MEDIUM
@ kVOL_MATRIX_SELECT
@ kVOL_NAME
@ kVOL_NODE_SELECT
@ kVOL_UNDO
@ kVOL_SHAPE_SELECT
@ kVOL_VISLEVEL
@ kCAT_DIVISION
@ kVOL_APPLY
@ kVOL_DIVSTART
@ kVOL_MEDIA_SELECT
@ kVOL_CANCEL
@ kCAT_DAUGHTERS
@ kDIV_NAME
@ kVOL_DIVN
@ kVOL_VOL_SELECT
@ kVOL_TITLE
Int_t i
static TClass * Class()
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
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 Int_t Insert(TGButton *button, int id=-1)
Inserts a button with the identifier id into the button group.
Selects different options.
Definition TGButton.h:264
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
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:312
Int_t GetState(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1218
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:314
TGCompositeFrame(const TGCompositeFrame &)=delete
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.
@ 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
const TGWindow * GetParent() const
Definition TGWindow.h:83
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
TGedEditor * fGedEditor
manager of this frame
Definition TGedFrame.h:48
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
void Update() override
Override Update from TGedFrame as fGedEditor can be null.
TGeoGedFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor.
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
TGeoTabManager * fTabMgr
Geometrical transformation package.
Definition TGeoMatrix.h:38
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
Base finder class for patterns.
Base abstract class for all shapes.
Definition TGeoShape.h:25
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
static TObject * GetSelected()
static; return selected object
Editor for geometry volumes and assemblies of volumes.
TGPictureButton * fBSelMatrix
virtual void ConnectSignals2Slots()
Connect signals to slots.
TGTextButton * fApplyDiv
void DoApplyDiv()
Apply current division settings.
TGTextButton * fAddNode
TGPictureButton * fBSelShape
void DoRemoveNode()
Remove a daughter.
TGTextEntry * fVolumeName
TGNumberEntry * fEDivFrom
void DoSelectMatrix()
Select a matrix for positioning.
void DoEditMatrix()
Edit the position of the selected node.
void DoSelectMedium()
Select a new medium.
TGComboBox * fNodeList
void DoVisDaughters()
Slot for setting daughters visible/invisible.
TGNumberEntry * fEVisLevel
TGTextButton * fEditMatrix
TGNumberEntry * fEDivN
TGeoVolume * fVolume
TGTextButton * fEditShape
TGeoMedium * fSelectedMedium
TGeoVolume * fSelectedVolume
TGRadioButton * fBView[3]
void DoVisVolume()
Slot for setting volume visible/invisible.
TGeoShape * fSelectedShape
~TGeoVolumeEditor() override
Destructor.
void DoDivFromTo()
Handle division range modification.
void DoVisAuto()
Slot for setting visibility depth auto.
void DoViewLeaves()
Slot for viewing last leaves only.
void DoViewOnly()
Slot for viewing volume only.
TGCheckButton * fBVis[2]
TGNumberEntry * fEDivStep
TGTextButton * fRemoveNode
void DoDivStep()
Handle division step modification.
void DoVisLevel()
Slot for visibility level.
TGeoMatrix * fSelectedMatrix
void DoRaytrace()
Slot for raytracing.
void DoSelectVolume()
Select a daughter volume.
void DoEditShape()
Edit the shape of the volume.
TGTextEntry * fDivName
TGCheckButton * fBRaytrace
TGNumberEntry * fCopyNumber
TGPictureButton * fBSelVolume
TGCheckButton * fBAuto
TGeoManager * fGeometry
void DoEditMedium()
Edit the medium of the volume.
void SetModel(TObject *obj) override
Connect to the picked volume.
TGTextButton * fEditMedium
TGPictureButton * fBSelMedium
void DoDivN()
Handle division N modification.
void ActivateBaseClassEditors(TClass *cl) override
Add editors to fGedFrame and exclude TLineEditor.
TGShutter * fCategories
void DoSelectShape()
Select a new shape.
void DoViewAll()
Slot for viewing volume and containers.
void DoAddNode()
Add a daughter.
TGRadioButton * fBDiv[3]
void DoDivSelAxis()
Change division axis and preserve number of slices.
void DoDivName()
Modify division name.
TGeoVolumeEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for volume editor.
void DoVolumeName()
Modify volume name.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
static TClass * Class()
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
An array of TObjects.
Definition TObjArray.h:31
void Clear(Option_t *option="") override
Remove all objects from the array.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
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
Basic string class.
Definition TString.h:139
TF1 * f1
Definition legend1.C:11