]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/GeoNode.h
Added method SetGeoHMatrix(), initializing TGeoHMatrix from ZTrans.
[u/mrichter/AliRoot.git] / EVE / Reve / GeoNode.h
1 // $Header$
2
3 #ifndef REVE_ReveGeom_H
4 #define REVE_ReveGeom_H
5
6 #include <Reve/RenderElement.h>
7 #include <Reve/ZTrans.h>
8
9 class TGeoVolume;
10 class TGeoNode;
11 class TGeoHMatrix;
12 class TGeoManager;
13
14 class TGeoShape;
15 class TGeoShapeExtract;
16
17 namespace Reve {
18
19 class GeoNodeRnrEl : public RenderElement,
20                      public TObject
21 {
22   friend class GeoNodeRnrElEditor;
23
24   GeoNodeRnrEl(const GeoNodeRnrEl&);            // Not implemented
25   GeoNodeRnrEl& operator=(const GeoNodeRnrEl&); // Not implemented
26
27 protected:
28   TGeoNode *fNode;
29
30 public:
31   GeoNodeRnrEl(TGeoNode* node);
32
33   virtual const Text_t* GetName()  const;
34   virtual const Text_t* GetTitle() const;
35
36   TGeoNode* GetNode() const { return fNode; }
37
38   virtual Int_t ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent);
39
40   virtual void UpdateItems();
41
42   virtual Bool_t CanEditRnrElement() { return false; }
43   virtual void SetRnrSelf(Bool_t rnr);
44
45   virtual Bool_t CanEditMainColor()  { return true; }
46   virtual void SetMainColor(Color_t color);
47   virtual void SetMainColor(Pixel_t pixel);
48
49   void UpdateNode(TGeoNode* node);
50   void UpdateVolume(TGeoVolume* volume);
51
52   virtual void Draw(Option_t* option="");
53
54   ClassDef(GeoNodeRnrEl, 1);
55 }; // endclass GeoNodeRnrEl
56
57 //----------------------------------------------------------------
58
59 class GeoTopNodeRnrEl : public GeoNodeRnrEl
60 {
61   GeoTopNodeRnrEl(const GeoTopNodeRnrEl&);            // Not implemented
62   GeoTopNodeRnrEl& operator=(const GeoTopNodeRnrEl&); // Not implemented
63
64 protected:
65   TGeoManager* fManager;
66   TGeoHMatrix* fGlobalTrans;
67   Bool_t       fUseNodeTrans;
68   Int_t        fVisOption;
69   Int_t        fVisLevel;  
70
71 public:
72   GeoTopNodeRnrEl(TGeoManager* manager, TGeoNode* node, Int_t visopt=1, Int_t vislvl=3);
73   virtual ~GeoTopNodeRnrEl();
74
75   TGeoHMatrix *GetGlobalTrans()  const { return fGlobalTrans; }
76   void         SetGlobalTrans(TGeoHMatrix* m);
77   Bool_t       GetUseNodeTrans() const { return fUseNodeTrans; }
78   void         SetUseNodeTrans(Bool_t u=kTRUE);
79
80   Int_t GetVisOption() const { return fVisOption; }
81   void  SetVisOption(Int_t visopt);
82   Int_t GetVisLevel()  const { return fVisLevel; }
83   void  SetVisLevel(Int_t vislvl);
84
85   virtual void UpdateItems();
86
87   virtual Bool_t CanEditRnrElement() { return true; }
88   virtual void SetRnrSelf(Bool_t rnr);
89
90   virtual void Draw(Option_t* option="");
91   virtual void Paint(Option_t* option="");
92
93   // Signals from GeoManager.
94   // These are not available any more ... colors in list-tree not refreshed
95   // properly.
96   void VolumeVisChanged(TGeoVolume* volume);
97   void VolumeColChanged(TGeoVolume* volume);
98   void NodeVisChanged(TGeoNode* node);
99
100   ClassDef(GeoTopNodeRnrEl, 1);
101 }; // endclass GeoTopNodeRnrEl
102
103
104 //----------------------------------------------------------------
105 //----------------------------------------------------------------
106
107 class GeoShapeRnrEl : public RenderElement,
108                       public TNamed
109 {
110   GeoShapeRnrEl(const GeoShapeRnrEl&);            // Not implemented
111   GeoShapeRnrEl& operator=(const GeoShapeRnrEl&); // Not implemented
112
113 protected:
114   ZTrans            fHMTrans;
115   Color_t           fColor;
116   UChar_t           fTransparency;
117   TGeoShape*        fShape;
118
119   static Int_t SubImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
120
121 public:
122   GeoShapeRnrEl(const Text_t* name="GeoShapeRnrEl", const Text_t* title=0);
123   virtual ~GeoShapeRnrEl();
124
125   virtual Bool_t CanEditMainColor() { return kTRUE; }
126
127   ZTrans& RefHMTrans() { return fHMTrans; }
128   void SetTransMatrix(Double_t* carr)        { fHMTrans.SetFrom(carr); }
129   void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat);  }
130
131   Color_t     GetColor()        { return fColor; }
132   UChar_t     GetTransparency() { return fTransparency; }
133   TGeoShape*  GetShape()        { return fShape; }
134
135   virtual void Paint(Option_t* option="");
136
137   static Int_t ImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
138
139   ClassDef(GeoShapeRnrEl, 1);
140 };
141
142 }
143
144 #endif