Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoPconEditor.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 TGeoPconEditor
13\ingroup Geometry_builder
14
15Editor for a TGeoPcon.
16
17\image html geom_pcon_pic.png
18
19\image html geom_pcon_ed.png
20
21*/
22
23#include "TGeoPconEditor.h"
24#include "TGeoTabManager.h"
25#include "TGeoPcon.h"
26#include "TGeoManager.h"
27#include "TVirtualGeoPainter.h"
28#include "TVirtualPad.h"
29#include "TView.h"
30#include "TGCanvas.h"
31#include "TGButton.h"
32#include "TGTextEntry.h"
33#include "TGNumberEntry.h"
34#include "TGLabel.h"
35
37
39
40////////////////////////////////////////////////////////////////////////////////
41/// Constructor for polycone editor
42
44 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
45{
46 fShape = nullptr;
47 fNsections = 0;
48 fSections = nullptr;
49 fNsecti = 0;
50 fPhi1i = 0;
51 fDPhii = 0;
52 fZi = nullptr;
53 fRmini = nullptr;
54 fRmaxi = nullptr;
57
58 fLHsect = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 2, 2);
59
60 // TextEntry for shape name
61 MakeTitle("Name");
62 fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kPCON_NAME);
64 fShapeName->SetToolTipText("Enter the polycone name");
65 fShapeName->Associate(this);
67
68 MakeTitle("Parameters");
69 // Number entry for Nsections
70 TGTextEntry *nef;
72 f1->AddFrame(new TGLabel(f1, "Nz"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
73 fENz = new TGNumberEntry(f1, 0., 5, kPCON_NZ);
78 nef->SetToolTipText("Enter the number of Z sections");
79 fENz->Associate(this);
80 f1->AddFrame(fENz, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
81 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
82
83 // Number entry for Phi1
84 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
85 f1->AddFrame(new TGLabel(f1, "Phi1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
86 fEPhi1 = new TGNumberEntry(f1, 0., 5, kPCON_PHI1);
89 nef->SetToolTipText("Enter the starting phi angle [deg]");
90 fEPhi1->Associate(this);
91 f1->AddFrame(fEPhi1, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
92 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
93
94 // Number entry for Dphi
95 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
96 f1->AddFrame(new TGLabel(f1, "Dphi"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
97 fEDPhi = new TGNumberEntry(f1, 0., 5, kPCON_DPHI);
101 nef->SetToolTipText("Enter the phi range [deg]");
102 fEDPhi->Associate(this);
103 f1->AddFrame(fEDPhi, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
104 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
105
106 // TGCanvas containing sections
107 MakeTitle("Pcon sections");
108 fCan = new TGCanvas(this, 160, 200, kSunkenFrame | kDoubleBorder);
110 fCan->SetContainer(cont);
111 // labels for #i, Z, Rmin, Rmax
112 f1 = new TGCompositeFrame(cont, 160, 10, kHorizontalFrame | kFixedWidth);
113 f1->AddFrame(new TGLabel(f1, "#"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
114 f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
115 f1->AddFrame(new TGLabel(f1, "Rmin"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
116 f1->AddFrame(new TGLabel(f1, "Rmax"), new TGLayoutHints(kLHintsLeft, 2, 10, 6, 0));
117 cont->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
119
120 AddFrame(fCan, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
121
122 // Delayed draw
124 fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
126 AddFrame(fDFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
127
128 // Buttons
130 fApply = new TGTextButton(fBFrame, "Apply");
131 fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
132 fApply->Associate(this);
133 fUndo = new TGTextButton(fBFrame, "Undo");
134 fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
135 fUndo->Associate(this);
136 AddFrame(fBFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
138}
139
140////////////////////////////////////////////////////////////////////////////////
141/// Destructor
142
144{
145 if (fSections)
146 delete fSections;
147 if (fZi)
148 delete[] fZi;
149 if (fRmini)
150 delete[] fRmini;
151 if (fRmaxi)
152 delete[] fRmaxi;
153 TGFrameElement *el;
154 TIter next(GetList());
155 while ((el = (TGFrameElement *)next())) {
156 if (el->fFrame->IsComposite())
158 }
159 Cleanup();
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Connect signals to slots.
164
166{
167 fENz->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoNz()");
168 fEPhi1->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoPhi()");
169 fEDPhi->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoPhi()");
170 fApply->Connect("Clicked()", "TGeoPconEditor", this, "DoApply()");
171 fUndo->Connect("Clicked()", "TGeoPconEditor", this, "DoUndo()");
172 fShapeName->Connect("TextChanged(const char *)", "TGeoPconEditor", this, "DoModified()");
173 fInit = kFALSE;
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Connect to a given pcon.
178
180{
181 if (obj == nullptr || (obj->IsA() != TGeoPcon::Class())) {
183 return;
184 }
185 fShape = (TGeoPcon *)obj;
186 const char *sname = fShape->GetName();
187 if (!strcmp(sname, fShape->ClassName()))
188 fShapeName->SetText("-no_name");
189 else
190 fShapeName->SetText(sname);
191
192 Int_t nsections = fShape->GetNz();
193 fNsecti = nsections;
194 fENz->SetNumber(nsections);
196 fPhi1i = fShape->GetPhi1();
198 fDPhii = fShape->GetDphi();
199 CreateSections(nsections);
201
204
205 if (fInit)
207 SetActive();
208}
209
210////////////////////////////////////////////////////////////////////////////////
211/// Change dynamically the number of sections.
212
214{
215 if (inew == fNsections)
216 return;
217 if (!fSections)
218 fSections = new TObjArray(8);
220 TGeoPconSection *sect;
221 Int_t isect;
222 // new sections requested
223 if (inew > fNsections) {
224 for (isect = fNsections; isect < inew; isect++) {
225 sect = new TGeoPconSection(cont, 150, 10, isect);
226 fSections->Add(sect);
227 cont->AddFrame(sect, fLHsect);
228 sect->Connect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
229 }
230 } else {
231 // some sections need to be removed
232 for (isect = inew; isect < fNsections; isect++) {
233 sect = (TGeoPconSection *)fSections->At(isect);
234 sect->HideDaughters();
235 cont->HideFrame(sect);
236 cont->RemoveFrame(sect);
237 // sect->Disconnect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
238 fSections->RemoveAt(isect);
239 delete sect;
240 }
241 }
242 fNsections = inew;
244 cont->Layout();
245 cont->MapWindow();
246 fCan->Layout();
247}
248
249////////////////////////////////////////////////////////////////////////////////
250/// Check validity of sections
251
253{
254 TGeoPconSection *sect;
255 Double_t zmin = 0;
256 Double_t rmin = 0, rmax = 1.;
257 for (Int_t isect = 0; isect < fNsections; isect++) {
258 sect = (TGeoPconSection *)fSections->At(isect);
259 if (isect && (sect->GetZ() < zmin)) {
260 if (!change)
261 return kFALSE;
262 sect->SetZ(zmin + 1.);
263 }
264 zmin = sect->GetZ();
265 if (sect->GetRmin() < 0 || (sect->GetRmax() < 0) || ((sect->GetRmin() == 0) && (sect->GetRmax() == 0))) {
266 if (!change)
267 return kFALSE;
268 sect->SetRmin(rmin);
269 sect->SetRmax(rmax);
270 }
271 rmin = sect->GetRmin();
272 rmax = sect->GetRmax();
273 }
274 return kTRUE;
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// Update sections according fShape.
279
281{
282 if (fZi)
283 delete[] fZi;
284 if (fRmini)
285 delete[] fRmini;
286 if (fRmaxi)
287 delete[] fRmaxi;
288 fZi = new Double_t[fNsections];
291 TGeoPconSection *sect;
292 for (Int_t isect = 0; isect < fNsections; isect++) {
293 sect = (TGeoPconSection *)fSections->At(isect);
294 sect->SetZ(fShape->GetZ(isect));
295 fZi[isect] = fShape->GetZ(isect);
296 sect->SetRmin(fShape->GetRmin(isect));
297 fRmini[isect] = fShape->GetRmin(isect);
298 sect->SetRmax(fShape->GetRmax(isect));
299 fRmaxi[isect] = fShape->GetRmax(isect);
300 }
301}
302
303////////////////////////////////////////////////////////////////////////////////
304/// Check if shape drawing is delayed.
305
307{
308 return (fDelayed->GetState() == kButtonDown);
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Perform name change
313
315{
316 DoModified();
317}
318
319////////////////////////////////////////////////////////////////////////////////
320/// Slot for applying modifications.
321
323{
324 const char *name = fShapeName->GetText();
325 if (strcmp(name, fShape->GetName()))
328 fUndo->SetEnabled();
329 if (!CheckSections())
330 return;
331 // check if number of sections changed
332 Bool_t recreate = kFALSE;
333 Int_t nz = fENz->GetIntNumber();
334 Double_t phi1 = fEPhi1->GetNumber();
335 Double_t dphi = fEDPhi->GetNumber();
336 if (nz != fShape->GetNz())
337 recreate = kTRUE;
338 TGeoPconSection *sect;
339 Int_t isect;
340 if (recreate) {
341 Double_t *array = new Double_t[3 * (nz + 1)];
342 array[0] = phi1;
343 array[1] = dphi;
344 array[2] = nz;
345 for (isect = 0; isect < nz; isect++) {
346 sect = (TGeoPconSection *)fSections->At(isect);
347 array[3 + 3 * isect] = sect->GetZ();
348 array[4 + 3 * isect] = sect->GetRmin();
349 array[5 + 3 * isect] = sect->GetRmax();
350 }
351 fShape->SetDimensions(array);
352 delete[] array;
353 if (fPad) {
355 TView *view = fPad->GetView();
356 if (!view) {
357 fShape->Draw();
358 fPad->GetView()->ShowAxis();
359 } else {
360 const Double_t *orig = fShape->GetOrigin();
361 view->SetRange(orig[0] - fShape->GetDX(), orig[1] - fShape->GetDY(), orig[2] - fShape->GetDZ(),
362 orig[0] + fShape->GetDX(), orig[1] + fShape->GetDY(), orig[2] + fShape->GetDZ());
363 Update();
364 }
365 } else
366 Update();
367 }
368 return;
369 }
370 // No need to call SetDimensions
371 if (TMath::Abs(phi1 - fShape->GetPhi1()) > 1.e-6)
372 fShape->Phi1() = phi1;
373 if (TMath::Abs(dphi - fShape->GetDphi()) > 1.e-6)
374 fShape->Dphi() = dphi;
375 for (isect = 0; isect < fNsections; isect++) {
376 sect = (TGeoPconSection *)fSections->At(isect);
377 fShape->Z(isect) = sect->GetZ();
378 fShape->Rmin(isect) = sect->GetRmin();
379 fShape->Rmax(isect) = sect->GetRmax();
380 }
382 if (fPad) {
384 TView *view = fPad->GetView();
385 if (!view) {
386 fShape->Draw();
387 fPad->GetView()->ShowAxis();
388 } else {
389 const Double_t *orig = fShape->GetOrigin();
390 view->SetRange(orig[0] - fShape->GetDX(), orig[1] - fShape->GetDY(), orig[2] - fShape->GetDZ(),
391 orig[0] + fShape->GetDX(), orig[1] + fShape->GetDY(), orig[2] + fShape->GetDZ());
392 Update();
393 }
394 } else
395 Update();
396 }
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// Change parameters of section isect;
401
403{
404 TGeoPconSection *sect, *sectlo = nullptr, *secthi = nullptr;
405 sect = (TGeoPconSection *)fSections->At(isect);
406 if (isect)
407 sectlo = (TGeoPconSection *)fSections->At(isect - 1);
408 if (isect < fNsections - 1)
409 secthi = (TGeoPconSection *)fSections->At(isect + 1);
410 Double_t z = sect->GetZ();
411 if (sectlo && z < sectlo->GetZ()) {
412 z = sectlo->GetZ();
413 sect->SetZ(z);
414 }
415 if (secthi && z > secthi->GetZ()) {
416 z = secthi->GetZ();
417 sect->SetZ(z);
418 }
419 DoModified();
420 if (!IsDelayed())
421 DoApply();
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// Change number of sections.
426
428{
429 Int_t nz = fENz->GetIntNumber();
430 if (nz < 2) {
431 nz = 2;
432 fENz->SetNumber(nz);
433 }
434 CreateSections(nz);
436 DoModified();
437 if (!IsDelayed())
438 DoApply();
439}
440
441////////////////////////////////////////////////////////////////////////////////
442/// Change phi range.
443
445{
446 Double_t phi1 = fEPhi1->GetNumber();
447 Double_t dphi = fEDPhi->GetNumber();
448 if (TMath::Abs(phi1) > 360)
449 fEPhi1->SetNumber(0);
450 if (dphi > 360)
451 fEDPhi->SetNumber(360);
452 DoModified();
453 if (!IsDelayed())
454 DoApply();
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Slot for signaling modifications.
459
461{
463}
464
465////////////////////////////////////////////////////////////////////////////////
466/// Slot for undoing last operation.
467
469{
474 TGeoPconSection *sect;
475 for (Int_t isect = 0; isect < fNsections; isect++) {
476 sect = (TGeoPconSection *)fSections->At(isect);
477 sect->SetZ(fZi[isect]);
478 sect->SetRmin(fRmini[isect]);
479 sect->SetRmax(fRmaxi[isect]);
480 }
481 DoApply();
484}
485
486/** \class TGeoPconSection
487\ingroup Geometry_builder
488
489Utility frame used by TGeoPcon editor.
490
491*/
492
494
495////////////////////////////////////////////////////////////////////////////////
496/// Constructor.
497
500{
501 fNumber = id;
502 TGTextEntry *nef;
503 // Label with number
504 AddFrame(new TGLabel(this, TString::Format("#%i", id)), new TGLayoutHints(kLHintsLeft, 2, 4, 6, 0));
505
506 // Z entry
507 fEZ = new TGNumberEntry(this, 0., 5);
509 nef = (TGTextEntry *)fEZ->GetNumberEntry();
510 nef->SetToolTipText("Enter the Z position");
511 fEZ->Associate(this);
512 AddFrame(fEZ, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
513 // Rmin entry
514 fERmin = new TGNumberEntry(this, 0., 5);
518 nef->SetToolTipText("Enter the minimum radius");
519 fERmin->Associate(this);
520 AddFrame(fERmin, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
521 // Rmax entry
522 fERmax = new TGNumberEntry(this, 0., 5);
526 nef->SetToolTipText("Enter the maximum radius");
527 fERmax->Associate(this);
528 AddFrame(fERmax, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
529
532 Layout();
533}
534
535////////////////////////////////////////////////////////////////////////////////
536/// Destructor
537
539{
540 Cleanup();
541}
542
543////////////////////////////////////////////////////////////////////////////////
544/// Hide daughter frames
545
547{
548 fEZ->UnmapWindow();
551}
552
553////////////////////////////////////////////////////////////////////////////////
554/// Emit Changed(Int_t) signal.
555
557{
558 Emit("Changed(Int_t)", i);
559}
560
561////////////////////////////////////////////////////////////////////////////////
562/// Connect signals to slots.
563
565{
566 fEZ->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoZ()");
567 fERmin->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmin()");
568 fERmax->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmax()");
569}
570
571////////////////////////////////////////////////////////////////////////////////
572/// Z value getter
573
575{
576 return fEZ->GetNumber();
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Rmin value getter
581
583{
584 return fERmin->GetNumber();
585}
586
587////////////////////////////////////////////////////////////////////////////////
588/// Rmax value getter
589
591{
592 return fERmax->GetNumber();
593}
594
595////////////////////////////////////////////////////////////////////////////////
596/// Z value setter
597
599{
600 fEZ->SetNumber(z);
601}
602
603////////////////////////////////////////////////////////////////////////////////
604/// Rmin value setter
605
607{
608 fERmin->SetNumber(rmin);
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// Rmax value setter
613
615{
616 fERmax->SetNumber(rmax);
617}
618
619////////////////////////////////////////////////////////////////////////////////
620/// Z slot.
621
623{
625}
626
627////////////////////////////////////////////////////////////////////////////////
628/// Rmin slot.
629
631{
632 Double_t rmin = fERmin->GetNumber();
633 Double_t rmax = fERmax->GetNumber();
634 if (rmin > rmax - 1.e-8)
635 fERmin->SetNumber(rmax);
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Rmax slot.
641
643{
644 Double_t rmin = fERmin->GetNumber();
645 Double_t rmax = fERmax->GetNumber();
646 if (rmax < rmin + 1.e-8)
647 fERmax->SetNumber(rmin);
649}
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
@ kButtonDown
Definition TGButton.h:54
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
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
ETGeoPconWid
@ kPCON_PHI1
@ kPCON_UNDO
@ kPCON_DPHI
@ kPCON_APPLY
@ kPCON_NAME
@ kPCON_NZ
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
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGFrame * GetContainer() const
Definition TGCanvas.h:216
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
void MapSubwindows() override
Map all canvas sub windows.
void Layout() override
Create layout for canvas.
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
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1149
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1190
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
void MapWindow() override
map window
Definition TGFrame.h:204
virtual Bool_t IsComposite() const
Definition TGFrame.h:212
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
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.
virtual Long_t GetIntNumber() const
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
void SetNumStyle(EStyle style)
@ kNEAPositive
Positive number.
@ kNESInteger
Style of number entry field.
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
virtual const Double_t * GetOrigin() const
Definition TGeoBBox.h:82
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.
TVirtualGeoPainter * GetPainter() const
Editor for a TGeoPcon.
TGTextEntry * fShapeName
TObjArray * fSections
void CreateSections(Int_t inew)
Change dynamically the number of sections.
void SetModel(TObject *obj) override
Connect to a given pcon.
virtual void DoUndo()
Slot for undoing last operation.
void DoModified()
Slot for signaling modifications.
Bool_t IsDelayed() const
Check if shape drawing is delayed.
void DoNz()
Change number of sections.
void DoSectionChange(Int_t i)
Change parameters of section isect;.
TGNumberEntry * fEPhi1
Double_t * fRmaxi
TGLayoutHints * fLHsect
TGTextButton * fUndo
Bool_t CheckSections(Bool_t change=kFALSE)
Check validity of sections.
Double_t * fRmini
TGNumberEntry * fEDPhi
TGeoPcon * fShape
TGCompositeFrame * fBFrame
TGCanvas * fCan
void DoName()
Perform name change.
TGCompositeFrame * fDFrame
TGTextButton * fApply
TGeoPconEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for polycone editor.
void DoPhi()
Change phi range.
Bool_t fIsShapeEditable
~TGeoPconEditor() override
Destructor.
virtual void ConnectSignals2Slots()
Connect signals to slots.
virtual void DoApply()
Slot for applying modifications.
TGCheckButton * fDelayed
void UpdateSections()
Update sections according fShape.
TGNumberEntry * fENz
Utility frame used by TGeoPcon editor.
void DoRmin()
Rmin slot.
void SetZ(Double_t z)
Z value setter.
void SetRmin(Double_t rmin)
Rmin value setter.
void SetRmax(Double_t rmax)
Rmax value setter.
TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id)
Constructor.
~TGeoPconSection() override
Destructor.
void HideDaughters()
Hide daughter frames.
TGNumberEntry * fERmax
Double_t GetRmax() const
Rmax value getter.
void DoRmax()
Rmax slot.
TGNumberEntry * fEZ
TGNumberEntry * fERmin
virtual void Changed(Int_t i)
Emit Changed(Int_t) signal.
Double_t GetZ() const
Z value getter.
void DoZ()
Z slot.
virtual void ConnectSignals2Slots()
Connect signals to slots.
Double_t GetRmin() const
Rmin value getter.
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Definition TGeoPcon.h:17
Double_t * GetRmax() const
Definition TGeoPcon.h:82
Double_t & Rmin(Int_t ipl)
Definition TGeoPcon.h:95
Double_t GetDphi() const
Definition TGeoPcon.h:77
Double_t & Rmax(Int_t ipl)
Definition TGeoPcon.h:96
void SetDimensions(Double_t *param) override
Set polycone dimensions starting from an array.
Double_t & Z(Int_t ipl)
Definition TGeoPcon.h:97
Double_t * GetZ() const
Definition TGeoPcon.h:84
static TClass * Class()
Double_t & Phi1()
Definition TGeoPcon.h:93
Double_t & Dphi()
Definition TGeoPcon.h:94
void ComputeBBox() override
compute bounding box of the pcon Check if the sections are in increasing Z order
Definition TGeoPcon.cxx:288
Int_t GetNz() const
Definition TGeoPcon.h:78
Double_t * GetRmin() const
Definition TGeoPcon.h:80
Double_t GetPhi1() const
Definition TGeoPcon.h:76
void Draw(Option_t *option="") override
Draw this shape.
const char * GetName() const override
Get the shape name.
static void Cleanup(TGCompositeFrame *frame)
Static method to cleanup hierarchically all daughters of a composite frame.
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
An array of TObjects.
Definition TObjArray.h:31
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
void Add(TObject *obj) override
Definition TObjArray.h:68
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:207
virtual TClass * IsA() const
Definition TObject.h:245
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
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
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
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
TF1 * f1
Definition legend1.C:11
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123