11 #include <Reve/Reve.h>
12 #include <Reve/RenderElement.h>
13 #include <Reve/FrameBox.h>
14 #include <Reve/RGBAPalette.h>
15 #include <Reve/Plex.h>
16 #include <Reve/ZTrans.h>
29 void ColorFromIdx(Color_t ci);
31 Quad(Color_t col = 1) : color(0)
32 { ColorFromIdx(col); }
34 Quad(Color_t col, Float_t* p) : color(0)
35 { ColorFromIdx(col); memcpy(vertices, p, 12*sizeof(Float_t)); }
37 Quad(TRandom& rnd, Float_t origin, Float_t size);
39 Quad(const Quad& org) : color(0) { memcpy(this, &org, sizeof(Quad)); }
46 class OldQuadSet : public TNamed, public TAtt3D, public TAttBBox
48 friend class OldQuadSetGL;
51 std::vector<Quad> fQuads;
56 OldQuadSet(const Text_t* n="QuadSet", const Text_t* t="");
57 virtual ~OldQuadSet() {}
59 Bool_t GetTrans() const { return fTrans; }
60 void SetTrans(Bool_t t) { fTrans = t; }
62 std::vector<Reve::Quad>& Quads() { return fQuads; }
64 void Test(Int_t nquads);
66 virtual void ComputeBBox();
68 virtual void Paint(Option_t* option = "");
70 ClassDef(OldQuadSet, 1);
73 /**************************************************************************/
74 // To become new implementation of QuadSet ... not finished yet.
75 /**************************************************************************/
77 class QuadSet : public RenderElement,
82 friend class QuadSetGL;
84 QuadSet(const QuadSet&); // Not implemented
85 QuadSet& operator=(const QuadSet&); // Not implemented
93 QT_AxisAlignedFixedDim,
96 QT_AxisAlignedFixedDimZ,
97 QT_AxisAlignedFixedDimY,
98 // line modes (needed for uniform handling of silicon-strip digits)
103 enum RenderMode_e { RM_AsIs, RM_Line, RM_Fill };
109 // Here could have additional integer (like time, second threshold).
111 QuadBase(Int_t v=0) : fValue(v) {}
114 struct FreeQuad : public QuadBase
116 Float_t fVertices[12];
119 struct AAFixDimZQuad : public QuadBase
124 struct AAFixDimQuad : public AAFixDimZQuad
129 struct AAFixZQuad : public AAFixDimZQuad
134 struct AAQuad : public AAFixDimQuad
139 struct LineFixedZ : public AAFixDimZQuad
145 QuadType_e fQuadType;
146 Bool_t fValueIsColor;
149 QuadBase* fLastQuad; //!
156 RGBAPalette* fPalette;
157 RenderMode_e fRenderMode;
160 static Int_t SizeofAtom(QuadType_e qt);
164 QuadSet(const Text_t* n="QuadSet", const Text_t* t="");
165 QuadSet(QuadType_e quadType, Bool_t valIsCol, Int_t chunkSize,
166 const Text_t* n="QuadSet", const Text_t* t="");
169 virtual Bool_t CanEditMainColor() { return kTRUE; }
171 void Reset(QuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
174 void ScanMinMaxValues(Int_t& min, Int_t& max);
176 Float_t GetDefWidth() const { return fDefWidth; }
177 Float_t GetDefHeight() const { return fDefHeight; }
178 Float_t GetDefCoord() const { return fDefCoord; }
180 void SetDefWidth(Float_t v) { fDefWidth = v ; }
181 void SetDefHeight(Float_t v) { fDefHeight = v ; }
182 void SetDefCoord(Float_t v) { fDefCoord = v ; }
184 // --------------------------------
186 FrameBox* GetFrame() const { return fFrame; }
187 void SetFrame(FrameBox* b);
189 RGBAPalette* GetPalette() const { return fPalette; }
190 void SetPalette(RGBAPalette* p);
192 RenderMode_e GetRenderMode() const { return fRenderMode; }
193 void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; }
195 ZTrans& RefHMTrans() { return fHMTrans; }
196 void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
197 void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
199 // --------------------------------
201 void AddQuad(Float_t* verts);
202 void AddQuad(Float_t x, Float_t y);
203 void AddQuad(Float_t x, Float_t y, Float_t z);
204 void AddQuad(Float_t x, Float_t y, Float_t w, Float_t h);
205 void AddQuad(Float_t x, Float_t y, Float_t z, Float_t w, Float_t h);
207 void QuadValue(Int_t value);
208 void QuadColor(Color_t ci);
209 void QuadColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
211 // --------------------------------
213 // void Test(Int_t nquads);
215 virtual void ComputeBBox();
217 virtual void Paint(Option_t* option="");
219 ClassDef(QuadSet, 1);