Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoTubeEditor.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 TGeoTubeEditor
13\ingroup Geometry_builder
14
15Editor for a TGeoTube.
16
17\image html geom_tube_pic.png
18
19\image html geom_tube_ed.png
20
21*/
22
23#include "TGeoTubeEditor.h"
24#include "TGeoTabManager.h"
25#include "TGeoTube.h"
26#include "TGeoManager.h"
27#include "TVirtualGeoPainter.h"
28#include "TVirtualPad.h"
29#include "TView.h"
30#include "TMath.h"
31#include "TGButton.h"
32#include "TGTextEntry.h"
33#include "TGNumberEntry.h"
34#include "TGLabel.h"
35#include "TGDoubleSlider.h"
36
37
39
40////////////////////////////////////////////////////////////////////////////////
41/// Constructor for tube editor
42
44 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
45{
46 fShape = nullptr;
47 fRmini = fRmaxi = fDzi = 0.0;
48 fNamei = "";
51
52 // TextEntry for shape name
53 MakeTitle("Name");
54 fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kTUBE_NAME);
56 fShapeName->SetToolTipText("Enter the box name");
57 fShapeName->Associate(this);
59
61 MakeTitle("Tube dimensions");
63 // Number entry for rmin
65 f1->AddFrame(new TGLabel(f1, "Rmin"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
66 fERmin = new TGNumberEntry(f1, 0., 5, kTUBE_RMIN);
69 nef->SetToolTipText("Enter the inner radius");
70 fERmin->Associate(this);
72 f1->AddFrame(fERmin, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
73 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
74
75 // Number entry for Rmax
77 f1->AddFrame(new TGLabel(f1, "Rmax"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
78 fERmax = new TGNumberEntry(f1, 0., 5, kTUBE_RMAX);
81 nef->SetToolTipText("Enter the outer radius");
82 fERmax->Associate(this);
84 f1->AddFrame(fERmax, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
85 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
86
87 // Number entry for dz
89 f1->AddFrame(new TGLabel(f1, "DZ"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
90 fEDz = new TGNumberEntry(f1, 0., 5, kTUBE_Z);
93 nef->SetToolTipText("Enter the tube half-lenth in Z");
94 fEDz->Associate(this);
96 f1->AddFrame(fEDz, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
97 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
98
99 // compxyz->Resize(150,30);
100 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
101
102 // Delayed draw
104 fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
106 AddFrame(fDFrame, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
107
108 // Buttons
110 fApply = new TGTextButton(fBFrame, "Apply");
111 fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
112 fApply->Associate(this);
113 fUndo = new TGTextButton(fBFrame, "Undo");
114 fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
115 fUndo->Associate(this);
116 AddFrame(fBFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Destructor
122
124{
126 TIter next(GetList());
127 while ((el = (TGFrameElement *)next())) {
128 if (el->fFrame->IsComposite())
130 }
131 Cleanup();
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Connect signals to slots.
136
138{
139 fApply->Connect("Clicked()", "TGeoTubeEditor", this, "DoApply()");
140 fUndo->Connect("Clicked()", "TGeoTubeEditor", this, "DoUndo()");
141 fShapeName->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoModified()");
142 fERmin->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoRmin()");
143 fERmax->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoRmax()");
144 fEDz->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoDz()");
145 fERmin->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoRmin()");
146 fERmax->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoRmax()");
147 fEDz->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoDz()");
148 fInit = kFALSE;
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Connect to the selected object.
153
155{
156 if (obj == nullptr || (obj->IsA() != TGeoTube::Class())) {
158 return;
159 }
160 fShape = (TGeoTube *)obj;
161 fRmini = fShape->GetRmin();
162 fRmaxi = fShape->GetRmax();
163 fDzi = fShape->GetDz();
164 fNamei = fShape->GetName();
171
172 if (fInit)
174 SetActive();
175}
176
177////////////////////////////////////////////////////////////////////////////////
178/// Check if shape drawing is delayed.
179
181{
182 return (fDelayed->GetState() == kButtonDown);
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// Perform name change.
187
189{
190 DoModified();
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Slot for applying modifications.
195
197{
198 const char *name = fShapeName->GetText();
199 if (strcmp(name, fShape->GetName()))
206 fUndo->SetEnabled();
208 if (fPad) {
210 fShape->Draw();
211 fPad->GetView()->ShowAxis();
212 } else
213 Update();
214 }
215}
216
217////////////////////////////////////////////////////////////////////////////////
218/// Slot for signaling modifications.
219
224
225////////////////////////////////////////////////////////////////////////////////
226/// Slot for undoing last operation.
227
237
238////////////////////////////////////////////////////////////////////////////////
239/// Slot for rmin.
240
242{
245 if (rmax < rmin + 1.e-10) {
246 rmin = rmax - 0.1;
248 }
249 DoModified();
250 if (!IsDelayed())
251 DoApply();
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Slot for rmax.
256
258{
261 if (rmax <= 0.) {
262 rmax = 0.1;
264 }
265 if (rmax < rmin + 1.e-10) {
266 rmax = rmin + 0.1;
268 }
269 DoModified();
270 if (!IsDelayed())
271 DoApply();
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// Slot for dz.
276
278{
280 if (dz <= 0) {
281 dz = 0.1;
282 fEDz->SetNumber(dz);
283 }
284 DoModified();
285 if (!IsDelayed())
286 DoApply();
287}
288
289/** \class TGeoTubeSegEditor
290\ingroup Geometry_builder
291
292Editor for a TGeoTubeSeg.
293
294\image html geom_tubs_pic.png
295
296\image html geom_tubs_ed.png
297
298*/
299
300
302
303////////////////////////////////////////////////////////////////////////////////
304/// Constructor for tube segment editor
305
307 : TGeoTubeEditor(p, width, height, options | kVerticalFrame, back)
308{
309 fLock = kFALSE;
310 MakeTitle("Phi range");
314 // Vertical slider
315 fSPhi = new TGDoubleVSlider(compxyz, 100);
316 fSPhi->SetRange(0., 720.);
318 compxyz->AddFrame(fSPhi, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
320 f1->AddFrame(new TGLabel(f1, "Phi min."), new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 6, 0));
321 fEPhi1 = new TGNumberEntry(f1, 0., 5, kTUBESEG_PHI1);
325 nef->SetToolTipText("Enter the phi1 value");
326 fEPhi1->Associate(this);
327 f1->AddFrame(fEPhi1, new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 2));
328
329 fEPhi2 = new TGNumberEntry(f1, 0., 5, kTUBESEG_PHI2);
333 nef->SetToolTipText("Enter the phi2 value");
334 fEPhi2->Associate(this);
335 f1->AddFrame(fEPhi2, new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 2, 2));
336 f1->AddFrame(new TGLabel(f1, "Phi max."), new TGLayoutHints(kLHintsBottom, 0, 0, 6, 2));
337 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
338
339 // compxyz->Resize(150,150);
340 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Destructor
347
349{
351 TIter next(GetList());
352 while ((el = (TGFrameElement *)next())) {
353 if (el->fFrame->IsComposite())
355 }
356 Cleanup();
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Connect signals to slots.
361
363{
365 Disconnect(fApply, "Clicked()", (TGeoTubeEditor *)this, "DoApply()");
366 Disconnect(fUndo, "Clicked()", (TGeoTubeEditor *)this, "DoUndo()");
367 fApply->Connect("Clicked()", "TGeoTubeSegEditor", this, "DoApply()");
368 fUndo->Connect("Clicked()", "TGeoTubeSegEditor", this, "DoUndo()");
369 fEPhi1->Connect("ValueSet(Long_t)", "TGeoTubeSegEditor", this, "DoPhi1()");
370 fEPhi2->Connect("ValueSet(Long_t)", "TGeoTubeSegEditor", this, "DoPhi2()");
371 // fEPhi1->GetNumberEntry()->Connect("TextChanged(const char *)","TGeoTubeSegEditor", this, "DoPhi1()");
372 // fEPhi2->GetNumberEntry()->Connect("TextChanged(const char *)","TGeoTubeSegEditor", this, "DoPhi2()");
373 fSPhi->Connect("PositionChanged()", "TGeoTubeSegEditor", this, "DoPhi()");
374}
375
376////////////////////////////////////////////////////////////////////////////////
377/// Connect to the selected object.
378
380{
381 if (obj == nullptr || (obj->IsA() != TGeoTubeSeg::Class())) {
383 return;
384 }
385 fShape = (TGeoTube *)obj;
386 fRmini = fShape->GetRmin();
387 fRmaxi = fShape->GetRmax();
388 fDzi = fShape->GetDz();
389 fNamei = fShape->GetName();
390 fPmini = ((TGeoTubeSeg *)fShape)->GetPhi1();
391 fPmaxi = ((TGeoTubeSeg *)fShape)->GetPhi2();
401
402 if (fInit)
404 SetActive();
405}
406
407////////////////////////////////////////////////////////////////////////////////
408/// Slot for phi1.
409
411{
414 if (phi1 > 360 - 1.e-10) {
415 phi1 = 0.;
417 }
418 if (phi2 < phi1 + 1.e-10) {
419 phi1 = phi2 - 0.1;
421 }
422 if (!fLock) {
423 DoModified();
424 fLock = kTRUE;
426 } else
427 fLock = kFALSE;
428 if (!IsDelayed())
429 DoApply();
430}
431
432////////////////////////////////////////////////////////////////////////////////
433/// Slot for phi2.
434
436{
439 if (phi2 - phi1 > 360.) {
440 phi2 -= 360.;
442 }
443 if (phi2 < phi1 + 1.e-10) {
444 phi2 = phi1 + 0.1;
446 }
447 if (!fLock) {
448 DoModified();
449 fLock = kTRUE;
451 } else
452 fLock = kFALSE;
453 if (!IsDelayed())
454 DoApply();
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Slot for phi slider.
459
461{
462 if (!fLock) {
463 DoModified();
464 fLock = kTRUE;
466 fLock = kTRUE;
468 } else
469 fLock = kFALSE;
470 if (!IsDelayed())
471 DoApply();
472}
473
474////////////////////////////////////////////////////////////////////////////////
475/// Slot for applying modifications.
476
478{
480 const char *name = fShapeName->GetText();
481 if (strcmp(name, fShape->GetName()))
485 if (rmin < 0 || rmax < rmin)
486 return;
490 if ((phi2 - phi1) > 360.001) {
491 phi1 = 0.;
492 phi2 = 360.;
495 fLock = kTRUE;
497 fLock = kFALSE;
498 }
499 ((TGeoTubeSeg *)fShape)->SetTubsDimensions(rmin, rmax, dz, phi1, phi2);
501 fUndo->SetEnabled();
502 if (fPad) {
504 fShape->Draw();
505 fPad->GetView()->ShowAxis();
506 } else
507 Update();
508 }
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Slot for undoing last operation.
513
526
527/** \class TGeoCtubEditor
528\ingroup Geometry_builder
529
530Editor for a TGeoCtub.
531
532\image html geom_ctub_pic.png
533
534\image html geom_ctub_ed.png
535
536*/
537
538
540
541////////////////////////////////////////////////////////////////////////////////
542/// Constructor for cut tube editor
543
545 : TGeoTubeSegEditor(p, width, height, options, back)
546{
547 MakeTitle("Theta/phi low");
549 // Number entry for theta/phi of the lower normal
552 f1->AddFrame(new TGLabel(f1, "TH_LO"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
553 fEThlo = new TGNumberEntry(f1, 0., 5, kCTUB_THLO);
556 nef->SetToolTipText("Enter the theta angle of the lower plane normal");
557 fEThlo->Associate(this);
558 fEThlo->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoThlo()");
559 nef->Connect("TextChanged(const char *)", "TGeoCtubEditor", this, "DoModified()");
561 f1->AddFrame(fEThlo, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
562 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
563
565 f1->AddFrame(new TGLabel(f1, "PH_LO"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
566 fEPhlo = new TGNumberEntry(f1, 0., 5, kCTUB_PHLO);
569 nef->SetToolTipText("Enter the phi angle of the lower plane normal");
570 fEPhlo->Associate(this);
571 fEPhlo->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoPhlo()");
572 nef->Connect("TextChanged(const char *)", "TGeoCtubEditor", this, "DoModified()");
574 f1->AddFrame(fEPhlo, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
575 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
576 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
577
578 // Number entry for theta/phi of the lower normal
579 MakeTitle("Theta/phi high");
580 compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame);
582 f1->AddFrame(new TGLabel(f1, "TH_HI"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
583 fEThhi = new TGNumberEntry(f1, 0., 5, kCTUB_THHI);
586 nef->SetToolTipText("Enter the theta angle of the upper plane normal");
587 fEThhi->Associate(this);
588 fEThhi->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoThhi()");
589 nef->Connect("TextChanged(const char *)", "TGeoCtubEditor", this, "DoModified()");
591 f1->AddFrame(fEThhi, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
592 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
593
595 f1->AddFrame(new TGLabel(f1, "PH_HI"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
596 fEPhhi = new TGNumberEntry(f1, 0., 5, kCTUB_PHHI);
599 nef->SetToolTipText("Enter the phi angle of the upper plane normal");
600 fEPhhi->Associate(this);
601 fEPhhi->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoPhhi()");
602 nef->Connect("TextChanged(const char *)", "TGeoCtubEditor", this, "DoModified()");
604 f1->AddFrame(fEPhhi, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
605 compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 2, 2, 4, 4));
606 AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// Destructor
613
615{
617 TIter next(GetList());
618 while ((el = (TGFrameElement *)next())) {
619 if (el->fFrame->IsComposite())
621 }
622 Cleanup();
623}
624
625////////////////////////////////////////////////////////////////////////////////
626/// Connect to the selected object.
627
629{
630 if (obj == nullptr || (obj->IsA() != TGeoCtub::Class())) {
632 return;
633 }
634 fShape = (TGeoTube *)obj;
635 fRmini = fShape->GetRmin();
636 fRmaxi = fShape->GetRmax();
637 fDzi = fShape->GetDz();
638 fNamei = fShape->GetName();
639 fPmini = ((TGeoTubeSeg *)fShape)->GetPhi1();
640 fPmaxi = ((TGeoTubeSeg *)fShape)->GetPhi2();
641 const Double_t *nlo = ((TGeoCtub *)fShape)->GetNlow();
642 const Double_t *nhi = ((TGeoCtub *)fShape)->GetNhigh();
647
661
662 if (fInit)
664 SetActive();
665}
666
667////////////////////////////////////////////////////////////////////////////////
668/// Slot for phi1.
669
671{
673 if (thlo <= 90.) {
674 thlo = 91.;
676 }
677 if (thlo > 180.) {
678 thlo = 180.;
680 }
681 DoModified();
682 if (!IsDelayed())
683 DoApply();
684}
685
686////////////////////////////////////////////////////////////////////////////////
687/// Slot for phi1.
688
690{
692 if (phlo >= 360.) {
693 phlo = 0.;
695 }
696 DoModified();
697 if (!IsDelayed())
698 DoApply();
699}
700
701////////////////////////////////////////////////////////////////////////////////
702/// Slot for phi1.
703
705{
707 if (thhi >= 90.) {
708 thhi = 89.;
710 }
711 DoModified();
712 if (!IsDelayed())
713 DoApply();
714}
715
716////////////////////////////////////////////////////////////////////////////////
717/// Slot for phi1.
718
720{
722 if (phhi >= 360.) {
723 phhi = 0.;
725 }
726 DoModified();
727 if (!IsDelayed())
728 DoApply();
729}
730
731////////////////////////////////////////////////////////////////////////////////
732/// Slot for applying modifications.
733
735{
737 const char *name = fShapeName->GetText();
738 if (strcmp(name, fShape->GetName()))
742 if (rmin < 0 || rmax < rmin)
743 return;
747 if ((phi2 - phi1) > 360.001) {
748 phi1 = 0.;
749 phi2 = 360.;
752 fLock = kTRUE;
754 fLock = kFALSE;
755 }
766 ((TGeoCtub *)fShape)->SetCtubDimensions(rmin, rmax, dz, phi1, phi2, lx, ly, lz, tx, ty, tz);
768 fUndo->SetEnabled();
769 if (fPad) {
771 fShape->Draw();
772 fPad->GetView()->ShowAxis();
773 } else
774 Update();
775 }
776}
777
778////////////////////////////////////////////////////////////////////////////////
779/// Slot for undoing last operation.
780
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedHeight
Definition GuiTypes.h:389
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDown
Definition TGButton.h:54
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
ETGeoTubeSegWid
@ kTUBESEG_PHI1
@ kTUBESEG_PHI2
@ kTUBESEG_PHI
ETGeoTubeWid
@ kTUBE_RMAX
@ kTUBE_UNDO
@ kTUBE_NAME
@ kTUBE_APPLY
@ kTUBE_Z
@ kTUBE_RMIN
ETGeoCtubSegWid
@ kCTUB_THLO
@ kCTUB_PHHI
@ kCTUB_PHLO
@ kCTUB_THHI
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:453
Selects different options.
Definition TGButton.h:264
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual Float_t GetMaxPosition() const
virtual Float_t GetMinPosition() const
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
Dragging the slider will generate the event:
virtual void SetSize(const TGDimension &s)
Definition TGFrame.h:254
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:192
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
TGDimension GetSize() const
Definition TGFrame.h:232
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.
@ kNEANonNegative
Non-negative 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:94
void DoUndo() override
Slot for undoing last operation.
TGNumberEntry * fEPhlo
TGNumberEntry * fEPhhi
TGNumberEntry * fEThhi
TGNumberEntry * fEThlo
void DoPhlo()
Slot for phi1.
void DoThhi()
Slot for phi1.
~TGeoCtubEditor() override
Destructor.
TGeoCtubEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for cut tube editor.
void DoApply() override
Slot for applying modifications.
void SetModel(TObject *obj) override
Connect to the selected object.
void DoPhhi()
Slot for phi1.
void DoThlo()
Slot for phi1.
The cut tubes constructor has the form:
Definition TGeoTube.h:173
static TClass * Class()
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.
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 TGeoTube.
virtual void ConnectSignals2Slots()
Connect signals to slots.
void DoRmax()
Slot for rmax.
void SetModel(TObject *obj) override
Connect to the selected object.
TGTextEntry * fShapeName
void DoRmin()
Slot for rmin.
TGCompositeFrame * fDFrame
~TGeoTubeEditor() override
Destructor.
Bool_t fIsShapeEditable
TGTextButton * fUndo
void DoModified()
Slot for signaling modifications.
TGTextButton * fApply
TGCompositeFrame * fBFrame
TGNumberEntry * fEDz
virtual void DoUndo()
Slot for undoing last operation.
TGNumberEntry * fERmax
TGeoTubeEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for tube editor.
void DoDz()
Slot for dz.
TGCheckButton * fDelayed
void DoName()
Perform name change.
TGNumberEntry * fERmin
Bool_t IsDelayed() const
Check if shape drawing is delayed.
TGeoTube * fShape
virtual void DoApply()
Slot for applying modifications.
Editor for a TGeoTubeSeg.
void DoApply() override
Slot for applying modifications.
TGeoTubeSegEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for tube segment editor.
TGDoubleVSlider * fSPhi
void DoPhi2()
Slot for phi2.
TGNumberEntry * fEPhi1
void ConnectSignals2Slots() override
Connect signals to slots.
~TGeoTubeSegEditor() override
Destructor.
void DoPhi1()
Slot for phi1.
TGNumberEntry * fEPhi2
void DoPhi()
Slot for phi slider.
void DoUndo() override
Slot for undoing last operation.
void SetModel(TObject *obj) override
Connect to the selected object.
A tube segment is a tube having a range in phi.
Definition TGeoTube.h:94
static TClass * Class()
Cylindrical tube class.
Definition TGeoTube.h:17
virtual Double_t GetRmin() const
Definition TGeoTube.h:72
static TClass * Class()
void SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz)
Set tube dimensions.
Definition TGeoTube.cxx:959
virtual Double_t GetDz() const
Definition TGeoTube.h:74
void ComputeBBox() override
compute bounding box of the tube
Definition TGeoTube.cxx:223
virtual Double_t GetRmax() const
Definition TGeoTube.h:73
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
Mother of all ROOT objects.
Definition TObject.h:41
virtual TClass * IsA() const
Definition TObject.h:246
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
virtual Bool_t IsPaintingShape() const =0
virtual TView * GetView() const =0
TF1 * f1
Definition legend1.C:11
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Definition TMath.h:643
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Definition TMath.h:657
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Definition TMath.h:82
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Definition TMath.h:75