Logo ROOT   6.14/05
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 #include "TGWidget.h"
15 #include "TGeoGedFrame.h"
16 
17 class TGeoPcon;
18 class TGeoPconSection;
19 class TGeoTabManager;
20 class TGTextEntry;
21 class TGNumberEntry;
22 class TGTab;
23 class TGComboBox;
24 class TGTextButton;
25 class TGCheckButton;
26 class TGCanvas;
27 class TString;
28 
29 class TGeoPconEditor : public TGeoGedFrame {
30 
31 protected:
32  Int_t fNsecti; // Initial number of sections
33  Double_t fPhi1i; // Initial Phi1
34  Double_t fDPhii; // Initial Dphi
35  Double_t *fZi; // Initial Z positions
36  Double_t *fRmini; // Initial Rmin values
37  Double_t *fRmaxi; // Initial Rmax values
38  Int_t fNsections; // Number of Z sections
39  TObjArray *fSections; // List of section frames
40  TGCanvas *fCan; // sections container
41  TGeoPcon *fShape; // Shape object
42  Bool_t fIsModified; // Flag that volume was modified
43  Bool_t fIsShapeEditable; // Flag that the shape can be changed
44 
45  TGLayoutHints *fLHsect; // Layout hints for sections
46  TGTextEntry *fShapeName; // Shape name text entry
47  TGNumberEntry *fENz; // Number entry for nsections
48  TGNumberEntry *fEPhi1; // Number entry for phi1
49  TGNumberEntry *fEDPhi; // Number entry for dphi
50  TGTextButton *fApply; // Apply-Button to accept changes
51  TGTextButton *fUndo; // Undo-Button
52  TGCompositeFrame *fBFrame; // Frame containing Apply/Undo
53  TGCheckButton *fDelayed; // Check button for delayed draw
54  TGCompositeFrame *fDFrame; // Frame containing Delayed draw
55 
56  virtual void ConnectSignals2Slots(); // Connect the signals to the slots
58  Bool_t IsDelayed() const;
59  void CreateSections(Int_t inew);
60  void UpdateSections();
61  virtual void CreateEdges() {;}
62 public:
63  TGeoPconEditor(const TGWindow *p = 0,
64  Int_t width = 140, Int_t height = 30,
65  UInt_t options = kChildFrame,
67  virtual ~TGeoPconEditor();
68  virtual void SetModel(TObject *obj);
69 
70  void DoModified();
71  void DoName();
72  void DoNz();
73  void DoPhi();
74  void DoSectionChange(Int_t i);
75  virtual void DoApply();
76  virtual void DoUndo();
77 
78  ClassDef(TGeoPconEditor,0) // TGeoPcon editor
79 };
80 
81 
82 class TGeoPconSection : public TGCompositeFrame, public TGWidget {
83 
84 protected:
85  Int_t fNumber; // Id for the section
86  TGNumberEntry *fEZ; // Number entry for Z position
87  TGNumberEntry *fERmin; // Number entry for Rmin position
88  TGNumberEntry *fERmax; // Number entry for Rmax position
89 
90  virtual void ConnectSignals2Slots();
91 
92 public:
93  TGeoPconSection(const TGWindow *p, UInt_t w, UInt_t h, Int_t id);
94  virtual ~TGeoPconSection();
95  void HideDaughters();
96  Double_t GetZ() const;
97  Double_t GetRmin() const;
98  Double_t GetRmax() const;
99  void SetZ(Double_t z);
100  void SetRmin(Double_t rmin);
101  void SetRmax(Double_t rmax);
102 
103  void DoZ();
104  void DoRmin();
105  void DoRmax();
106 
107  virtual void Changed(Int_t i); // *SIGNAL*
108 
109  ClassDef(TGeoPconSection,0) // TGeoPcon section
110 };
111 #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.
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
Definition: TGaxis.cxx:2551
Manager for all editor tabs.
A polycone.
Definition: TGeoPcon.h:17
TGeoPcon * fShape
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:131
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:320
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.
Editor for a TGeoPcon.
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()
#define h(i)
Definition: RSha256.hxx:106
Bool_t IsDelayed() const
Check if shape drawing is delayed.
void DoPhi()
Change phi range.
const Bool_t kFALSE
Definition: RtypesCore.h:88
double Double_t
Definition: RtypesCore.h:55
Bool_t fIsShapeEditable
virtual void ConnectSignals2Slots()
Connect signals to slots.
Utility frame used by TGeoPcon editor.
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
Common base class for geombuilder editors.
Definition: TGeoGedFrame.h:13
Double_t * fZi