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
58
84
85////////////////////////////////////////////////////////////////////////////////
86/// Constructor for volume editor.
87
89 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
90{
91 fGeometry = nullptr;
92 fVolume = nullptr;
93
97
98 // TGShutter for categories
100 TGCompositeFrame *container, *f1;
101 Pixel_t color;
102 TGLabel *label;
103
104 // General settings
105 TGShutterItem *si = new TGShutterItem(fCategories, new TGHotString("Properties"), kCAT_GENERAL);
106 container = (TGCompositeFrame *)si->GetContainer();
108 fCategories->AddItem(si);
109
110 // TextEntry for volume name
111 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
112 f1->AddFrame(label = new TGLabel(f1, "Volume name"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
113 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
114 gClient->GetColorByName("#ff0000", color);
115 label->SetTextColor(color);
116 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
117 fVolumeName = new TGTextEntry(container, "", kVOL_NAME);
118 fVolumeName->SetDefaultSize(135, fVolumeName->GetDefaultHeight());
119 fVolumeName->SetToolTipText("Enter the volume name");
120 container->AddFrame(fVolumeName, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 3, 1, 2, 5));
121
122 // Current shape
123 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
124 f1->AddFrame(label = new TGLabel(f1, "Shape and medium"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
125 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
126 gClient->GetColorByName("#ff0000", color);
127 label->SetTextColor(color);
128 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 10, 0));
129 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame);
130 fSelectedShape = nullptr;
131 fLSelShape = new TGLabel(f1, "Select shape");
132 gClient->GetColorByName("#0000ff", color);
133 fLSelShape->SetTextColor(color);
134 fLSelShape->ChangeOptions(kSunkenFrame | kDoubleBorder);
135 f1->AddFrame(fLSelShape, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
136 fBSelShape = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_SHAPE_SELECT);
137 fBSelShape->SetToolTipText("Replace with one of the existing shapes");
138 fBSelShape->Associate(this);
139 f1->AddFrame(fBSelShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
140 fEditShape = new TGTextButton(f1, "Edit");
141 f1->AddFrame(fEditShape, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
142 fEditShape->SetToolTipText("Edit selected shape");
143 fEditShape->Associate(this);
144 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
145
146 // Current medium
147 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame);
148 fSelectedMedium = nullptr;
149 fLSelMedium = new TGLabel(f1, "Select medium");
150 gClient->GetColorByName("#0000ff", color);
151 fLSelMedium->SetTextColor(color);
152 fLSelMedium->ChangeOptions(kSunkenFrame | kDoubleBorder);
153 f1->AddFrame(fLSelMedium, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
154 fBSelMedium = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_MEDIA_SELECT);
155 fBSelMedium->SetToolTipText("Replace with one of the existing media");
156 fBSelMedium->Associate(this);
157 f1->AddFrame(fBSelMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
158 fEditMedium = new TGTextButton(f1, "Edit");
159 f1->AddFrame(fEditMedium, new TGLayoutHints(kLHintsLeft, 1, 1, 2, 2));
160 fEditMedium->SetToolTipText("Edit selected medium");
161 fEditMedium->Associate(this);
162 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 0, 0));
163
164 // List of daughters
165 si = new TGShutterItem(fCategories, new TGHotString("Daughters"), kCAT_DAUGHTERS);
166 container = (TGCompositeFrame *)si->GetContainer();
168 fCategories->AddItem(si);
169
170 // Existing daughters
171 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
172 f1->AddFrame(label = new TGLabel(f1, "Existing daughters"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
173 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
174 gClient->GetColorByName("#ff0000", color);
175 label->SetTextColor(color);
176 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
177
178 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kRaisedFrame);
180 fNodeList->Resize(100, fVolumeName->GetDefaultHeight());
181 fNodeList->Associate(this);
182 f1->AddFrame(fNodeList, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
183 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
184 // Buttons for editing matrix and removing node
185 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kSunkenFrame | kFixedWidth);
186 fEditMatrix = new TGTextButton(f1, "Position");
187 f1->AddFrame(fEditMatrix, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
188 fEditMatrix->SetToolTipText("Edit the position of selected node");
189 fEditMatrix->Associate(this);
190 fRemoveNode = new TGTextButton(f1, "Remove");
191 f1->AddFrame(fRemoveNode, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
192 fRemoveNode->SetToolTipText("Remove the selected node. Cannot undo !)");
193 fRemoveNode->Associate(this);
194 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
195
196 // Adding daughters
197 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
198 f1->AddFrame(label = new TGLabel(f1, "Add daughter"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
199 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
200 gClient->GetColorByName("#ff0000", color);
201 label->SetTextColor(color);
202 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 10, 0));
203
204 // Select from existing volumes
205 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
206 fSelectedVolume = nullptr;
207 fLSelVolume = new TGLabel(f1, "Select volume");
208 gClient->GetColorByName("#0000ff", color);
209 fLSelVolume->SetTextColor(color);
210 fLSelVolume->ChangeOptions(kSunkenFrame | kDoubleBorder);
211 f1->AddFrame(fLSelVolume, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
212 fBSelVolume = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_VOL_SELECT);
213 fBSelVolume->SetToolTipText("Select one of the existing volumes");
214 fBSelVolume->Associate(this);
215 f1->AddFrame(fBSelVolume, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
216 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
217
218 // Matrix selection for nodes
219 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
220 fSelectedMatrix = nullptr;
221 fLSelMatrix = new TGLabel(f1, "Select matrix");
222 gClient->GetColorByName("#0000ff", color);
223 fLSelMatrix->SetTextColor(color);
224 fLSelMatrix->ChangeOptions(kSunkenFrame | kDoubleBorder);
225 f1->AddFrame(fLSelMatrix, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 1, 1, 2, 2));
226 fBSelMatrix = new TGPictureButton(f1, fClient->GetPicture("rootdb_t.xpm"), kVOL_MATRIX_SELECT);
227 fBSelMatrix->SetToolTipText("Select one of the existing matrices");
228 fBSelMatrix->Associate(this);
229 f1->AddFrame(fBSelMatrix, new TGLayoutHints(kLHintsRight, 1, 1, 2, 2));
230 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
231
232 // Copy number
233 f1 = new TGCompositeFrame(container, 155, 30, kHorizontalFrame | kFixedWidth);
234 f1->AddFrame(new TGLabel(f1, "Node id"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
238 fCopyNumber->Resize(20, fCopyNumber->GetDefaultHeight());
239 TGTextEntry *nef = (TGTextEntry *)fCopyNumber->GetNumberEntry();
240 nef->SetToolTipText("Enter node copy number");
241 fCopyNumber->Associate(this);
242 f1->AddFrame(fCopyNumber, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
243 fAddNode = new TGTextButton(f1, "Add");
244 f1->AddFrame(fAddNode, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
245 fAddNode->Associate(this);
246 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 2));
247
248 // Visualization
249 si = new TGShutterItem(fCategories, new TGHotString("Visualization"), kCAT_VIS);
250 container = (TGCompositeFrame *)si->GetContainer();
252 fCategories->AddItem(si);
253
254 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
255 f1->AddFrame(/* label = */ new TGLabel(f1, "Visibility"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
256 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
257 // gClient->GetColorByName("#ff0000", color);
258 // label->SetTextColor(color);
259 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
260
262 fBVis[0] = new TGCheckButton(f1, "Volume");
263 fBVis[1] = new TGCheckButton(f1, "Nodes");
264 f1->AddFrame(fBVis[0], new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
265 f1->AddFrame(fBVis[1], new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
266 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
267
268 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
269 f1->AddFrame(new TGLabel(f1, "Depth"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
270 // gClient->GetColorByName("#0000ff", color);
271 // label->SetTextColor(color);
275 fEVisLevel->Resize(40, fEVisLevel->GetDefaultHeight());
276 nef = (TGTextEntry *)fEVisLevel->GetNumberEntry();
277 nef->SetToolTipText("Set visibility level here");
278 fEVisLevel->SetNumber(3);
279 fEVisLevel->Associate(this);
280 f1->AddFrame(fEVisLevel, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
281 fBAuto = new TGCheckButton(f1, "Auto");
282 f1->AddFrame(fBAuto, new TGLayoutHints(kLHintsRight, 0, 0, 2, 0));
283 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
284
285 TString stitle = "View";
286 TGButtonGroup *bg = new TGVButtonGroup(container, stitle);
287 fBView[0] = new TGRadioButton(bg, "All");
288 fBView[1] = new TGRadioButton(bg, "Leaves");
289 fBView[2] = new TGRadioButton(bg, "Only");
291 bg->Show();
292 container->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
293
295 fBRaytrace = new TGCheckButton(f1, "Raytrace");
296 f1->AddFrame(fBRaytrace, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
297 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
298
299 // Division
300 si = new TGShutterItem(fCategories, new TGHotString("Division"), kCAT_DIVISION);
301 container = (TGCompositeFrame *)si->GetContainer();
303 fCategories->AddItem(si);
304 // TextEntry for division name
305 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
306 f1->AddFrame(label = new TGLabel(f1, "Division name"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
307 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
308 gClient->GetColorByName("#ff0000", color);
309 label->SetTextColor(color);
310 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
311 fDivName = new TGTextEntry(container, new TGTextBuffer(50), kDIV_NAME);
312 fDivName->Resize(135, fVolumeName->GetDefaultHeight());
313 fDivName->SetToolTipText("Enter the volume name");
314 container->AddFrame(fDivName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
315 // Axis selection
316 stitle = "Axis";
317 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
318 bg = new TGVButtonGroup(f1, stitle);
319 fBDiv[0] = new TGRadioButton(bg, "Axis 1");
320 fBDiv[1] = new TGRadioButton(bg, "Axis 2");
321 fBDiv[2] = new TGRadioButton(bg, "Axis 3");
322 bg->Insert(fBDiv[0]);
323 bg->Insert(fBDiv[1]);
324 bg->Insert(fBDiv[2]);
326 f1->AddFrame(bg, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
327 fApplyDiv = new TGTextButton(f1, "Apply");
328 fApplyDiv->SetToolTipText("Apply new division settings");
329 f1->AddFrame(fApplyDiv, new TGLayoutHints(kLHintsRight, 0, 2, 30, 0));
330 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
331 // Division range
332 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
333 f1->AddFrame(/* label = */ new TGLabel(f1, "Division parameters"), new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
334 f1->AddFrame(new TGHorizontal3DLine(f1), new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
335 // gClient->GetColorByName("#ff0000", color);
336 // label->SetTextColor(color);
337 container->AddFrame(f1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
338 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
339 f1->AddFrame(/* label = */ new TGLabel(f1, "From"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
340 // gClient->GetColorByName("#0000ff", color);
341 // label->SetTextColor(color);
343 // fEDivFrom->SetNumStyle(TGNumberFormat::kNESInteger);
344 // fEDivFrom->SetNumAttr(TGNumberFormat::kNEAPositive);
345 fEDivFrom->Resize(100, fEDivFrom->GetDefaultHeight());
346 nef = (TGTextEntry *)fEDivFrom->GetNumberEntry();
347 nef->SetToolTipText("Set start value");
348 fEDivFrom->Associate(this);
349 f1->AddFrame(fEDivFrom, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
350 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
351
352 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
353 f1->AddFrame(/* label = */ new TGLabel(f1, "Step"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
354 // gClient->GetColorByName("#0000ff", color);
355 // label->SetTextColor(color);
357 // fEDivFrom->SetNumStyle(TGNumberFormat::kNESInteger);
359 fEDivStep->Resize(100, fEDivStep->GetDefaultHeight());
360 nef = (TGTextEntry *)fEDivStep->GetNumberEntry();
361 nef->SetToolTipText("Set division step");
362 fEDivStep->Associate(this);
363 f1->AddFrame(fEDivStep, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
364 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
365
366 f1 = new TGCompositeFrame(container, 155, 10, kHorizontalFrame | kFixedWidth);
367 f1->AddFrame(/* label = */ new TGLabel(f1, "Nslices"), new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
368 // gClient->GetColorByName("#0000ff", color);
369 // label->SetTextColor(color);
370 fEDivN = new TGNumberEntry(f1, 0, 5, kVOL_DIVN);
373 fEDivN->Resize(100, fEDivN->GetDefaultHeight());
374 nef = (TGTextEntry *)fEDivN->GetNumberEntry();
375 nef->SetToolTipText("Set number of slices");
376 fEDivN->Associate(this);
377 f1->AddFrame(fEDivN, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
378 container->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
379
380 fCategories->Resize(163, 340);
382
383 fCategories->Layout();
384 fCategories->SetDefaultSize(GetDefaultWidth(), GetDefaultHeight());
385}
386
387////////////////////////////////////////////////////////////////////////////////
388/// Destructor
389
391{
392 TGCompositeFrame *cont;
393 cont = (TGCompositeFrame *)fCategories->GetItem("Properties")->GetContainer();
395 fCategories->GetItem("Properties")->SetCleanup(0);
396 cont = (TGCompositeFrame *)fCategories->GetItem("Daughters")->GetContainer();
398 fCategories->GetItem("Daughters")->SetCleanup(0);
399 cont = (TGCompositeFrame *)fCategories->GetItem("Visualization")->GetContainer();
401 fCategories->GetItem("Visualization")->SetCleanup(0);
402 cont = (TGCompositeFrame *)fCategories->GetItem("Division")->GetContainer();
404 fCategories->GetItem("Division")->SetCleanup(0);
405
406 delete fBView[0];
407 delete fBView[1];
408 delete fBView[2];
409 delete fBDiv[0];
410 delete fBDiv[1];
411 delete fBDiv[2];
412 Cleanup();
413}
414
415////////////////////////////////////////////////////////////////////////////////
416/// Connect signals to slots.
417
419{
420 fVolumeName->Connect("TextChanged(const char *)", "TGeoVolumeEditor", this, "DoVolumeName()");
421 fDivName->Connect("TextChanged(const char *)", "TGeoVolumeEditor", this, "DoDivName()");
422 fEditMedium->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditMedium()");
423 fEditShape->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditShape()");
424 fEditMatrix->Connect("Clicked()", "TGeoVolumeEditor", this, "DoEditMatrix()");
425 fAddNode->Connect("Clicked()", "TGeoVolumeEditor", this, "DoAddNode()");
426 fRemoveNode->Connect("Clicked()", "TGeoVolumeEditor", this, "DoRemoveNode()");
427 fBSelShape->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectShape()");
428 fBSelMedium->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectMedium()");
429 fBSelVolume->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectVolume()");
430 fBSelMatrix->Connect("Clicked()", "TGeoVolumeEditor", this, "DoSelectMatrix()");
431 fBVis[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisVolume()");
432 fBVis[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisDaughters()");
433 fBAuto->Connect("Clicked()", "TGeoVolumeEditor", this, "DoVisAuto()");
434 fEVisLevel->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoVisLevel()");
435 fBView[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewAll()");
436 fBView[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewLeaves()");
437 fBView[2]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoViewOnly()");
438 fBDiv[0]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
439 fBDiv[1]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
440 fBDiv[2]->Connect("Clicked()", "TGeoVolumeEditor", this, "DoDivSelAxis()");
441 fEDivFrom->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivFromTo()");
442 fEDivStep->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivStep()");
443 fEDivN->Connect("ValueSet(Long_t)", "TGeoVolumeEditor", this, "DoDivN()");
444 fBRaytrace->Connect("Clicked()", "TGeoVolumeEditor", this, "DoRaytrace()");
445 fApplyDiv->Connect("Clicked()", "TGeoVolumeEditor", this, "DoApplyDiv()");
446}
447
448////////////////////////////////////////////////////////////////////////////////
449/// Connect to the picked volume.
450
452{
453 if (obj == nullptr || !obj->InheritsFrom(TGeoVolume::Class())) {
455 return;
456 }
457 fVolume = (TGeoVolume *)obj;
458 fGeometry = fVolume->GetGeoManager();
459 const char *vname = fVolume->GetName();
460 fVolumeName->SetText(vname);
461 fSelectedShape = fVolume->GetShape();
462 if (fSelectedShape)
463 fLSelShape->SetText(fSelectedShape->GetName());
464 fSelectedMedium = fVolume->GetMedium();
465 if (fSelectedMedium)
466 fLSelMedium->SetText(fSelectedMedium->GetName());
467
468 fNodeList->RemoveEntries(0, fNodeList->GetNumberOfEntries() + 1);
469 TIter next2(fVolume->GetNodes());
470 TGeoNode *node;
471 Int_t icrt = 0;
472 while ((node = (TGeoNode *)next2()))
473 fNodeList->AddEntry(node->GetName(), icrt++);
474 fNodeList->Select(0);
475 fCopyNumber->SetNumber(fVolume->GetNdaughters() + 1);
476 if (!fVolume->GetNdaughters() || fVolume->GetFinder()) {
477 fEditMatrix->SetEnabled(kFALSE);
478 fRemoveNode->SetEnabled(kFALSE);
479 } else {
480 fEditMatrix->SetEnabled(kTRUE);
481 fRemoveNode->SetEnabled(kTRUE);
482 }
483 if (!fSelectedVolume)
484 fAddNode->SetEnabled(kFALSE);
485 if (fVolume->IsAssembly()) {
486 fBSelShape->SetEnabled(kFALSE);
487 fBSelMedium->SetEnabled(kFALSE);
488 }
489 fBVis[0]->SetState((fVolume->IsVisible()) ? kButtonDown : kButtonUp);
490 fBVis[1]->SetState((fVolume->IsVisibleDaughters()) ? kButtonDown : kButtonUp);
491 fBView[0]->SetState((fVolume->IsVisContainers()) ? kButtonDown : kButtonUp, kTRUE);
492 fBView[1]->SetState((fVolume->IsVisLeaves()) ? kButtonDown : kButtonUp, kTRUE);
493 fBView[2]->SetState((fVolume->IsVisOnly()) ? kButtonDown : kButtonUp, kTRUE);
494 fBRaytrace->SetState((fVolume->IsRaytracing()) ? kButtonDown : kButtonUp);
495 fBAuto->SetState((fGeometry->GetVisLevel()) ? kButtonUp : kButtonDown);
496 fEVisLevel->SetNumber(fGeometry->GetVisLevel());
497 fApplyDiv->SetEnabled(kFALSE);
498 if ((!fVolume->GetFinder() && fVolume->GetNdaughters()) || fVolume->IsAssembly()) {
499 fCategories->GetItem("Division")->GetButton()->SetEnabled(kFALSE);
500 } else {
501 fCategories->GetItem("Division")->GetButton()->SetEnabled(kTRUE);
502 Double_t start = 0., step = 0., end = 0.;
503 Int_t ndiv = 2, iaxis = 1;
504 TString axis_name;
505 for (Int_t i = 0; i < 3; i++) {
506 axis_name = fVolume->GetShape()->GetAxisName(i + 1);
507 fBDiv[i]->SetText(axis_name);
508 }
509
510 if (fVolume->GetFinder()) {
511 fDivName->SetText(fVolume->GetNode(0)->GetVolume()->GetName());
512 iaxis = fVolume->GetFinder()->GetDivAxis();
513 start = fVolume->GetFinder()->GetStart();
514 step = fVolume->GetFinder()->GetStep();
515 ndiv = fVolume->GetFinder()->GetNdiv();
516 } else {
517 fDivName->SetText("Enter name");
518 fSelectedShape->GetAxisRange(iaxis, start, end);
519 step = 0;
520 }
521 fBDiv[iaxis - 1]->SetState(kButtonDown, kTRUE);
522 fEDivFrom->SetNumber(start);
523 fEDivStep->SetNumber(step);
524 fEDivN->SetNumber(ndiv);
525 }
526
527 if (fInit)
529 SetActive();
530 if (GetParent() == fTabMgr->GetVolumeTab())
531 fTab->Layout();
532}
533
534////////////////////////////////////////////////////////////////////////////////
535/// Add editors to fGedFrame and exclude TLineEditor.
536
542
543////////////////////////////////////////////////////////////////////////////////
544/// Modify volume name.
545
547{
548 fVolume->SetName(fVolumeName->GetText());
549}
550
551////////////////////////////////////////////////////////////////////////////////
552/// Select a new shape.
553
555{
556 TGeoShape *shape = fSelectedShape;
557 new TGeoShapeDialog(fBSelShape, gClient->GetRoot(), 200, 300);
559 if (fSelectedShape)
560 fLSelShape->SetText(fSelectedShape->GetName());
561 else
562 fSelectedShape = shape;
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// Select a new medium.
567
569{
571 new TGeoMediumDialog(fBSelMedium, gClient->GetRoot(), 200, 300);
573 if (fSelectedMedium)
574 fLSelMedium->SetText(fSelectedMedium->GetName());
575 else
576 fSelectedMedium = med;
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Select a matrix for positioning.
581
583{
584 TGeoMatrix *matrix = fSelectedMatrix;
585 new TGeoMatrixDialog(fBSelMatrix, gClient->GetRoot(), 200, 300);
587 if (fSelectedMatrix)
588 fLSelMatrix->SetText(fSelectedMatrix->GetName());
589 else
590 fSelectedMatrix = matrix;
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Select a daughter volume.
595
597{
599 new TGeoVolumeDialog(fBSelVolume, gClient->GetRoot(), 200, 300);
601 if (fSelectedVolume)
602 fLSelVolume->SetText(fSelectedVolume->GetName());
603 else
604 fSelectedVolume = vol;
605 if (fSelectedVolume)
606 fAddNode->SetEnabled(kTRUE);
607}
608
609////////////////////////////////////////////////////////////////////////////////
610/// Edit the shape of the volume.
611
613{
614 fTabMgr->GetShapeEditor(fVolume->GetShape());
615}
616
617////////////////////////////////////////////////////////////////////////////////
618/// Edit the medium of the volume.
619
621{
622 fTabMgr->GetMediumEditor(fVolume->GetMedium());
623}
624
625////////////////////////////////////////////////////////////////////////////////
626/// Edit the position of the selected node.
627
629{
630 if (!fVolume->GetNdaughters())
631 return;
632 Int_t i = fNodeList->GetSelected();
633 if (i < 0)
634 return;
635 fTabMgr->GetMatrixEditor(fVolume->GetNode(i)->GetMatrix());
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Add a daughter.
640
642{
643 if (!fSelectedVolume || fVolume->GetFinder())
644 return;
645 Int_t icopy = fCopyNumber->GetIntNumber();
646 fVolume->AddNode(fSelectedVolume, icopy, fSelectedMatrix);
647 Int_t nd = fVolume->GetNdaughters();
648 fNodeList->AddEntry(fVolume->GetNode(nd - 1)->GetName(), nd - 1);
649 fNodeList->Select(nd - 1);
650 fCopyNumber->SetNumber(nd + 1);
651 if (fSelectedMatrix)
652 fEditMatrix->SetEnabled(kTRUE);
653 fRemoveNode->SetEnabled(kTRUE);
654 fGeometry->SetTopVisible();
655 fEditMatrix->SetEnabled(kTRUE);
656 fRemoveNode->SetEnabled(kTRUE);
657 Update();
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Remove a daughter.
662
664{
665 if (!fVolume->GetNdaughters() || fVolume->GetFinder()) {
666 fRemoveNode->SetEnabled(kFALSE);
667 fEditMatrix->SetEnabled(kFALSE);
668 return;
669 }
670 Int_t i = fNodeList->GetSelected();
671 if (i < 0)
672 return;
673 fVolume->RemoveNode(fVolume->GetNode(i));
674 fNodeList->RemoveEntries(0, fNodeList->GetNumberOfEntries() + 1);
675 TIter next(fVolume->GetNodes());
676 TGeoNode *node;
677 i = 0;
678 while ((node = (TGeoNode *)next()))
679 fNodeList->AddEntry(node->GetName(), i++);
680 fNodeList->Select(0);
681 fCopyNumber->SetNumber(fVolume->GetNdaughters() + 1);
682 if (!fVolume->GetNdaughters()) {
683 fRemoveNode->SetEnabled(kFALSE);
684 fEditMatrix->SetEnabled(kFALSE);
685 fCategories->GetItem("Division")->GetButton()->SetEnabled(kTRUE);
686 Double_t start = 0., step = 0., end = 0.;
687 Int_t ndiv = 2, iaxis = 1;
688 fSelectedShape->GetAxisRange(iaxis, start, end);
689 step = end - start;
690 fBDiv[iaxis - 1]->SetState(kButtonDown, kTRUE);
691 fEDivFrom->SetNumber(start);
692 fEDivStep->SetNumber(step);
693 fEDivN->SetNumber(ndiv);
694 }
695 Update();
696}
697
698////////////////////////////////////////////////////////////////////////////////
699/// Slot for setting volume visible/invisible.
700
702{
703 Bool_t on = (fBVis[0]->GetState() == kButtonDown) ? kTRUE : kFALSE;
704 if (fVolume->IsVisible() == on)
705 return;
706 fVolume->SetVisibility(on);
707 Update();
708}
709
710////////////////////////////////////////////////////////////////////////////////
711/// Slot for setting daughters visible/invisible.
712
714{
715 Bool_t on = (fBVis[1]->GetState() == kButtonDown) ? kTRUE : kFALSE;
716 if (fVolume->IsVisibleDaughters() == on)
717 return;
718 fVolume->VisibleDaughters(on);
719 Update();
720}
721
722////////////////////////////////////////////////////////////////////////////////
723/// Slot for setting visibility depth auto.
724
726{
727 Bool_t on = (fBAuto->GetState() == kButtonDown) ? kTRUE : kFALSE;
728 if ((fGeometry->GetVisLevel() == 0) == on)
729 return;
730 if (on)
731 fGeometry->SetVisLevel(0);
732 else
733 fGeometry->SetVisLevel(fEVisLevel->GetIntNumber());
734 Update();
735}
736
737////////////////////////////////////////////////////////////////////////////////
738/// Slot for visibility level.
739
741{
742 fBAuto->SetState(kButtonUp);
743 fGeometry->SetVisLevel(fEVisLevel->GetIntNumber());
744 Update();
745}
746
747////////////////////////////////////////////////////////////////////////////////
748/// Slot for viewing volume and containers.
749
751{
752 Bool_t on = (fBView[0]->GetState() == kButtonDown) ? kTRUE : kFALSE;
753 if (!on)
754 return;
755 if (fVolume->IsVisContainers() == on)
756 return;
757 if (fVolume->IsRaytracing()) {
758 fVolume->Raytrace(kFALSE);
759 fBRaytrace->SetState(kButtonUp);
760 }
761 fVolume->SetVisContainers(on);
762 Update();
763}
764
765////////////////////////////////////////////////////////////////////////////////
766/// Slot for viewing last leaves only.
767
769{
770 Bool_t on = (fBView[1]->GetState() == kButtonDown) ? kTRUE : kFALSE;
771 if (!on)
772 return;
773 if (fVolume->IsVisLeaves() == on)
774 return;
775 if (fVolume->IsRaytracing()) {
776 fVolume->Raytrace(kFALSE);
777 fBRaytrace->SetState(kButtonUp);
778 }
779 fVolume->SetVisLeaves(on);
780 Update();
781}
782
783////////////////////////////////////////////////////////////////////////////////
784/// Slot for viewing volume only.
785
787{
788 Bool_t on = (fBView[2]->GetState() == kButtonDown) ? kTRUE : kFALSE;
789 if (!on)
790 return;
791 if (fVolume->IsVisOnly() == on)
792 return;
793 if (fVolume->IsRaytracing()) {
794 fVolume->Raytrace(kFALSE);
795 fBRaytrace->SetState(kButtonUp);
796 }
797 fVolume->SetVisOnly(on);
798 Update();
799}
800
801////////////////////////////////////////////////////////////////////////////////
802/// Slot for raytracing.
803
805{
806 Bool_t on = (fBRaytrace->GetState() == kButtonDown) ? kTRUE : kFALSE;
807 if (fVolume->IsRaytracing() == on)
808 return;
809 fVolume->Raytrace(on);
810 Update();
811}
812
813////////////////////////////////////////////////////////////////////////////////
814/// Modify division name.
815
817{
818 fApplyDiv->SetEnabled(kTRUE);
819}
820
821////////////////////////////////////////////////////////////////////////////////
822/// Change division axis and preserve number of slices.
823
825{
826 Int_t iaxis = 1;
827 for (Int_t i = 0; i < 3; i++) {
828 if (fBDiv[i]->GetState() != kButtonDown)
829 continue;
830 iaxis = i + 1;
831 break;
832 }
833 TGeoShape *shape = fVolume->GetShape();
834 if (!shape) {
835 fApplyDiv->SetEnabled(kFALSE);
836 return;
837 }
838 Double_t xlo, xhi;
839 shape->GetAxisRange(iaxis, xlo, xhi);
840 if (xhi <= xlo) {
841 fApplyDiv->SetEnabled(kFALSE);
842 return;
843 }
844 fEDivFrom->SetNumber(xlo);
845 fEDivStep->SetNumber(0);
846 fApplyDiv->SetEnabled(kTRUE);
847}
848
849////////////////////////////////////////////////////////////////////////////////
850/// Handle division range modification.
851
853{
854 Double_t min, max, xlo, xhi, step;
855 Int_t iaxis = 1;
856 Int_t ndiv;
857 for (Int_t i = 0; i < 3; i++) {
858 if (fBDiv[i]->GetState() != kButtonDown)
859 continue;
860 iaxis = i + 1;
861 break;
862 }
863 TGeoShape *shape = fVolume->GetShape();
864 if (!shape) {
865 fApplyDiv->SetEnabled(kFALSE);
866 return;
867 }
868 shape->GetAxisRange(iaxis, xlo, xhi);
869 if (xhi - xlo <= 0) {
870 fApplyDiv->SetEnabled(kFALSE);
871 return;
872 }
873 min = fEDivFrom->GetNumber();
874 step = fEDivStep->GetNumber();
875 ndiv = fEDivN->GetIntNumber();
876 if (min < xlo) {
877 min = xlo;
878 fEDivFrom->SetNumber(xlo);
879 }
880 max = min + ndiv * step;
881 if (max > xhi) {
882 max = xhi;
883 step = (max - min) / ndiv;
884 fEDivStep->SetNumber(step);
885 }
886 if (min >= max) {
887 fApplyDiv->SetEnabled(kFALSE);
888 return;
889 }
890 fApplyDiv->SetEnabled(kTRUE);
891}
892
893////////////////////////////////////////////////////////////////////////////////
894/// Handle division step modification.
895
897{
898 Double_t min, max, xlo, xhi;
899 Int_t iaxis = 1;
900 for (Int_t i = 0; i < 3; i++) {
901 if (fBDiv[i]->GetState() != kButtonDown)
902 continue;
903 iaxis = i + 1;
904 break;
905 }
906 TGeoShape *shape = fVolume->GetShape();
907 if (!shape) {
908 fApplyDiv->SetEnabled(kFALSE);
909 return;
910 }
911 shape->GetAxisRange(iaxis, xlo, xhi);
912 if (xhi - xlo <= 0) {
913 fApplyDiv->SetEnabled(kFALSE);
914 return;
915 }
916 min = fEDivFrom->GetNumber();
917 Double_t step = fEDivStep->GetNumber();
918 Int_t ndiv = fEDivN->GetIntNumber();
919 max = min + ndiv * step;
920
921 // Check if ndiv*step < max-min
922 if (max <= xhi) {
923 fApplyDiv->SetEnabled(kTRUE);
924 return;
925 }
926 // Step too big - set value to fit range
927 max = xhi;
928 step = (max - min) / ndiv;
929 fEDivStep->SetNumber(step);
930 if (step < 0) {
931 fApplyDiv->SetEnabled(kFALSE);
932 return;
933 }
934 fApplyDiv->SetEnabled(kTRUE);
935}
936
937////////////////////////////////////////////////////////////////////////////////
938/// Handle division N modification.
939
941{
942 Double_t min, max, xlo, xhi;
943 Int_t iaxis = 1;
944 for (Int_t i = 0; i < 3; i++) {
945 if (fBDiv[i]->GetState() != kButtonDown)
946 continue;
947 iaxis = i + 1;
948 break;
949 }
950 TGeoShape *shape = fVolume->GetShape();
951 if (!shape) {
952 fApplyDiv->SetEnabled(kFALSE);
953 return;
954 }
955 shape->GetAxisRange(iaxis, xlo, xhi);
956 if (xhi - xlo <= 0) {
957 fApplyDiv->SetEnabled(kFALSE);
958 return;
959 }
960 Double_t step = fEDivStep->GetNumber();
961 // If step=0 it is discounted
962 if (step == 0) {
963 fApplyDiv->SetEnabled(kTRUE);
964 return;
965 }
966 Int_t ndiv = fEDivN->GetIntNumber();
967 min = fEDivFrom->GetNumber();
968 max = min + ndiv * step;
969 // Check if ndiv*step < max-min
970 if (max <= xhi) {
971 fApplyDiv->SetEnabled(kTRUE);
972 return;
973 }
974 max = xhi;
975 ndiv = (Int_t)((max - min) / step);
976 fEDivN->SetNumber(ndiv);
977 fApplyDiv->SetEnabled(kTRUE);
978}
979
980////////////////////////////////////////////////////////////////////////////////
981/// Apply current division settings
982
984{
985 Double_t xlo, xhi, step;
986 Int_t iaxis = 1;
987 Int_t ndiv;
988 for (Int_t i = 0; i < 3; i++) {
989 if (fBDiv[i]->GetState() != kButtonDown)
990 continue;
991 iaxis = i + 1;
992 break;
993 }
994 TGeoShape *shape = fVolume->GetShape();
995 if (!shape) {
996 fApplyDiv->SetEnabled(kFALSE);
997 return;
998 }
999 shape->GetAxisRange(iaxis, xlo, xhi);
1000 if (xhi - xlo <= 0) {
1001 fApplyDiv->SetEnabled(kFALSE);
1002 return;
1003 }
1004 xlo = fEDivFrom->GetNumber();
1005 step = fEDivStep->GetNumber();
1006 ndiv = fEDivN->GetIntNumber();
1007 TGeoPatternFinder *finder = fVolume->GetFinder();
1008 if (finder) {
1009 // we have to remove first the existing division
1010 TObjArray *nodes = fVolume->GetNodes();
1011 nodes->Delete();
1012 nodes->Clear();
1013 delete finder;
1014 fVolume->SetFinder(nullptr);
1015 }
1016 fVolume->Divide(fDivName->GetText(), iaxis, ndiv, xlo, step);
1017 fApplyDiv->SetEnabled(kFALSE);
1018 fGeometry->SetTopVisible();
1019 Update();
1020 // fVolume->Draw();
1021}
@ kRaisedFrame
Definition GuiTypes.h:385
@ kSunkenFrame
Definition GuiTypes.h:384
@ kVerticalFrame
Definition GuiTypes.h:382
@ kDoubleBorder
Definition GuiTypes.h:386
@ kFixedWidth
Definition GuiTypes.h:388
@ kHorizontalFrame
Definition GuiTypes.h:383
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
start
Definition Rotated.cxx:223
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ 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
static TClass * Class()
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
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:1109
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:314
Int_t GetState(TGFrame *f) const
Get state of sub frame.
Definition TGFrame.cxx:1210
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
TGCompositeFrame(const TGCompositeFrame &)=delete
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:304
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
This class handles GUI labels.
Definition TGLabel.h:24
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition TGLabel.cxx:361
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
@ kNEAPositive
Positive number.
@ kNEANonNegative
Non-negative number.
@ 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:39
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. A pattern is specifying a division type
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
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:49
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:42
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:549
Basic string class.
Definition TString.h:138
TF1 * f1
Definition legend1.C:11