Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
15 Editor 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 "TPad.h"
29 #include "TView.h"
30 #include "TGTab.h"
31 #include "TGComboBox.h"
32 #include "TGButton.h"
33 #include "TGTextEntry.h"
34 #include "TGNumberEntry.h"
35 #include "TGLabel.h"
36 
37 ClassImp(TGeoPconEditor);
38 
39 enum ETGeoPconWid {
40  kPCON_NAME, kPCON_NZ, kPCON_PHI1, kPCON_DPHI, kPCON_APPLY, kPCON_UNDO
41 };
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Constructor for polycone editor
45 
46 TGeoPconEditor::TGeoPconEditor(const TGWindow *p, Int_t width,
47  Int_t height, UInt_t options, Pixel_t back)
48  : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
49 {
50  fShape = 0;
51  fNsections = 0;
52  fSections = 0;
53  fNsecti = 0;
54  fPhi1i = 0;
55  fDPhii = 0;
56  fZi = 0;
57  fRmini = 0;
58  fRmaxi = 0;
59  fIsModified = kFALSE;
60  fIsShapeEditable = kFALSE;
61 
62  fLHsect = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0,0,2,2);
63 
64  // TextEntry for shape name
65  MakeTitle("Name");
66  fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kPCON_NAME);
67  fShapeName->Resize(135, fShapeName->GetDefaultHeight());
68  fShapeName->SetToolTipText("Enter the polycone name");
69  fShapeName->Associate(this);
70  AddFrame(fShapeName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));
71 
72  MakeTitle("Parameters");
73  // Number entry for Nsections
74  TGTextEntry *nef;
75  TGCompositeFrame *f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
76  f1->AddFrame(new TGLabel(f1, "Nz"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
77  fENz = new TGNumberEntry(f1, 0., 5, kPCON_NZ);
78  fENz->SetNumAttr(TGNumberFormat::kNEAPositive);
79  fENz->SetNumStyle(TGNumberFormat::kNESInteger);
80  fENz->Resize(100,fENz->GetDefaultHeight());
81  nef = (TGTextEntry*)fENz->GetNumberEntry();
82  nef->SetToolTipText("Enter the number of Z sections");
83  fENz->Associate(this);
84  f1->AddFrame(fENz, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
85  AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
86 
87  // Number entry for Phi1
88  f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
89  f1->AddFrame(new TGLabel(f1, "Phi1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
90  fEPhi1 = new TGNumberEntry(f1, 0., 5, kPCON_PHI1);
91  fEPhi1->Resize(100,fEPhi1->GetDefaultHeight());
92  nef = (TGTextEntry*)fEPhi1->GetNumberEntry();
93  nef->SetToolTipText("Enter the starting phi angle [deg]");
94  fEPhi1->Associate(this);
95  f1->AddFrame(fEPhi1, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
96  AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
97 
98  // Number entry for Dphi
99  f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
100  f1->AddFrame(new TGLabel(f1, "Dphi"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
101  fEDPhi = new TGNumberEntry(f1, 0., 5, kPCON_DPHI);
102  fEDPhi->SetNumAttr(TGNumberFormat::kNEAPositive);
103  fEDPhi->Resize(100,fEDPhi->GetDefaultHeight());
104  nef = (TGTextEntry*)fEDPhi->GetNumberEntry();
105  nef->SetToolTipText("Enter the phi range [deg]");
106  fEDPhi->Associate(this);
107  f1->AddFrame(fEDPhi, new TGLayoutHints(kLHintsRight, 2, 2, 2, 2));
108  AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
109 
110  // TGCanvas containing sections
111  MakeTitle("Pcon sections");
112  fCan = new TGCanvas(this, 160, 200, kSunkenFrame | kDoubleBorder);
113  TGCompositeFrame *cont = new TGCompositeFrame(fCan->GetViewPort(), 155, 20, kVerticalFrame | kFixedWidth);
114  fCan->SetContainer(cont);
115  // labels for #i, Z, Rmin, Rmax
116  f1 = new TGCompositeFrame(cont, 160, 10, kHorizontalFrame | kFixedWidth);
117  f1->AddFrame(new TGLabel(f1, "#"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
118  f1->AddFrame(new TGLabel(f1, "Z"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
119  f1->AddFrame(new TGLabel(f1, "Rmin"), new TGLayoutHints(kLHintsLeft, 2, 20, 6, 0));
120  f1->AddFrame(new TGLabel(f1, "Rmax"), new TGLayoutHints(kLHintsLeft, 2, 10, 6, 0));
121  cont->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 0,0,0,0));
122  CreateSections(2);
123 
124  AddFrame(fCan, new TGLayoutHints(kLHintsLeft, 0, 0, 4, 4));
125 
126  // Delayed draw
127  fDFrame = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth | kSunkenFrame);
128  fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
129  fDFrame->AddFrame(fDelayed, new TGLayoutHints(kLHintsLeft , 2, 2, 4, 4));
130  AddFrame(fDFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
131 
132  // Buttons
133  fBFrame = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
134  fApply = new TGTextButton(fBFrame, "Apply");
135  fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
136  fApply->Associate(this);
137  fUndo = new TGTextButton(fBFrame, "Undo");
138  fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 4, 4));
139  fUndo->Associate(this);
140  AddFrame(fBFrame, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
141  fUndo->SetSize(fApply->GetSize());
142 }
143 
144 ////////////////////////////////////////////////////////////////////////////////
145 /// Destructor
146 
147 TGeoPconEditor::~TGeoPconEditor()
148 {
149  if (fSections) delete fSections;
150  if (fZi) delete [] fZi;
151  if (fRmini) delete [] fRmini;
152  if (fRmaxi) delete [] fRmaxi;
153  TGFrameElement *el;
154  TIter next(GetList());
155  while ((el = (TGFrameElement *)next())) {
156  if (el->fFrame->IsComposite())
157  TGeoTabManager::Cleanup((TGCompositeFrame*)el->fFrame);
158  }
159  Cleanup();
160 }
161 
162 ////////////////////////////////////////////////////////////////////////////////
163 /// Connect signals to slots.
164 
165 void TGeoPconEditor::ConnectSignals2Slots()
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 ////////////////////////////////////////////////////////////////////////////////
178 /// Connect to a given pcon.
179 
180 void TGeoPconEditor::SetModel(TObject* obj)
181 {
182  if (obj == 0 || (obj->IsA() != TGeoPcon::Class())) {
183  SetActive(kFALSE);
184  return;
185  }
186  fShape = (TGeoPcon*)obj;
187  const char *sname = fShape->GetName();
188  if (!strcmp(sname, fShape->ClassName())) fShapeName->SetText("-no_name");
189  else fShapeName->SetText(sname);
190 
191  Int_t nsections = fShape->GetNz();
192  fNsecti = nsections;
193  fENz->SetNumber(nsections);
194  fEPhi1->SetNumber(fShape->GetPhi1());
195  fPhi1i = fShape->GetPhi1();
196  fEDPhi->SetNumber(fShape->GetDphi());
197  fDPhii = fShape->GetDphi();
198  CreateSections(nsections);
199  UpdateSections();
200 
201  fApply->SetEnabled(kFALSE);
202  fUndo->SetEnabled(kFALSE);
203 
204  if (fInit) ConnectSignals2Slots();
205  SetActive();
206 }
207 
208 ////////////////////////////////////////////////////////////////////////////////
209 /// Change dynamically the number of sections.
210 
211 void TGeoPconEditor::CreateSections(Int_t inew)
212 {
213  if (inew == fNsections) return;
214  if (!fSections) fSections = new TObjArray(8);
215  TGCompositeFrame *cont = (TGCompositeFrame*)fCan->GetContainer();
216  TGeoPconSection *sect;
217  Int_t isect;
218  // new sections requested
219  if (inew>fNsections) {
220  for (isect=fNsections; isect<inew; isect++) {
221  sect = new TGeoPconSection(cont, 150, 10, isect);
222  fSections->Add(sect);
223  cont->AddFrame(sect, fLHsect);
224  sect->Connect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
225  }
226  } else {
227  // some sections need to be removed
228  for (isect=inew; isect<fNsections; isect++) {
229  sect = (TGeoPconSection*)fSections->At(isect);
230  sect->HideDaughters();
231  cont->HideFrame(sect);
232  cont->RemoveFrame(sect);
233 // sect->Disconnect("Changed(Int_t)", "TGeoPconEditor", this, "DoSectionChange(Int_t)");
234  fSections->RemoveAt(isect);
235  delete sect;
236  }
237  }
238  fNsections = inew;
239  fCan->MapSubwindows();
240  cont->Layout();
241  cont->MapWindow();
242  fCan->Layout();
243 }
244 
245 ////////////////////////////////////////////////////////////////////////////////
246 /// Check validity of sections
247 
248 Bool_t TGeoPconEditor::CheckSections(Bool_t change)
249 {
250  TGeoPconSection *sect;
251  Double_t zmin = 0;
252  Double_t rmin = 0, rmax = 1.;
253  for (Int_t isect=0; isect<fNsections; isect++) {
254  sect = (TGeoPconSection*)fSections->At(isect);
255  if (isect && (sect->GetZ()<zmin)) {
256  if (!change) return kFALSE;
257  sect->SetZ(zmin+1.);
258  }
259  zmin = sect->GetZ();
260  if (sect->GetRmin()<0 ||
261  (sect->GetRmax()<0) || ((sect->GetRmin()==0) && (sect->GetRmax()==0))) {
262  if (!change) return kFALSE;
263  sect->SetRmin(rmin);
264  sect->SetRmax(rmax);
265  }
266  rmin = sect->GetRmin();
267  rmax = sect->GetRmax();
268  }
269  return kTRUE;
270 }
271 
272 ////////////////////////////////////////////////////////////////////////////////
273 /// Update sections according fShape.
274 
275 void TGeoPconEditor::UpdateSections()
276 {
277  if (fZi) delete [] fZi;
278  if (fRmini) delete [] fRmini;
279  if (fRmaxi) delete [] fRmaxi;
280  fZi = new Double_t[fNsections];
281  fRmini = new Double_t[fNsections];
282  fRmaxi = new Double_t[fNsections];
283  TGeoPconSection *sect;
284  for (Int_t isect=0; isect<fNsections; isect++) {
285  sect = (TGeoPconSection*)fSections->At(isect);
286  sect->SetZ(fShape->GetZ(isect));
287  fZi[isect] = fShape->GetZ(isect);
288  sect->SetRmin(fShape->GetRmin(isect));
289  fRmini[isect] = fShape->GetRmin(isect);
290  sect->SetRmax(fShape->GetRmax(isect));
291  fRmaxi[isect] = fShape->GetRmax(isect);
292  }
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Check if shape drawing is delayed.
297 
298 Bool_t TGeoPconEditor::IsDelayed() const
299 {
300  return (fDelayed->GetState() == kButtonDown);
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// Perform name change
305 
306 void TGeoPconEditor::DoName()
307 {
308  DoModified();
309 }
310 
311 ////////////////////////////////////////////////////////////////////////////////
312 /// Slot for applying modifications.
313 
314 void TGeoPconEditor::DoApply()
315 {
316  const char *name = fShapeName->GetText();
317  if (strcmp(name,fShape->GetName())) fShape->SetName(name);
318  fApply->SetEnabled(kFALSE);
319  fUndo->SetEnabled();
320  if (!CheckSections()) return;
321  // check if number of sections changed
322  Bool_t recreate = kFALSE;
323  Int_t nz = fENz->GetIntNumber();
324  Double_t phi1 = fEPhi1->GetNumber();
325  Double_t dphi = fEDPhi->GetNumber();
326  if (nz != fShape->GetNz()) recreate = kTRUE;
327  TGeoPconSection *sect;
328  Int_t isect;
329  if (recreate) {
330  Double_t *array = new Double_t[3*(nz+1)];
331  array[0] = phi1;
332  array[1] = dphi;
333  array[2] = nz;
334  for (isect=0; isect<nz; isect++) {
335  sect = (TGeoPconSection*)fSections->At(isect);
336  array[3+3*isect] = sect->GetZ();
337  array[4+3*isect] = sect->GetRmin();
338  array[5+3*isect] = sect->GetRmax();
339  }
340  fShape->SetDimensions(array);
341  delete [] array;
342  if (fPad) {
343  if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
344  TView *view = fPad->GetView();
345  if (!view) {
346  fShape->Draw();
347  fPad->GetView()->ShowAxis();
348  } else {
349  const Double_t *orig = fShape->GetOrigin();
350  view->SetRange(orig[0]-fShape->GetDX(), orig[1]-fShape->GetDY(), orig[2]-fShape->GetDZ(),
351  orig[0]+fShape->GetDX(), orig[1]+fShape->GetDY(), orig[2]+fShape->GetDZ());
352  Update();
353  }
354  } else Update();
355  }
356  return;
357  }
358  // No need to call SetDimensions
359  if (TMath::Abs(phi1-fShape->GetPhi1())>1.e-6) fShape->Phi1() = phi1;
360  if (TMath::Abs(dphi-fShape->GetDphi())>1.e-6) fShape->Dphi() = dphi;
361  for (isect=0; isect<fNsections; isect++) {
362  sect = (TGeoPconSection*)fSections->At(isect);
363  fShape->Z(isect) = sect->GetZ();
364  fShape->Rmin(isect) = sect->GetRmin();
365  fShape->Rmax(isect) = sect->GetRmax();
366  }
367  fShape->ComputeBBox();
368  if (fPad) {
369  if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
370  TView *view = fPad->GetView();
371  if (!view) {
372  fShape->Draw();
373  fPad->GetView()->ShowAxis();
374  } else {
375  const Double_t *orig = fShape->GetOrigin();
376  view->SetRange(orig[0]-fShape->GetDX(), orig[1]-fShape->GetDY(), orig[2]-fShape->GetDZ(),
377  orig[0]+fShape->GetDX(), orig[1]+fShape->GetDY(), orig[2]+fShape->GetDZ());
378  Update();
379  }
380  } else Update();
381  }
382 }
383 
384 ////////////////////////////////////////////////////////////////////////////////
385 /// Change parameters of section isect;
386 
387 void TGeoPconEditor::DoSectionChange(Int_t isect)
388 {
389  TGeoPconSection *sect, *sectlo=0, *secthi=0;
390  sect = (TGeoPconSection*)fSections->At(isect);
391  if (isect) sectlo = (TGeoPconSection*)fSections->At(isect-1);
392  if (isect<fNsections-1) secthi = (TGeoPconSection*)fSections->At(isect+1);
393  Double_t z = sect->GetZ();
394  if (sectlo && z<sectlo->GetZ()) {
395  z = sectlo->GetZ();
396  sect->SetZ(z);
397  }
398  if (secthi && z>secthi->GetZ()) {
399  z = secthi->GetZ();
400  sect->SetZ(z);
401  }
402  DoModified();
403  if (!IsDelayed()) DoApply();
404 }
405 
406 ////////////////////////////////////////////////////////////////////////////////
407 /// Change number of sections.
408 
409 void TGeoPconEditor::DoNz()
410 {
411  Int_t nz = fENz->GetIntNumber();
412  if (nz < 2) {
413  nz = 2;
414  fENz->SetNumber(nz);
415  }
416  CreateSections(nz);
417  CheckSections(kTRUE);
418  DoModified();
419  if (!IsDelayed()) DoApply();
420 }
421 
422 ////////////////////////////////////////////////////////////////////////////////
423 /// Change phi range.
424 
425 void TGeoPconEditor::DoPhi()
426 {
427  Double_t phi1 = fEPhi1->GetNumber();
428  Double_t dphi = fEDPhi->GetNumber();
429  if (TMath::Abs(phi1)>360) fEPhi1->SetNumber(0);
430  if (dphi>360) fEDPhi->SetNumber(360);
431  DoModified();
432  if (!IsDelayed()) DoApply();
433 }
434 
435 ////////////////////////////////////////////////////////////////////////////////
436 /// Slot for signaling modifications.
437 
438 void TGeoPconEditor::DoModified()
439 {
440  fApply->SetEnabled();
441 }
442 
443 ////////////////////////////////////////////////////////////////////////////////
444 /// Slot for undoing last operation.
445 
446 void TGeoPconEditor::DoUndo()
447 {
448  fENz->SetNumber(fNsecti);
449  CreateSections(fNsecti);
450  fEPhi1->SetNumber(fPhi1i);
451  fEDPhi->SetNumber(fDPhii);
452  TGeoPconSection *sect;
453  for (Int_t isect=0; isect<fNsections; isect++) {
454  sect = (TGeoPconSection*)fSections->At(isect);
455  sect->SetZ(fZi[isect]);
456  sect->SetRmin(fRmini[isect]);
457  sect->SetRmax(fRmaxi[isect]);
458  }
459  DoApply();
460  fUndo->SetEnabled(kFALSE);
461  fApply->SetEnabled(kFALSE);
462 }
463 
464 /** \class TGeoPconSection
465 \ingroup Geometry_builder
466 
467 Utility frame used by TGeoPcon editor.
468 
469 */
470 
471 ClassImp(TGeoPconSection);
472 
473 ////////////////////////////////////////////////////////////////////////////////
474 /// Constructor.
475 
476 TGeoPconSection::TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id)
477  :TGCompositeFrame(p,w,h,kHorizontalFrame | kFixedWidth)
478 {
479  fNumber = id;
480  TGTextEntry *nef;
481  // Label with number
482  AddFrame(new TGLabel(this, TString::Format("#%i",id)), new TGLayoutHints(kLHintsLeft, 2, 4, 6, 0));
483 
484  // Z entry
485  fEZ = new TGNumberEntry(this, 0., 5);
486  fEZ->Resize(40,fEZ->GetDefaultHeight());
487  nef = (TGTextEntry*)fEZ->GetNumberEntry();
488  nef->SetToolTipText("Enter the Z position");
489  fEZ->Associate(this);
490  AddFrame(fEZ, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
491  // Rmin entry
492  fERmin = new TGNumberEntry(this, 0., 5);
493  fERmin->SetNumAttr(TGNumberFormat::kNEAPositive);
494  fERmin->Resize(40,fERmin->GetDefaultHeight());
495  nef = (TGTextEntry*)fERmin->GetNumberEntry();
496  nef->SetToolTipText("Enter the minimum radius");
497  fERmin->Associate(this);
498  AddFrame(fERmin, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
499  // Rmax entry
500  fERmax = new TGNumberEntry(this, 0., 5);
501  fERmax->SetNumAttr(TGNumberFormat::kNEAPositive);
502  fERmax->Resize(40,fERmax->GetDefaultHeight());
503  nef = (TGTextEntry*)fERmax->GetNumberEntry();
504  nef->SetToolTipText("Enter the maximum radius");
505  fERmax->Associate(this);
506  AddFrame(fERmax, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
507 
508  ConnectSignals2Slots();
509  MapSubwindows();
510  Layout();
511 }
512 
513 ////////////////////////////////////////////////////////////////////////////////
514 /// Destructor
515 
516 TGeoPconSection::~TGeoPconSection()
517 {
518  Cleanup();
519 }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Hide daughter frames
523 
524 void TGeoPconSection::HideDaughters()
525 {
526  fEZ->UnmapWindow();
527  fERmin->UnmapWindow();
528  fERmax->UnmapWindow();
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 /// Emit Changed(Int_t) signal.
533 
534 void TGeoPconSection::Changed(Int_t i)
535 {
536  Emit("Changed(Int_t)", i);
537 }
538 
539 ////////////////////////////////////////////////////////////////////////////////
540 /// Connect signals to slots.
541 
542 void TGeoPconSection::ConnectSignals2Slots()
543 {
544  fEZ->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoZ()");
545  fERmin->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmin()");
546  fERmax->Connect("ValueSet(Long_t)", "TGeoPconSection", this, "DoRmax()");
547 }
548 
549 ////////////////////////////////////////////////////////////////////////////////
550 /// Z value getter
551 
552 Double_t TGeoPconSection::GetZ() const
553 {
554  return fEZ->GetNumber();
555 }
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 /// Rmin value getter
559 
560 Double_t TGeoPconSection::GetRmin() const
561 {
562  return fERmin->GetNumber();
563 }
564 
565 ////////////////////////////////////////////////////////////////////////////////
566 /// Rmax value getter
567 
568 Double_t TGeoPconSection::GetRmax() const
569 {
570  return fERmax->GetNumber();
571 }
572 
573 ////////////////////////////////////////////////////////////////////////////////
574 /// Z value setter
575 
576 void TGeoPconSection::SetZ(Double_t z)
577 {
578  fEZ->SetNumber(z);
579 }
580 
581 ////////////////////////////////////////////////////////////////////////////////
582 /// Rmin value setter
583 
584 void TGeoPconSection::SetRmin(Double_t rmin)
585 {
586  fERmin->SetNumber(rmin);
587 }
588 
589 ////////////////////////////////////////////////////////////////////////////////
590 /// Rmax value setter
591 
592 void TGeoPconSection::SetRmax(Double_t rmax)
593 {
594  fERmax->SetNumber(rmax);
595 }
596 
597 ////////////////////////////////////////////////////////////////////////////////
598 /// Z slot.
599 
600 void TGeoPconSection::DoZ()
601 {
602  Changed(fNumber);
603 }
604 
605 ////////////////////////////////////////////////////////////////////////////////
606 /// Rmin slot.
607 
608 void TGeoPconSection::DoRmin()
609 {
610  Double_t rmin = fERmin->GetNumber();
611  Double_t rmax = fERmax->GetNumber();
612  if (rmin>rmax-1.e-8) fERmin->SetNumber(rmax);
613  Changed(fNumber);
614 }
615 
616 ////////////////////////////////////////////////////////////////////////////////
617 /// Rmax slot.
618 
619 void TGeoPconSection::DoRmax()
620 {
621  Double_t rmin = fERmin->GetNumber();
622  Double_t rmax = fERmax->GetNumber();
623  if (rmax<rmin+1.e-8) fERmax->SetNumber(rmin);
624  Changed(fNumber);
625 }