Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoTrapEditor.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 TGeoTrapEditor
13\ingroup Geometry_builder
14
15Editor for a TGeoTrap.
16
17\image html geom_trap_pic.png
18
19\image html geom_trap_ed.png
20
21*/
22
23#include "TGeoTrapEditor.h"
24#include "TGeoTabManager.h"
25#include "TGeoArb8.h"
26#include "TGeoManager.h"
27#include "TVirtualGeoPainter.h"
28#include "TVirtualPad.h"
29#include "TView.h"
30#include "TGButton.h"
31#include "TGTextEntry.h"
32#include "TGNumberEntry.h"
33#include "TGLabel.h"
34
36
50};
51
52////////////////////////////////////////////////////////////////////////////////
53/// Constructor for para editor
54
56 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
57{
58 fShape = nullptr;
59 fH1i = fBl1i = fTl1i = fDzi = fAlpha1i = fThetai = fPhii = fSci = 0.0;
60 fNamei = "";
63
64 // TextEntry for shape name
65 MakeTitle("Name");
66 fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kTRAP_NAME);
68 fShapeName->SetToolTipText("Enter the parallelepiped name");
69 fShapeName->Associate(this);
71
72 TGTextEntry *nef;
73 MakeTitle("Dimensions");
74 // Number entry for H1
76 f1->AddFrame(new TGLabel(f1, "DY"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
77 fEH1 = new TGNumberEntry(f1, 0., 5, kTRAP_H1);
81 nef->SetToolTipText("Enter the half length in y at low z");
82 fEH1->Associate(this);
83 f1->AddFrame(fEH1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
84 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
85
86 // Number entry for Bl1
87 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
88 f1->AddFrame(new TGLabel(f1, "DX1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
89 fEBl1 = new TGNumberEntry(f1, 0., 5, kTRAP_BL1);
93 nef->SetToolTipText("Enter the half length in x at low z and y low edge");
94 fEBl1->Associate(this);
95 f1->AddFrame(fEBl1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
96 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
97
98 // Number entry for Tl1
99 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
100 f1->AddFrame(new TGLabel(f1, "DX2"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
101 fETl1 = new TGNumberEntry(f1, 0., 5, kTRAP_TL1);
104 nef = (TGTextEntry *)fETl1->GetNumberEntry();
105 nef->SetToolTipText("Enter the half length in x at low z and y high edge");
106 fETl1->Associate(this);
107 f1->AddFrame(fETl1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
108 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
109
110 // Number entry for scale factor
111 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
112 f1->AddFrame(new TGLabel(f1, "SC1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
113 fESc1 = new TGNumberEntry(f1, 0., 5, kTRAP_SC1);
116 nef = (TGTextEntry *)fESc1->GetNumberEntry();
117 nef->SetToolTipText("Enter the scale factor for lower Z face");
118 fESc1->Associate(this);
119 f1->AddFrame(fESc1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
120 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
121
122 // Number entry for scale factor
123 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
124 f1->AddFrame(new TGLabel(f1, "SC2"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
125 fESc2 = new TGNumberEntry(f1, 0., 5, kTRAP_SC2);
128 nef = (TGTextEntry *)fESc2->GetNumberEntry();
129 nef->SetToolTipText("Enter the scale factor for upper Z face");
130 fESc2->Associate(this);
131 f1->AddFrame(fESc2, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
132 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
133
134 // Number entry for dz
135 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
136 f1->AddFrame(new TGLabel(f1, "DZ"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
137 fEDz = new TGNumberEntry(f1, 0., 5, kTRAP_DZ);
140 nef = (TGTextEntry *)fEDz->GetNumberEntry();
141 nef->SetToolTipText("Enter the half-length in Z");
142 fEDz->Associate(this);
143 f1->AddFrame(fEDz, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
144 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
145
146 // Number entry for Alpha1
147 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
148 f1->AddFrame(new TGLabel(f1, "ALPHA"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
149 fEAlpha1 = new TGNumberEntry(f1, 0., 5, kTRAP_ALPHA1);
152 nef->SetToolTipText("Enter angle between centers of x edges an y axis at low z");
153 fEAlpha1->Associate(this);
154 f1->AddFrame(fEAlpha1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
155 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
156
157 // Number entry for Theta
158 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
159 f1->AddFrame(new TGLabel(f1, "Theta"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
160 fETheta = new TGNumberEntry(f1, 0., 5, kTRAP_THETA);
164 nef->SetToolTipText("Enter initial theta");
165 fETheta->Associate(this);
166 f1->AddFrame(fETheta, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
167 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
168
169 // Number entry for Phi
170 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
171 f1->AddFrame(new TGLabel(f1, "Phi"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
172 fEPhi = new TGNumberEntry(f1, 0., 5, kTRAP_PHI);
175 nef = (TGTextEntry *)fEPhi->GetNumberEntry();
176 nef->SetToolTipText("Enter initial phi");
177 fEPhi->Associate(this);
178 f1->AddFrame(fEPhi, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
179 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
180
181 // Delayed draw
183 fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
185 AddFrame(fDFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
186
187 // Buttons
189 fApply = new TGTextButton(fBFrame, "Apply");
190 fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
191 fApply->Associate(this);
192 fUndo = new TGTextButton(fBFrame, "Undo");
193 fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
194 fUndo->Associate(this);
195 AddFrame(fBFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Destructor
201
203{
204 TGFrameElement *el;
205 TIter next(GetList());
206 while ((el = (TGFrameElement *)next())) {
207 if (el->fFrame->IsComposite())
209 }
210 Cleanup();
211}
212
213////////////////////////////////////////////////////////////////////////////////
214/// Connect signals to slots.
215
217{
218 fApply->Connect("Clicked()", "TGeoTrapEditor", this, "DoApply()");
219 fUndo->Connect("Clicked()", "TGeoTrapEditor", this, "DoUndo()");
220 fShapeName->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
221 fEH1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoH1()");
222 fEBl1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoBl1()");
223 fETl1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoTl1()");
224 fEDz->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoDz()");
225 fESc1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoSc1()");
226 fESc2->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoSc2()");
227 fEAlpha1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoAlpha1()");
228 fETheta->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoTheta()");
229 fEPhi->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoPhi()");
230 fEH1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
231 fEBl1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
232 fETl1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
233 fEDz->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
234 fESc1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
235 fESc2->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
236 fEAlpha1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
237 fETheta->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
238 fEPhi->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
239 fInit = kFALSE;
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Connect to the selected object.
244
246{
247 if (obj == nullptr || (obj->IsA() != TGeoTrap::Class())) {
249 return;
250 }
251 fShape = (TGeoTrap *)obj;
252 fH1i = fShape->GetH1();
253 fBl1i = fShape->GetBl1();
254 fTl1i = fShape->GetTl1();
255 fDzi = fShape->GetDz();
256 Double_t h2i = fShape->GetH2();
257 // Double_t bl2i = fShape->GetBl2();
258 // Double_t tl2i = fShape->GetTl2();
259 fSci = h2i / fH1i;
262 fPhii = fShape->GetPhi();
263 const char *sname = fShape->GetName();
264 if (!strcmp(sname, fShape->ClassName()))
265 fShapeName->SetText("-no_name");
266 else {
267 fShapeName->SetText(sname);
268 fNamei = sname;
269 }
274 fESc1->SetNumber(1.);
281
282 if (fInit)
284 SetActive();
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Check if shape drawing is delayed.
289
291{
292 return (fDelayed->GetState() == kButtonDown);
293}
294
295////////////////////////////////////////////////////////////////////////////////
296/// Slot for name.
297
299{
300 DoModified();
301}
302
303////////////////////////////////////////////////////////////////////////////////
304/// Slot for applying current settings.
305
307{
308 const char *name = fShapeName->GetText();
309 if (strcmp(name, fShape->GetName()))
311 Double_t sc1 = fESc1->GetNumber();
312 Double_t sc2 = fESc2->GetNumber();
313 Double_t h1 = sc1 * fEH1->GetNumber();
314 Double_t bl1 = sc1 * fEBl1->GetNumber();
315 Double_t tl1 = sc1 * fETl1->GetNumber();
316 Double_t h2 = sc2 * fEH1->GetNumber();
317 Double_t bl2 = sc2 * fEBl1->GetNumber();
318 Double_t tl2 = sc2 * fETl1->GetNumber();
319 Double_t dz = fEDz->GetNumber();
320 Double_t alpha1 = fEAlpha1->GetNumber();
321 Double_t theta = fETheta->GetNumber();
322 Double_t phi = fEPhi->GetNumber();
323 Double_t param[11];
324 param[0] = dz;
325 param[1] = theta;
326 param[2] = phi;
327 param[3] = h1;
328 param[7] = h2;
329 param[4] = bl1;
330 param[8] = bl2;
331 param[5] = tl1;
332 param[9] = tl2;
333 param[6] = alpha1;
334 param[10] = alpha1;
335 fShape->SetDimensions(param);
337 fUndo->SetEnabled();
339 if (fPad) {
341 TView *view = fPad->GetView();
342 if (!view) {
343 fShape->Draw();
344 fPad->GetView()->ShowAxis();
345 } else {
346 view->SetRange(-fShape->GetDX(), -fShape->GetDY(), -fShape->GetDZ(), fShape->GetDX(), fShape->GetDY(),
347 fShape->GetDZ());
348 Update();
349 }
350 } else
351 Update();
352 }
353}
354
355////////////////////////////////////////////////////////////////////////////////
356/// Slot for notifying modifications.
357
359{
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// Slot for undoing last operation.
365
367{
371 fESc1->SetNumber(1.);
377 DoApply();
380}
381
382////////////////////////////////////////////////////////////////////////////////
383/// Slot for H1.
384
386{
388 if (h1 <= 0) {
389 h1 = 0.1;
390 fEH1->SetNumber(h1);
391 }
392 DoModified();
393 if (!IsDelayed())
394 DoApply();
395}
396
397////////////////////////////////////////////////////////////////////////////////
398/// Slot for Bl1.
399
401{
402 Double_t bl1 = fEBl1->GetNumber();
403 if (bl1 <= 0) {
404 bl1 = 0.1;
405 fEBl1->SetNumber(bl1);
406 }
407 DoModified();
408 if (!IsDelayed())
409 DoApply();
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Slot for Tl1.
414
416{
417 Double_t tl1 = fETl1->GetNumber();
418 if (tl1 <= 0) {
419 tl1 = 0.1;
420 fETl1->SetNumber(tl1);
421 }
422 DoModified();
423 if (!IsDelayed())
424 DoApply();
425}
426
427////////////////////////////////////////////////////////////////////////////////
428/// Slot for Z.
429
431{
432 Double_t dz = fEDz->GetNumber();
433 if (dz <= 0) {
434 dz = 0.1;
435 fEDz->SetNumber(dz);
436 }
437 DoModified();
438 if (!IsDelayed())
439 DoApply();
440}
441
442////////////////////////////////////////////////////////////////////////////////
443/// Slot for H2.
444
446{
447 Double_t sc1 = fESc1->GetNumber();
448 if (sc1 <= 0) {
449 sc1 = 0.1;
450 fESc1->SetNumber(sc1);
451 }
452 DoModified();
453 if (!IsDelayed())
454 DoApply();
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Slot for H2.
459
461{
462 Double_t sc2 = fESc2->GetNumber();
463 if (sc2 <= 0) {
464 sc2 = 0.1;
465 fESc2->SetNumber(sc2);
466 }
467 DoModified();
468 if (!IsDelayed())
469 DoApply();
470}
471
472////////////////////////////////////////////////////////////////////////////////
473/// Slot for alpha1.
474
476{
477 Double_t alpha1 = fEAlpha1->GetNumber();
478 if (TMath::Abs(alpha1) >= 90) {
479 alpha1 = 89.9 * TMath::Sign(1., alpha1);
480 fEAlpha1->SetNumber(alpha1);
481 }
482 DoModified();
483 if (!IsDelayed())
484 DoApply();
485}
486
487////////////////////////////////////////////////////////////////////////////////
488/// Slot for theta.
489
491{
492 Double_t theta = fETheta->GetNumber();
493 if (theta < 0) {
494 theta = 0;
495 fETheta->SetNumber(theta);
496 }
497 if (theta > 180) {
498 theta = 180;
499 fETheta->SetNumber(theta);
500 }
501 DoModified();
502 if (!IsDelayed())
503 DoApply();
504}
505
506////////////////////////////////////////////////////////////////////////////////
507/// Slot for phi.
508
510{
511 Double_t phi = fEPhi->GetNumber();
512 if (phi < 0 || phi > 360) {
513 phi = 0;
514 fEPhi->SetNumber(phi);
515 }
516 DoModified();
517 if (!IsDelayed())
518 DoApply();
519}
520
522
524
525/** \class TGeoGtraEditor
526\ingroup Geometry_builder
527
528Editor for a TGeoGtra.
529
530\image html geom_gtra_pic.png
531
532\image html geom_gtra_ed.png
533
534*/
535
536////////////////////////////////////////////////////////////////////////////////
537/// Constructor for gtra editor
538
540 : TGeoTrapEditor(p, width, height, options, back)
541{
542 fTwisti = 0;
543 TGTextEntry *nef;
544 // Number entry for Twist angle
546 f1->AddFrame(new TGLabel(f1, "TWIST"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
547 fETwist = new TGNumberEntry(f1, 0., 5, kGTRA_TWIST);
550 nef->SetToolTipText("Enter twist angle");
551 fETwist->Associate(this);
552 f1->AddFrame(fETwist, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
553 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
556 fETwist->Connect("ValueSet(Long_t)", "TGeoGtraEditor", this, "DoTwist()");
557 nef->Connect("TextChanged(const char *)", "TGeoGtraEditor", this, "DoModified()");
558}
559////////////////////////////////////////////////////////////////////////////////
560/// Destructor
561
563{
564 TGFrameElement *el;
565 TIter next(GetList());
566 while ((el = (TGFrameElement *)next())) {
567 if (el->fFrame->IsComposite())
569 }
570 Cleanup();
571}
572
573////////////////////////////////////////////////////////////////////////////////
574/// Connect to a given twisted trapezoid.
575
577{
578 if (obj == nullptr || (obj->IsA() != TGeoGtra::Class())) {
580 return;
581 }
582 fShape = (TGeoTrap *)obj;
583 fH1i = fShape->GetH1();
584 fBl1i = fShape->GetBl1();
585 fTl1i = fShape->GetTl1();
586 fDzi = fShape->GetDz();
587 Double_t h2i = fShape->GetH2();
588 // Double_t bl2i = fShape->GetBl2();
589 // Double_t tl2i = fShape->GetTl2();
590 fSci = h2i / fH1i;
593 fPhii = fShape->GetPhi();
594 fTwisti = ((TGeoGtra *)fShape)->GetTwistAngle();
595 const char *sname = fShape->GetName();
596 if (!strcmp(sname, fShape->ClassName()))
597 fShapeName->SetText("-no_name");
598 else {
599 fShapeName->SetText(sname);
600 fNamei = sname;
601 }
606 fESc1->SetNumber(1.);
614
615 if (fInit)
617 SetActive();
618}
619
620////////////////////////////////////////////////////////////////////////////////
621/// Slot for applying current settings.
622
624{
625 const char *name = fShapeName->GetText();
626 if (strcmp(name, fShape->GetName()))
628 Double_t sc1 = fESc1->GetNumber();
629 Double_t sc2 = fESc2->GetNumber();
630 Double_t h1 = sc1 * fEH1->GetNumber();
631 Double_t bl1 = sc1 * fEBl1->GetNumber();
632 Double_t tl1 = sc1 * fETl1->GetNumber();
633 Double_t h2 = sc2 * fEH1->GetNumber();
634 Double_t bl2 = sc2 * fEBl1->GetNumber();
635 Double_t tl2 = sc2 * fETl1->GetNumber();
636 Double_t dz = fEDz->GetNumber();
637 Double_t alpha1 = fEAlpha1->GetNumber();
638 Double_t theta = fETheta->GetNumber();
639 Double_t phi = fEPhi->GetNumber();
640 Double_t twist = fETwist->GetNumber();
641 Double_t param[12];
642 param[0] = dz;
643 param[1] = theta;
644 param[2] = phi;
645 param[3] = h1;
646 param[7] = h2;
647 param[4] = bl1;
648 param[8] = bl2;
649 param[5] = tl1;
650 param[9] = tl2;
651 param[6] = alpha1;
652 param[10] = alpha1;
653 param[11] = twist;
654 TGeoGtra *shape = (TGeoGtra *)fShape;
655 shape->SetDimensions(param);
656 shape->ComputeBBox();
657 fUndo->SetEnabled();
659 if (fPad) {
661 TView *view = fPad->GetView();
662 if (!view) {
663 fShape->Draw();
664 fPad->GetView()->ShowAxis();
665 } else {
666 view->SetRange(-fShape->GetDX(), -fShape->GetDY(), -fShape->GetDZ(), fShape->GetDX(), fShape->GetDY(),
667 fShape->GetDZ());
668 Update();
669 }
670 } else
671 Update();
672 }
673}
674
675////////////////////////////////////////////////////////////////////////////////
676/// Slot for undoing last operation.
677
679{
683 fESc1->SetNumber(1.);
690 DoApply();
693}
694
695////////////////////////////////////////////////////////////////////////////////
696/// Change the twist angle.
697
699{
700 Double_t twist = fETwist->GetNumber();
701 if (twist <= -180 || twist >= 180) {
702 twist = 0.;
703 fETwist->SetNumber(twist);
704 }
705 DoModified();
706 if (!IsDelayed())
707 DoApply();
708}
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
@ kButtonDown
Definition TGButton.h:54
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
ETGeoGtraWid
@ kGTRA_TWIST
ETGeoTrapWid
@ kTRAP_SC1
@ kTRAP_APPLY
@ kTRAP_ALPHA1
@ kTRAP_SC2
@ kTRAP_UNDO
@ kTRAP_H1
@ kTRAP_DZ
@ kTRAP_NAME
@ kTRAP_THETA
@ kTRAP_PHI
@ kTRAP_BL1
@ kTRAP_TL1
virtual EButtonState GetState() const
Definition TGButton.h:112
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition TGButton.cxx:459
Selects different options.
Definition TGButton.h:264
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
TGFrame * fFrame
Definition TGLayout.h:112
virtual void SetSize(const TGDimension &s)
Definition TGFrame.h:252
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
TGDimension GetSize() const
Definition TGFrame.h:230
virtual Bool_t IsComposite() const
Definition TGFrame.h:212
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
void Associate(const TGWindow *w) override
Make w the window that will receive the generated messages.
void SetNumAttr(EAttribute attr=kNEAAnyNumber)
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
UInt_t GetDefaultHeight() const override
@ kNEAPositive
Positive number.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
const char * GetText() const
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:95
Double_t GetDz() const
Definition TGeoArb8.h:66
void ComputeBBox() override
virtual Double_t GetDX() const
Definition TGeoBBox.h:79
virtual Double_t GetDZ() const
Definition TGeoBBox.h:81
virtual Double_t GetDY() const
Definition TGeoBBox.h:80
Common base class for geombuilder editors.
void Update() override
Override Update from TGedFrame as fGedEditor can be null.
TVirtualPad * fPad
virtual void SetActive(Bool_t active=kTRUE)
Set active GUI attribute frames related to the selected object.
Editor for a TGeoGtra.
TGNumberEntry * fETwist
~TGeoGtraEditor() override
Destructor.
void SetModel(TObject *obj) override
Connect to a given twisted trapezoid.
void DoUndo() override
Slot for undoing last operation.
void DoApply() override
Slot for applying current settings.
TGeoGtraEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for gtra editor.
void DoTwist()
Change the twist angle.
void SetDimensions(Double_t *param) override
static TClass * Class()
TVirtualGeoPainter * GetPainter() const
void Draw(Option_t *option="") override
Draw this shape.
const char * GetName() const override
Get the shape name.
static void MoveFrame(TGCompositeFrame *fr, TGCompositeFrame *p)
Move frame fr at the end of the list of parent p.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
Editor for a TGeoTrap.
TGTextButton * fApply
TGNumberEntry * fEPhi
TGCompositeFrame * fDFrame
TGNumberEntry * fEBl1
void DoTl1()
Slot for Tl1.
void DoSc2()
Slot for H2.
void DoH1()
Slot for H1.
TGCheckButton * fDelayed
TGNumberEntry * fETl1
TGNumberEntry * fEDz
TGeoTrapEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for para editor.
void SetModel(TObject *obj) override
Connect to the selected object.
Bool_t fIsShapeEditable
virtual void DoUndo()
Slot for undoing last operation.
~TGeoTrapEditor() override
Destructor.
TGTextEntry * fShapeName
TGNumberEntry * fEH1
void DoPhi()
Slot for phi.
virtual void ConnectSignals2Slots()
Connect signals to slots.
TGNumberEntry * fETheta
void DoName()
Slot for name.
void DoSc1()
Slot for H2.
TGCompositeFrame * fBFrame
void DoAlpha1()
Slot for alpha1.
TGNumberEntry * fESc2
void DoBl1()
Slot for Bl1.
virtual void DoApply()
Slot for applying current settings.
TGNumberEntry * fESc1
void DoDz()
Slot for Z.
void DoTheta()
Slot for theta.
void DoModified()
Slot for notifying modifications.
TGeoTrap * fShape
Bool_t IsDelayed() const
Check if shape drawing is delayed.
TGTextButton * fUndo
TGNumberEntry * fEAlpha1
static TClass * Class()
Double_t GetTl1() const
Definition TGeoArb8.h:134
Double_t GetPhi() const
Definition TGeoArb8.h:131
void SetDimensions(Double_t *param) override
Double_t GetTheta() const
Definition TGeoArb8.h:130
Double_t GetAlpha1() const
Definition TGeoArb8.h:135
Double_t GetH1() const
Definition TGeoArb8.h:132
Double_t GetH2() const
Definition TGeoArb8.h:136
Double_t GetBl1() const
Definition TGeoArb8.h:133
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:213
virtual TClass * IsA() const
Definition TObject.h:243
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:869
See TView3D.
Definition TView.h:25
virtual void ShowAxis()=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
virtual Bool_t IsPaintingShape() const =0
virtual TView * GetView() const =0
TH1F * h1
Definition legend1.C:5
TF1 * f1
Definition legend1.C:11
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Definition TMathBase.h:175
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123