Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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
57  Bool_t CheckSections(Bool_t change=kFALSE);
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,
66  Pixel_t back = GetDefaultFrameBackground());
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