]>
Commit | Line | Data |
---|---|---|
78976106 | 1 | #ifndef ROOT_guitest |
2 | #define ROOT_guitest | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
9549377e | 5 | |
6 | /* $Id$ */ | |
7 | ||
78976106 | 8 | #include <TROOT.h> |
9 | #include <TVirtualX.h> | |
10 | #include <TGListBox.h> | |
11 | #include <TGListTree.h> | |
12 | #include <TGClient.h> | |
13 | #include <TGFrame.h> | |
14 | #include <TGIcon.h> | |
15 | #include <TGLabel.h> | |
16 | #include <TGButton.h> | |
17 | #include <TGTextEntry.h> | |
18 | #include <TGMsgBox.h> | |
19 | #include <TGMenu.h> | |
20 | #include <TGCanvas.h> | |
21 | #include <TGComboBox.h> | |
22 | #include <TGTab.h> | |
23 | #include <TGSlider.h> | |
24 | #include <TGDoubleSlider.h> | |
25 | #include <TGFileDialog.h> | |
26 | #include <TRootEmbeddedCanvas.h> | |
27 | #include <TCanvas.h> | |
28 | #include <TH1.h> | |
29 | #include <TH2.h> | |
30 | #include <TClonesArray.h> | |
31 | #include <TGeant3.h> | |
32 | ||
33 | class AliGuiGeomDialog; | |
34 | class AliGUISliders; | |
35 | class AliGuiGeomMain; | |
36 | class AliDrawVolume; | |
37 | ||
38 | ||
39 | class AliGeant3GeometryGUI : public TObject { | |
40 | private: | |
41 | AliGuiGeomMain *fPanel; // the main gui panel | |
42 | Int_t fNstack; // number of volumes | |
43 | TClonesArray *fVolumes; | |
44 | Int_t* fZlq; | |
45 | Float_t* fZq; | |
46 | Gclink_t* fGclink; | |
47 | ||
48 | public: | |
49 | AliGeant3GeometryGUI(); | |
50 | void ReadGeometryTree(); | |
51 | private: | |
52 | virtual AliDrawVolume* Volume(Int_t id) | |
53 | {return (AliDrawVolume *) (fVolumes->UncheckedAt(id));} | |
54 | ||
55 | Int_t NChildren(Int_t idvol); | |
56 | Int_t Child(Int_t idvol, Int_t idc); | |
57 | ClassDef(AliGeant3GeometryGUI,1) // GUI for Geant3 geometry visualisation | |
58 | }; | |
59 | ||
60 | ||
61 | class AliGuiGeomMain : public TGMainFrame { | |
62 | ||
63 | private: | |
64 | TGCanvas *fCanvasWindow; | |
65 | TGCompositeFrame *fContainer; | |
66 | TGListTree *fLt; | |
67 | TGMenuBar *fMenuBar; | |
68 | TGPopupMenu *fMenuFile, *fMenuTest, *fMenuHelp; | |
69 | TGLayoutHints *fMenuBarItemLayout, *fMenuBarHelpLayout, *fMenuBarLayout; | |
f70a166f | 70 | AliGuiGeomDialog *fDialog; //! no output please |
78976106 | 71 | |
72 | public: | |
73 | AliGuiGeomMain(const TGWindow *p, UInt_t w, UInt_t h); | |
74 | virtual ~AliGuiGeomMain(); | |
75 | ||
76 | virtual void CloseWindow(); | |
77 | virtual TGListTreeItem * | |
78 | AddItem(TObject *, TGListTreeItem* , | |
79 | const char*, const TGPicture*, const TGPicture*); | |
80 | virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t); | |
81 | virtual void Update(); | |
82 | ClassDef(AliGuiGeomMain,1) // MainFrame for Geometry Browser | |
83 | }; | |
84 | ||
85 | ||
86 | class AliGuiGeomDialog : public TGTransientFrame { | |
87 | ||
88 | private: | |
89 | AliGUISliders *fF1; | |
90 | TGCompositeFrame *fFrame1, *fF2, *fF3, *fF4; | |
91 | TGButton *fOkButton, *fCancelButton; | |
92 | TGButton *fChk1, *fChk2, *fChk3; | |
93 | TGComboBox *fCombo, *fCombo2; | |
94 | TGLabel *fLabel1, *fLabel2; | |
95 | TGTab *fTab; | |
96 | TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fBly, *fBfly1; | |
97 | TGHorizontalFrame *fHSframe1, *fHSframe2, *fHSframe3; | |
98 | TGTextBuffer *fTbh11, *fTbh12, *fTbh21, *fTbh22, *fTbh31, *fTbh32; | |
99 | TGTextEntry *fTeh11, *fTeh12, *fTeh21, *fTeh22, *fTeh31, *fTeh32; | |
100 | TGDoubleHSlider *fDslider1, *fDslider2, *fDslider3; | |
101 | TGLabel *fSLabel1, *fSLabel2, *fSLabel3; | |
102 | public: | |
103 | AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, | |
104 | UInt_t options = kMainFrame | kVerticalFrame); | |
105 | virtual ~AliGuiGeomDialog(); | |
106 | ||
107 | virtual void CloseWindow(); | |
108 | virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); | |
109 | virtual void Update(); | |
110 | // ClassDef(AliGuiGeomDialog,1) // Just a test | |
111 | }; | |
112 | ||
113 | class AliGUISliders : public TGCompositeFrame { | |
114 | ||
115 | private: | |
116 | // | |
117 | TGHorizontalFrame *fHframe[8]; | |
118 | TGLayoutHints *fBly, *fBfly1; | |
119 | TGHSlider *fHslider[8]; | |
120 | TGTextEntry *fTeh[8]; | |
121 | TGTextBuffer *fTbh[8]; | |
122 | TGLabel *fLabel[8]; | |
123 | Text_t fLabelText[8]; | |
124 | public: | |
125 | AliGUISliders(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h); | |
126 | virtual ~AliGUISliders(); | |
127 | ||
128 | virtual void CloseWindow(); | |
129 | virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); | |
130 | virtual void Update(); | |
131 | ||
132 | // ClassDef(AliGUISliders,1) // Just a test | |
133 | }; | |
134 | ||
135 | class AliDrawVolume : public TObject | |
136 | { | |
137 | public: | |
138 | AliDrawVolume(char* name); | |
139 | virtual ~AliDrawVolume(){;} | |
f70a166f | 140 | virtual void Draw(Option_t * =0); |
78976106 | 141 | virtual void DrawSpec(); |
142 | virtual char* Name(); | |
143 | virtual void SetParam(Int_t, Float_t); | |
144 | virtual Float_t GetParam(Int_t); | |
145 | ||
146 | virtual void SetIdVolume(Int_t id) {fIdVolume = id;} | |
147 | virtual void SetIdCopy(Int_t id) {fIdCopy = id;} | |
148 | virtual Int_t GetIdVolume() {return fIdVolume;} | |
149 | virtual Int_t GetIdCopy() {return fIdCopy;} | |
150 | virtual void AddCopy() {fIdCopy ++;} | |
151 | virtual void SetItem(TGListTreeItem *item) {fItem = item;} | |
152 | ||
153 | ||
154 | virtual TGListTreeItem* GetItem() {return fItem;} | |
155 | ||
156 | private: | |
157 | char* fName; // name of the volume | |
158 | Float_t fTheta; // theta-angle for drawing | |
159 | Float_t fPhi; // phi-angle for drawing | |
160 | Float_t fPsi; // psi-angle for drawing | |
161 | Float_t fU; // u-position | |
162 | Float_t fV; // v-position | |
163 | Float_t fUscale; // u-scaling factor | |
164 | Float_t fVscale; // v-scaling factor | |
165 | Bool_t fHide; // hide flag | |
166 | Bool_t fShadow; // shadow flag | |
167 | Int_t fFill; // fill option 1-6 | |
168 | Int_t fSeen; // seen option -2 - 1 | |
169 | Bool_t fClip; // clipping flag | |
170 | Float_t fClipXmin; // clip box range xmin | |
171 | Float_t fClipXmax; // clip box range xmax | |
172 | Float_t fClipYmin; // clip box range ymin | |
173 | Float_t fClipYmax; // clip box range ymax | |
174 | Float_t fClipZmin; // clip box range zmin | |
175 | Float_t fClipZmax; // clip box range zmax | |
176 | Int_t fIdVolume; // geant volume id | |
177 | Int_t fIdCopy; // copy flag | |
178 | TGListTreeItem *fItem; | |
179 | ClassDef(AliDrawVolume,1) // Volume Object for Drawing | |
180 | }; | |
181 | #endif | |
182 | ||
183 | ||
184 | ||
185 | ||
186 | ||
187 | ||
188 |