Logo ROOT   6.10/09
Reference Guide
TGeoPconEditor.h
Go to the documentation of this file.
1 // @(#):$Id$
2 // Author: M.Gheata
3 /*************************************************************************
4  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGeoPconEditor
12 #define ROOT_TGeoPconEditor
13 
14 //////////////////////////////////////////////////////////////////////////
15 // //
16 // TGeoPconEditor //
17 // //
18 // Editor for a TGeoPcon. //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "TGWidget.h"
23 #include "TGeoGedFrame.h"
24 
25 class TGeoPcon;
26 class TGeoPconSection;
27 class TGeoTabManager;
28 class TGTextEntry;
29 class TGNumberEntry;
30 class TGTab;
31 class TGComboBox;
32 class TGTextButton;
33 class TGCheckButton;
34 class TGCanvas;
35 class TString;
36 
37 class TGeoPconEditor : public TGeoGedFrame {
38 
39 protected:
40  Int_t fNsecti; // Initial number of sections
41  Double_t fPhi1i; // Initial Phi1
42  Double_t fDPhii; // Initial Dphi
43  Double_t *fZi; // Initial Z positions
44  Double_t *fRmini; // Initial Rmin values
45  Double_t *fRmaxi; // Initial Rmax values
46  Int_t fNsections; // Number of Z sections
47  TObjArray *fSections; // List of section frames
48  TGCanvas *fCan; // sections container
49  TGeoPcon *fShape; // Shape object
50  Bool_t fIsModified; // Flag that volume was modified
51  Bool_t fIsShapeEditable; // Flag that the shape can be changed
52 
53  TGLayoutHints *fLHsect; // Layout hints for sections
54  TGTextEntry *fShapeName; // Shape name text entry
55  TGNumberEntry *fENz; // Number entry for nsections
56  TGNumberEntry *fEPhi1; // Number entry for phi1
57  TGNumberEntry *fEDPhi; // Number entry for dphi
58  TGTextButton *fApply; // Apply-Button to accept changes
59  TGTextButton *fUndo; // Undo-Button
60  TGCompositeFrame *fBFrame; // Frame containing Apply/Undo
61  TGCheckButton *fDelayed; // Check button for delayed draw
62  TGCompositeFrame *fDFrame; // Frame containing Delayed draw
63 
64  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
66  Bool_t IsDelayed() const;
67  void CreateSections(Int_t inew);
68  void UpdateSections();
69  virtual void CreateEdges() {;}
70 public:
71  TGeoPconEditor(const TGWindow *p = 0,
72  Int_t width = 140, Int_t height = 30,
73  UInt_t options = kChildFrame,
75  virtual ~TGeoPconEditor();
76  virtual void SetModel(TObject *obj);
77 
78  void DoModified();
79  void DoName();
80  void DoNz();
81  void DoPhi();
82  void DoSectionChange(Int_t i);
83  virtual void DoApply();
84  virtual void DoUndo();
85 
86  ClassDef(TGeoPconEditor,0) // TGeoPcon editor
87 };
88 
89 //////////////////////////////////////////////////////////////////////////
90 // //
91 // TGeoPconSection //
92 // //
93 // Utility frame used by TGeoPcon editor. //
94 // //
95 //////////////////////////////////////////////////////////////////////////
96 
97 class TGeoPconSection : public TGCompositeFrame, public TGWidget {
98 
99 protected:
100  Int_t fNumber; // Id for the section
101  TGNumberEntry *fEZ; // Number entry for Z position
102  TGNumberEntry *fERmin; // Number entry for Rmin position
103  TGNumberEntry *fERmax; // Number entry for Rmax position
104 
105  virtual void ConnectSignals2Slots();
106 
107 public:
108  TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id);
109  virtual ~TGeoPconSection();
110  void HideDaughters();
111  Double_t GetZ() const;
112  Double_t GetRmin() const;
113  Double_t GetRmax() const;
114  void SetZ(Double_t z);
115  void SetRmin(Double_t rmin);
116  void SetRmax(Double_t rmax);
117 
118  void DoZ();
119  void DoRmin();
120  void DoRmax();
121 
122  virtual void Changed(Int_t i); // *SIGNAL*
123 
124  ClassDef(TGeoPconSection,0) // TGeoPcon section
125 };
126 #endif
TGNumberEntry * fERmax
TGNumberEntry * fEPhi1
An array of TObjects.
Definition: TObjArray.h:37
TGCheckButton * fDelayed
Definition: TGTab.h:62
virtual ~TGeoPconEditor()
Destructor.
virtual void SetModel(TObject *obj)
Connect to a given pcon.
A polycone.
Definition: TGeoPcon.h:17
TGeoPcon * fShape
TH1 * h
Definition: legend2.C:5
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.
void DoSectionChange(Int_t i)
Change parameters of section isect;.
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void CreateSections(Int_t inew)
Change dynamically the number of sections.
TGCompositeFrame * fBFrame
Double_t * fRmaxi
TGNumberEntry * fERmin
Double_t * fRmini
virtual void DoUndo()
Slot for undoing last operation.
#define ClassDef(name, id)
Definition: Rtypes.h:297
ULong_t Pixel_t
Definition: GuiTypes.h:39
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
TGCanvas * fCan
void DoNz()
Change number of sections.
TGTextEntry * fShapeName
Bool_t CheckSections(Bool_t change=kFALSE)
Check validity of sections.
TGNumberEntry * fENz
TGNumberEntry * fEDPhi
TGTextButton * fUndo
void DoName()
Perform name change.
unsigned int UInt_t
Definition: RtypesCore.h:42
void UpdateSections()
Update sections according fShape.
virtual void CreateEdges()
Bool_t IsDelayed() const
Check if shape drawing is delayed.
void DoPhi()
Change phi range.
const Bool_t kFALSE
Definition: RtypesCore.h:92
double Double_t
Definition: RtypesCore.h:55
Bool_t fIsShapeEditable
virtual void ConnectSignals2Slots()
Connect signals to slots.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
TGTextButton * fApply
TObjArray * fSections
TGNumberEntry * fEZ
void DoModified()
Slot for signaling modifications.
TGLayoutHints * fLHsect
virtual void DoApply()
Slot for applying modifications.
TGCompositeFrame * fDFrame
Double_t * fZi