Logo ROOT   6.08/07
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 #ifndef ROOT_TGButton
23 #include "TGWidget.h"
24 #endif
25 #ifndef ROOT_TGeoGedFrame
26 #include "TGeoGedFrame.h"
27 #endif
28 
29 class TGeoPcon;
30 class TGeoPconSection;
31 class TGeoTabManager;
32 class TGTextEntry;
33 class TGNumberEntry;
34 class TGTab;
35 class TGComboBox;
36 class TGTextButton;
37 class TGCheckButton;
38 class TGCanvas;
39 class TString;
40 
41 class TGeoPconEditor : public TGeoGedFrame {
42 
43 protected:
44  Int_t fNsecti; // Initial number of sections
45  Double_t fPhi1i; // Initial Phi1
46  Double_t fDPhii; // Initial Dphi
47  Double_t *fZi; // Initial Z positions
48  Double_t *fRmini; // Initial Rmin values
49  Double_t *fRmaxi; // Initial Rmax values
50  Int_t fNsections; // Number of Z sections
51  TObjArray *fSections; // List of section frames
52  TGCanvas *fCan; // sections container
53  TGeoPcon *fShape; // Shape object
54  Bool_t fIsModified; // Flag that volume was modified
55  Bool_t fIsShapeEditable; // Flag that the shape can be changed
56 
57  TGLayoutHints *fLHsect; // Layout hints for sections
58  TGTextEntry *fShapeName; // Shape name text entry
59  TGNumberEntry *fENz; // Number entry for nsections
60  TGNumberEntry *fEPhi1; // Number entry for phi1
61  TGNumberEntry *fEDPhi; // Number entry for dphi
62  TGTextButton *fApply; // Apply-Button to accept changes
63  TGTextButton *fUndo; // Undo-Button
64  TGCompositeFrame *fBFrame; // Frame containing Apply/Undo
65  TGCheckButton *fDelayed; // Check button for delayed draw
66  TGCompositeFrame *fDFrame; // Frame containing Delayed draw
67 
68  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
70  Bool_t IsDelayed() const;
71  void CreateSections(Int_t inew);
72  void UpdateSections();
73  virtual void CreateEdges() {;}
74 public:
75  TGeoPconEditor(const TGWindow *p = 0,
76  Int_t width = 140, Int_t height = 30,
77  UInt_t options = kChildFrame,
79  virtual ~TGeoPconEditor();
80  virtual void SetModel(TObject *obj);
81 
82  void DoModified();
83  void DoName();
84  void DoNz();
85  void DoPhi();
86  void DoSectionChange(Int_t i);
87  virtual void DoApply();
88  virtual void DoUndo();
89 
90  ClassDef(TGeoPconEditor,0) // TGeoPcon editor
91 };
92 
93 //////////////////////////////////////////////////////////////////////////
94 // //
95 // TGeoPconSection //
96 // //
97 // Utility frame used by TGeoPcon editor. //
98 // //
99 //////////////////////////////////////////////////////////////////////////
100 
101 class TGeoPconSection : public TGCompositeFrame, public TGWidget {
102 
103 protected:
104  Int_t fNumber; // Id for the section
105  TGNumberEntry *fEZ; // Number entry for Z position
106  TGNumberEntry *fERmin; // Number entry for Rmin position
107  TGNumberEntry *fERmax; // Number entry for Rmax position
108 
109  virtual void ConnectSignals2Slots();
110 
111 public:
112  TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id);
113  virtual ~TGeoPconSection();
114  void HideDaughters();
115  Double_t GetZ() const;
116  Double_t GetRmin() const;
117  Double_t GetRmax() const;
118  void SetZ(Double_t z);
119  void SetRmin(Double_t rmin);
120  void SetRmax(Double_t rmax);
121 
122  void DoZ();
123  void DoRmin();
124  void DoRmax();
125 
126  virtual void Changed(Int_t i); // *SIGNAL*
127 
128  ClassDef(TGeoPconSection,0) // TGeoPcon section
129 };
130 #endif
TGNumberEntry * fERmax
TGNumberEntry * fEPhi1
An array of TObjects.
Definition: TObjArray.h:39
TGCheckButton * fDelayed
Definition: TGTab.h:66
virtual ~TGeoPconEditor()
Destructor.
virtual void SetModel(TObject *obj)
Connect to a given pcon.
A polycone.
Definition: TGeoPcon.h:19
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:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
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:254
ULong_t Pixel_t
Definition: GuiTypes.h:41
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.
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