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
40};
41
42////////////////////////////////////////////////////////////////////////////////
43/// Constructor for polycone editor
44
46 Int_t height, UInt_t options, Pixel_t back)
47 : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
48{
49 fShape = 0;
50 fNsections = 0;
51 fSections = 0;
52 fNsecti = 0;
53 fPhi1i = 0;
54 fDPhii = 0;
55 fZi = 0;
56 fRmini = 0;
57 fRmaxi = 0;
60
62
63 // TextEntry for shape name
64 MakeTitle("Name");
65 fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kPCON_NAME);
67 fShapeName->SetToolTipText("Enter the polycone name");
68 fShapeName->Associate(this);
70
71 MakeTitle("Parameters");
72 // Number entry for Nsections
73 TGTextEntry *nef;
75 f1->AddFrame(new TGLabel(f1, "Nz"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
76 fENz = new TGNumberEntry(f1, 0., 5, kPCON_NZ);
81 nef->SetToolTipText("Enter the number of Z sections");
82 fENz->Associate(this);
83 f1->AddFrame(fENz, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
84 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
85
86 // Number entry for Phi1
87 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
88 f1->AddFrame(new TGLabel(f1, "Phi1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
89 fEPhi1 = new TGNumberEntry(f1, 0., 5, kPCON_PHI1);
92 nef->SetToolTipText("Enter the starting phi angle [deg]");
93 fEPhi1->Associate(this);
94 f1->AddFrame(fEPhi1, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
95 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
96
97 // Number entry for Dphi
98 f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
99 f1->AddFrame(new TGLabel(f1, "Dphi"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
100 fEDPhi = new TGNumberEntry(f1, 0., 5, kPCON_DPHI);
104 nef->SetToolTipText("Enter the phi range [deg]");
105 fEDPhi->Associate(this);
106 f1->AddFrame(fEDPhi, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
107 AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
108
109 // TGCanvas containing sections
110 MakeTitle("Pcon sections");
111 fCan = new TGCanvas(this, 160, 200, kSunkenFrame | kDoubleBorder);
113 fCan->SetContainer(cont);
114 // labels for #i, Z, Rmin, Rmax
115 f1 = new TGCompositeFrame(cont, 160, 10, kHorizontalFrame | kFixedWidth);
116 f1->AddFrame(new TGLabel(f1, "#"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
117 f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
118 f1->AddFrame(new TGLabel(f1, "Rmin"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
119 f1->AddFrame(new TGLabel(f1, "Rmax"), new TGLayoutHints(kLHintsLeft, 2, 10, 6, 0));
120 cont->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0,0,0,0));
122
123 AddFrame(fCan, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
124
125 // Delayed draw
127 fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
129 AddFrame(fDFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
130
131 // Buttons
133 fApply = new TGTextButton(fBFrame, "Apply");
134 fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
135 fApply->Associate(this);
136 fUndo = new TGTextButton(fBFrame, "Undo");
137 fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 4, 4));
138 fUndo->Associate(this);
139 AddFrame(fBFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Destructor
145
147{
148 if (fSections) delete fSections;
149 if (fZi) delete [] fZi;
150 if (fRmini) delete [] fRmini;
151 if (fRmaxi) delete [] fRmaxi;
152 TGFrameElement *el;
153 TIter next(GetList());
154 while ((el = (TGFrameElement *)next())) {
155 if (el->fFrame->IsComposite())
157 }
158 Cleanup();
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Connect signals to slots.
163
165{
166 fENz->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoNz()");
167 fEPhi1->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoPhi()");
168 fEDPhi->Connect("ValueSet(Long_t)", "TGeoPconEditor", this, "DoPhi()");
169 fApply->Connect("Clicked()", "TGeoPconEditor", this, "DoApply()");
170 fUndo->Connect("Clicked()", "TGeoPconEditor", this, "DoUndo()");
171 fShapeName->Connect("TextChanged(const char *)", "TGeoPconEditor", this, "DoModified()");
172 fInit = kFALSE;
173}
174
175
176////////////////////////////////////////////////////////////////////////////////
177/// Connect to a given pcon.
178
180{
181 if (obj == 0 || (obj->IsA() != TGeoPcon::Class())) {
183 return;
184 }
185 fShape = (TGeoPcon*)obj;
186 const char *sname = fShape->GetName();
187 if (!strcmp(sname, fShape->ClassName())) fShapeName->SetText("-no_name");
188 else fShapeName->SetText(sname);
189
190 Int_t nsections = fShape->GetNz();
191 fNsecti = nsections;
192 fENz->SetNumber(nsections);
194 fPhi1i = fShape->GetPhi1();
196 fDPhii = fShape->GetDphi();
197 CreateSections(nsections);
199
202
204 SetActive();
205}
206
207////////////////////////////////////////////////////////////////////////////////
208/// Change dynamically the number of sections.
209
211{
212 if (inew == fNsections) return;
213 if (!fSections) fSections = new TObjArray(8);
215 TGeoPconSection *sect;
216 Int_t isect;
217 // new sections requested
218 if (inew>fNsections) {
219 for (isect=fNsections; isect<inew; isect++) {
220 sect = new TGeoPconSection(cont, 150, 10, isect);
221 fSections->Add(sect);
222 cont->AddFrame(sect, fLHsect);
223 sect->Connect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
224 }
225 } else {
226 // some sections need to be removed
227 for (isect=inew; isect<fNsections; isect++) {
228 sect = (TGeoPconSection*)fSections->At(isect);
229 sect->HideDaughters();
230 cont->HideFrame(sect);
231 cont->RemoveFrame(sect);
232// sect->Disconnect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
233 fSections->RemoveAt(isect);
234 delete sect;
235 }
236 }
237 fNsections = inew;
239 cont->Layout();
240 cont->MapWindow();
241 fCan->Layout();
242}
243
244////////////////////////////////////////////////////////////////////////////////
245/// Check validity of sections
246
248{
249 TGeoPconSection *sect;
250 Double_t zmin = 0;
251 Double_t rmin = 0, rmax = 1.;
252 for (Int_t isect=0; isect<fNsections; isect++) {
253 sect = (TGeoPconSection*)fSections->At(isect);
254 if (isect && (sect->GetZ()<zmin)) {
255 if (!change) return kFALSE;
256 sect->SetZ(zmin+1.);
257 }
258 zmin = sect->GetZ();
259 if (sect->GetRmin()<0 ||
260 (sect->GetRmax()<0) || ((sect->GetRmin()==0) && (sect->GetRmax()==0))) {
261 if (!change) return kFALSE;
262 sect->SetRmin(rmin);
263 sect->SetRmax(rmax);
264 }
265 rmin = sect->GetRmin();
266 rmax = sect->GetRmax();
267 }
268 return kTRUE;
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Update sections according fShape.
273
275{
276 if (fZi) delete [] fZi;
277 if (fRmini) delete [] fRmini;
278 if (fRmaxi) delete [] fRmaxi;
279 fZi = new Double_t[fNsections];
282 TGeoPconSection *sect;
283 for (Int_t isect=0; isect<fNsections; isect++) {
284 sect = (TGeoPconSection*)fSections->At(isect);
285 sect->SetZ(fShape->GetZ(isect));
286 fZi[isect] = fShape->GetZ(isect);
287 sect->SetRmin(fShape->GetRmin(isect));
288 fRmini[isect] = fShape->GetRmin(isect);
289 sect->SetRmax(fShape->GetRmax(isect));
290 fRmaxi[isect] = fShape->GetRmax(isect);
291 }
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Check if shape drawing is delayed.
296
298{
299 return (fDelayed->GetState() == kButtonDown);
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Perform name change
304
306{
307 DoModified();
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Slot for applying modifications.
312
314{
315 const char *name = fShapeName->GetText();
316 if (strcmp(name,fShape->GetName())) fShape->SetName(name);
318 fUndo->SetEnabled();
319 if (!CheckSections()) return;
320 // check if number of sections changed
321 Bool_t recreate = kFALSE;
322 Int_t nz = fENz->GetIntNumber();
323 Double_t phi1 = fEPhi1->GetNumber();
324 Double_t dphi = fEDPhi->GetNumber();
325 if (nz != fShape->GetNz()) recreate = kTRUE;
326 TGeoPconSection *sect;
327 Int_t isect;
328 if (recreate) {
329 Double_t *array = new Double_t[3*(nz+1)];
330 array[0] = phi1;
331 array[1] = dphi;
332 array[2] = nz;
333 for (isect=0; isect<nz; isect++) {
334 sect = (TGeoPconSection*)fSections->At(isect);
335 array[3+3*isect] = sect->GetZ();
336 array[4+3*isect] = sect->GetRmin();
337 array[5+3*isect] = sect->GetRmax();
338 }
339 fShape->SetDimensions(array);
340 delete [] array;
341 if (fPad) {
343 TView *view = fPad->GetView();
344 if (!view) {
345 fShape->Draw();
346 fPad->GetView()->ShowAxis();
347 } else {
348 const Double_t *orig = fShape->GetOrigin();
349 view->SetRange(orig[0]-fShape->GetDX(), orig[1]-fShape->GetDY(), orig[2]-fShape->GetDZ(),
350 orig[0]+fShape->GetDX(), orig[1]+fShape->GetDY(), orig[2]+fShape->GetDZ());
351 Update();
352 }
353 } else Update();
354 }
355 return;
356 }
357 // No need to call SetDimensions
358 if (TMath::Abs(phi1-fShape->GetPhi1())>1.e-6) fShape->Phi1() = phi1;
359 if (TMath::Abs(dphi-fShape->GetDphi())>1.e-6) fShape->Dphi() = dphi;
360 for (isect=0; isect<fNsections; isect++) {
361 sect = (TGeoPconSection*)fSections->At(isect);
362 fShape->Z(isect) = sect->GetZ();
363 fShape->Rmin(isect) = sect->GetRmin();
364 fShape->Rmax(isect) = sect->GetRmax();
365 }
367 if (fPad) {
369 TView *view = fPad->GetView();
370 if (!view) {
371 fShape->Draw();
372 fPad->GetView()->ShowAxis();
373 } else {
374 const Double_t *orig = fShape->GetOrigin();
375 view->SetRange(orig[0]-fShape->GetDX(), orig[1]-fShape->GetDY(), orig[2]-fShape->GetDZ(),
376 orig[0]+fShape->GetDX(), orig[1]+fShape->GetDY(), orig[2]+fShape->GetDZ());
377 Update();
378 }
379 } else Update();
380 }
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Change parameters of section isect;
385
387{
388 TGeoPconSection *sect, *sectlo=0, *secthi=0;
389 sect = (TGeoPconSection*)fSections->At(isect);
390 if (isect) sectlo = (TGeoPconSection*)fSections->At(isect-1);
391 if (isect<fNsections-1) secthi = (TGeoPconSection*)fSections->At(isect+1);
392 Double_t z = sect->GetZ();
393 if (sectlo && z<sectlo->GetZ()) {
394 z = sectlo->GetZ();
395 sect->SetZ(z);
396 }
397 if (secthi && z>secthi->GetZ()) {
398 z = secthi->GetZ();
399 sect->SetZ(z);
400 }
401 DoModified();
402 if (!IsDelayed()) DoApply();
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Change number of sections.
407
409{
410 Int_t nz = fENz->GetIntNumber();
411 if (nz < 2) {
412 nz = 2;
413 fENz->SetNumber(nz);
414 }
415 CreateSections(nz);
417 DoModified();
418 if (!IsDelayed()) DoApply();
419}
420
421////////////////////////////////////////////////////////////////////////////////
422/// Change phi range.
423
425{
426 Double_t phi1 = fEPhi1->GetNumber();
427 Double_t dphi = fEDPhi->GetNumber();
428 if (TMath::Abs(phi1)>360) fEPhi1->SetNumber(0);
429 if (dphi>360) fEDPhi->SetNumber(360);
430 DoModified();
431 if (!IsDelayed()) DoApply();
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Slot for signaling modifications.
436
438{
440}
441
442////////////////////////////////////////////////////////////////////////////////
443/// Slot for undoing last operation.
444
446{
451 TGeoPconSection *sect;
452 for (Int_t isect=0; isect<fNsections; isect++) {
453 sect = (TGeoPconSection*)fSections->At(isect);
454 sect->SetZ(fZi[isect]);
455 sect->SetRmin(fRmini[isect]);
456 sect->SetRmax(fRmaxi[isect]);
457 }
458 DoApply();
461}
462
463/** \class TGeoPconSection
464\ingroup Geometry_builder
465
466Utility frame used by TGeoPcon editor.
467
468*/
469
471
472////////////////////////////////////////////////////////////////////////////////
473/// Constructor.
474
477{
478 fNumber = id;
479 TGTextEntry *nef;
480 // Label with number
481 AddFrame(new TGLabel(this, TString::Format("#%i",id)), new TGLayoutHints(kLHintsLeft, 2, 4, 6, 0));
482
483 // Z entry
484 fEZ = new TGNumberEntry(this, 0., 5);
486 nef = (TGTextEntry*)fEZ->GetNumberEntry();
487 nef->SetToolTipText("Enter the Z position");
488 fEZ->Associate(this);
489 AddFrame(fEZ, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
490 // Rmin entry
491 fERmin = new TGNumberEntry(this, 0., 5);
495 nef->SetToolTipText("Enter the minimum radius");
496 fERmin->Associate(this);
497 AddFrame(fERmin, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
498 // Rmax entry
499 fERmax = new TGNumberEntry(this, 0., 5);
503 nef->SetToolTipText("Enter the maximum radius");
504 fERmax->Associate(this);
505 AddFrame(fERmax, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
506
509 Layout();
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Destructor
514
516{
517 Cleanup();
518}
519
520////////////////////////////////////////////////////////////////////////////////
521/// Hide daughter frames
522
524{
525 fEZ->UnmapWindow();
528}
529
530////////////////////////////////////////////////////////////////////////////////
531/// Emit Changed(Int_t) signal.
532
534{
535 Emit("Changed(Int_t)", i);
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Connect signals to slots.
540
542{
543 fEZ->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoZ()");
544 fERmin->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmin()");
545 fERmax->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmax()");
546}
547
548////////////////////////////////////////////////////////////////////////////////
549/// Z value getter
550
552{
553 return fEZ->GetNumber();
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Rmin value getter
558
560{
561 return fERmin->GetNumber();
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// Rmax value getter
566
568{
569 return fERmax->GetNumber();
570}
571
572////////////////////////////////////////////////////////////////////////////////
573/// Z value setter
574
576{
577 fEZ->SetNumber(z);
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Rmin value setter
582
584{
585 fERmin->SetNumber(rmin);
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// Rmax value setter
590
592{
593 fERmax->SetNumber(rmax);
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// Z slot.
598
600{
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// Rmin slot.
606
608{
609 Double_t rmin = fERmin->GetNumber();
610 Double_t rmax = fERmax->GetNumber();
611 if (rmin>rmax-1.e-8) fERmin->SetNumber(rmax);
613}
614
615////////////////////////////////////////////////////////////////////////////////
616/// Rmax slot.
617
619{
620 Double_t rmin = fERmin->GetNumber();
621 Double_t rmax = fERmax->GetNumber();
622 if (rmax<rmin+1.e-8) fERmax->SetNumber(rmin);
624}
@ 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
const Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
@ kButtonDown
Definition TGButton.h:54
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
XFontStruct * id
Definition TGX11.cxx:109
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
virtual void MapSubwindows()
Map all canvas sub windows.
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
virtual void Layout()
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 TList * GetList() const
Definition TGFrame.h:310
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
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
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
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:605
virtual void MapWindow()
map window
Definition TGFrame.h:204
virtual void UnmapWindow()
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.
UInt_t GetDefaultHeight() const
TGNumberEntryField * GetNumberEntry() const
virtual void Associate(const TGWindow *w)
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)
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:77
virtual Double_t GetDX() const
Definition TGeoBBox.h:74
virtual Double_t GetDZ() const
Definition TGeoBBox.h:76
virtual Double_t GetDY() const
Definition TGeoBBox.h:75
Common base class for geombuilder editors.
virtual void Update()
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
virtual ~TGeoPconEditor()
Destructor.
TObjArray * fSections
void CreateSections(Int_t inew)
Change dynamically the number of sections.
TGeoPconEditor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor for polycone editor.
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
virtual void SetModel(TObject *obj)
Connect to a given pcon.
void DoPhi()
Change phi range.
Bool_t fIsShapeEditable
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.
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.
virtual ~TGeoPconSection()
Destructor.
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:18
Double_t * GetRmax() const
Definition TGeoPcon.h:81
virtual void SetDimensions(Double_t *param)
Set polycone dimensions starting from an array.
Double_t & Rmin(Int_t ipl)
Definition TGeoPcon.h:94
Double_t GetDphi() const
Definition TGeoPcon.h:76
Double_t & Rmax(Int_t ipl)
Definition TGeoPcon.h:95
virtual void ComputeBBox()
compute bounding box of the pcon Check if the sections are in increasing Z order
Definition TGeoPcon.cxx:274
Double_t & Z(Int_t ipl)
Definition TGeoPcon.h:96
Double_t * GetZ() const
Definition TGeoPcon.h:83
Double_t & Phi1()
Definition TGeoPcon.h:92
Double_t & Dphi()
Definition TGeoPcon.h:93
Int_t GetNz() const
Definition TGeoPcon.h:77
Double_t * GetRmin() const
Definition TGeoPcon.h:79
Double_t GetPhi1() const
Definition TGeoPcon.h:75
virtual const char * GetName() const
Get the shape name.
virtual void Draw(Option_t *option="")
Draw this shape.
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
void Add(TObject *obj)
Definition TObjArray.h:68
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * At(Int_t idx) const
Definition TObjArray.h:164
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:200
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:2336
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)
Definition TMathBase.h:120