]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Header$ |
2 | ||
3 | #ifndef REVE_ReveGeom_H | |
4 | #define REVE_ReveGeom_H | |
5 | ||
6 | #include <Reve/RenderElement.h> | |
5b3adb7e | 7 | #include <Reve/ZTrans.h> |
32e219c2 | 8 | #include <Reve/NLTBases.h> |
5a5a1232 | 9 | |
10 | class TGeoVolume; | |
11 | class TGeoNode; | |
24e2ff4a | 12 | class TGeoHMatrix; |
5a5a1232 | 13 | class TGeoManager; |
14 | ||
5b3adb7e | 15 | class TGeoShape; |
16 | class TGeoShapeExtract; | |
17 | ||
5a5a1232 | 18 | namespace Reve { |
19 | ||
712d9715 | 20 | class GeoRnrEl : public RenderElement, |
21 | public NLTProjectable | |
22 | { | |
23 | private: | |
24 | GeoRnrEl(const GeoRnrEl&); // Not implemented | |
25 | GeoRnrEl& operator=(const GeoRnrEl&); // Not implemented | |
26 | ||
27 | public: | |
28 | GeoRnrEl(){}; | |
29 | virtual ~GeoRnrEl() {}; | |
30 | ||
31 | virtual TBuffer3D* MakeBuffer3D() = 0; | |
32 | virtual TClass* ProjectedClass() const; | |
33 | ||
34 | ClassDef(GeoRnrEl, 1); | |
35 | }; | |
36 | ||
37 | /**************************************************************************/ | |
38 | /**************************************************************************/ | |
39 | class GeoNodeRnrEl : public GeoRnrEl, | |
7d42b6c2 | 40 | public TObject |
5a5a1232 | 41 | { |
42 | friend class GeoNodeRnrElEditor; | |
43 | ||
265ecb21 | 44 | GeoNodeRnrEl(const GeoNodeRnrEl&); // Not implemented |
45 | GeoNodeRnrEl& operator=(const GeoNodeRnrEl&); // Not implemented | |
46 | ||
5a5a1232 | 47 | protected: |
24e2ff4a | 48 | TGeoNode *fNode; |
5a5a1232 | 49 | |
50 | public: | |
51 | GeoNodeRnrEl(TGeoNode* node); | |
52 | ||
53 | virtual const Text_t* GetName() const; | |
54 | virtual const Text_t* GetTitle() const; | |
55 | ||
56 | TGeoNode* GetNode() const { return fNode; } | |
57 | ||
58 | virtual Int_t ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent); | |
59 | ||
5a5a1232 | 60 | virtual Bool_t CanEditRnrElement() { return false; } |
5b457dfa | 61 | virtual void SetRnrSelf(Bool_t rnr); |
44f64ac9 | 62 | virtual void SetRnrChildren(Bool_t rnr); |
63 | virtual void SetRnrState(Bool_t rnr); | |
5a5a1232 | 64 | |
65 | virtual Bool_t CanEditMainColor() { return true; } | |
66 | virtual void SetMainColor(Color_t color); | |
67 | virtual void SetMainColor(Pixel_t pixel); | |
68 | ||
69 | void UpdateNode(TGeoNode* node); | |
70 | void UpdateVolume(TGeoVolume* volume); | |
71 | ||
712d9715 | 72 | // NLTGeoProjectable |
73 | virtual TBuffer3D* MakeBuffer3D(); | |
74 | ||
5a5a1232 | 75 | virtual void Draw(Option_t* option=""); |
76 | ||
77 | ClassDef(GeoNodeRnrEl, 1); | |
78 | }; // endclass GeoNodeRnrEl | |
79 | ||
80 | //---------------------------------------------------------------- | |
81 | ||
82 | class GeoTopNodeRnrEl : public GeoNodeRnrEl | |
83 | { | |
265ecb21 | 84 | GeoTopNodeRnrEl(const GeoTopNodeRnrEl&); // Not implemented |
85 | GeoTopNodeRnrEl& operator=(const GeoTopNodeRnrEl&); // Not implemented | |
86 | ||
5a5a1232 | 87 | protected: |
88 | TGeoManager* fManager; | |
57ad1faf | 89 | ZTrans fGlobalTrans; |
5a5a1232 | 90 | Int_t fVisOption; |
712d9715 | 91 | Int_t fVisLevel; |
5a5a1232 | 92 | |
93 | public: | |
94 | GeoTopNodeRnrEl(TGeoManager* manager, TGeoNode* node, Int_t visopt=1, Int_t vislvl=3); | |
24e2ff4a | 95 | virtual ~GeoTopNodeRnrEl(); |
96 | ||
57ad1faf | 97 | virtual Bool_t CanEditMainHMTrans() { return kTRUE; } |
98 | virtual ZTrans* PtrMainHMTrans() { return &fGlobalTrans; } | |
99 | ||
100 | ZTrans& RefGlobalTrans() { return fGlobalTrans; } | |
101 | void SetGlobalTrans(const TGeoHMatrix* m); | |
102 | void UseNodeTrans(); | |
5a5a1232 | 103 | |
104 | Int_t GetVisOption() const { return fVisOption; } | |
105 | void SetVisOption(Int_t visopt); | |
106 | Int_t GetVisLevel() const { return fVisLevel; } | |
107 | void SetVisLevel(Int_t vislvl); | |
108 | ||
5a5a1232 | 109 | virtual Bool_t CanEditRnrElement() { return true; } |
5b457dfa | 110 | virtual void SetRnrSelf(Bool_t rnr); |
5a5a1232 | 111 | |
112 | virtual void Draw(Option_t* option=""); | |
113 | virtual void Paint(Option_t* option=""); | |
114 | ||
115 | // Signals from GeoManager. | |
116 | // These are not available any more ... colors in list-tree not refreshed | |
117 | // properly. | |
118 | void VolumeVisChanged(TGeoVolume* volume); | |
119 | void VolumeColChanged(TGeoVolume* volume); | |
120 | void NodeVisChanged(TGeoNode* node); | |
121 | ||
122 | ClassDef(GeoTopNodeRnrEl, 1); | |
123 | }; // endclass GeoTopNodeRnrEl | |
124 | ||
5b3adb7e | 125 | |
126 | //---------------------------------------------------------------- | |
127 | //---------------------------------------------------------------- | |
128 | ||
712d9715 | 129 | class GeoShapeRnrEl : public GeoRnrEl, |
130 | public TNamed | |
5b3adb7e | 131 | { |
132 | GeoShapeRnrEl(const GeoShapeRnrEl&); // Not implemented | |
133 | GeoShapeRnrEl& operator=(const GeoShapeRnrEl&); // Not implemented | |
134 | ||
135 | protected: | |
136 | ZTrans fHMTrans; | |
137 | Color_t fColor; | |
138 | UChar_t fTransparency; | |
139 | TGeoShape* fShape; | |
140 | ||
32e219c2 | 141 | static GeoShapeRnrEl* SubImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent); |
5b3adb7e | 142 | |
143 | public: | |
144 | GeoShapeRnrEl(const Text_t* name="GeoShapeRnrEl", const Text_t* title=0); | |
145 | virtual ~GeoShapeRnrEl(); | |
146 | ||
147 | virtual Bool_t CanEditMainColor() { return kTRUE; } | |
148 | ||
57ad1faf | 149 | virtual Bool_t CanEditMainTransparency() { return kTRUE; } |
150 | virtual UChar_t GetMainTransparency() const { return fTransparency; } | |
712d9715 | 151 | virtual void SetMainTransparency(UChar_t t) { fTransparency = t; } |
57ad1faf | 152 | |
153 | virtual Bool_t CanEditMainHMTrans() { return kTRUE; } | |
154 | virtual ZTrans* PtrMainHMTrans() { return &fHMTrans; } | |
155 | ||
5b3adb7e | 156 | ZTrans& RefHMTrans() { return fHMTrans; } |
157 | void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); } | |
158 | void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); } | |
159 | ||
160 | Color_t GetColor() { return fColor; } | |
5b3adb7e | 161 | TGeoShape* GetShape() { return fShape; } |
162 | ||
163 | virtual void Paint(Option_t* option=""); | |
164 | ||
32e219c2 | 165 | static GeoShapeRnrEl* ImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent); |
712d9715 | 166 | |
32e219c2 | 167 | // NLTGeoProjectable |
168 | virtual TBuffer3D* MakeBuffer3D(); | |
5b3adb7e | 169 | |
170 | ClassDef(GeoShapeRnrEl, 1); | |
171 | }; | |
172 | ||
5a5a1232 | 173 | } |
174 | ||
175 | #endif |