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