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