]>
Commit | Line | Data |
---|---|---|
915dabe1 | 1 | // $Header$ |
2 | ||
3 | #ifndef REVE_BoxSet_H | |
4 | #define REVE_BoxSet_H | |
5 | ||
32e219c2 | 6 | #include <Reve/DigitSet.h> |
915dabe1 | 7 | |
f0f769a9 | 8 | class TGeoMatrix; |
915dabe1 | 9 | class TRandom; |
10 | ||
11 | namespace Reve { | |
12 | ||
32e219c2 | 13 | class BoxSet: public DigitSet |
915dabe1 | 14 | { |
32e219c2 | 15 | friend class BoxSetGL; |
915dabe1 | 16 | |
32e219c2 | 17 | BoxSet(const BoxSet&); // Not implemented |
18 | BoxSet& operator=(const BoxSet&); // Not implemented | |
915dabe1 | 19 | |
32e219c2 | 20 | public: |
21 | enum BoxType_e | |
22 | { | |
23 | BT_Undef, // unknown-ignored | |
24 | BT_FreeBox, // arbitrary box: specify 8*(x,y,z) box corners | |
25 | BT_AABox, // axis-aligned box: specify (x,y,z) and (w, h, d) | |
26 | BT_AABoxFixedDim // axis-aligned box w/ fixed dimensions: specify (x,y,z) | |
27 | }; | |
915dabe1 | 28 | |
32e219c2 | 29 | protected: |
915dabe1 | 30 | |
32e219c2 | 31 | struct BFreeBox : public DigitBase { Float_t fVertices[24]; }; |
f0f769a9 | 32 | |
32e219c2 | 33 | struct BOrigin : public DigitBase { Float_t fA, fB, fC; }; |
915dabe1 | 34 | |
cec82a67 | 35 | struct BAABox : public BOrigin { Float_t fW, fH, fD; }; |
915dabe1 | 36 | |
32e219c2 | 37 | struct BAABoxFixedDim : public BOrigin {}; |
f0f769a9 | 38 | |
915dabe1 | 39 | protected: |
cec82a67 | 40 | BoxType_e fBoxType; // Type of rendered box. |
915dabe1 | 41 | |
cec82a67 | 42 | Float_t fDefWidth; // Breadth assigned to first coordinate (A). |
43 | Float_t fDefHeight; // Breadth assigned to second coordinate (B). | |
44 | Float_t fDefDepth; // Breadth assigned to third coordinate (C). | |
32e219c2 | 45 | |
46 | static Int_t SizeofAtom(BoxType_e bt); | |
915dabe1 | 47 | |
32e219c2 | 48 | public: |
092578a7 | 49 | BoxSet(const Text_t* n="BoxSet", const Text_t* t=""); |
915dabe1 | 50 | virtual ~BoxSet() {} |
51 | ||
32e219c2 | 52 | void Reset(BoxType_e boxType, Bool_t valIsCol, Int_t chunkSize); |
53 | void Reset(); | |
915dabe1 | 54 | |
32e219c2 | 55 | void AddBox(const Float_t* verts); |
56 | void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d); | |
57 | void AddBox(Float_t a, Float_t b, Float_t c); | |
915dabe1 | 58 | |
59 | virtual void ComputeBBox(); | |
32e219c2 | 60 | // virtual void Paint(Option_t* option = ""); |
915dabe1 | 61 | |
32e219c2 | 62 | void Test(Int_t nboxes); |
f0f769a9 | 63 | |
32e219c2 | 64 | Float_t GetDefWidth() const { return fDefWidth; } |
65 | Float_t GetDefHeight() const { return fDefHeight; } | |
66 | Float_t GetDefDepth() const { return fDefDepth; } | |
f0f769a9 | 67 | |
32e219c2 | 68 | void SetDefWidth(Float_t v) { fDefWidth = v ; } |
69 | void SetDefHeight(Float_t v) { fDefHeight = v ; } | |
70 | void SetDefDepth(Float_t v) { fDefDepth = v ; } | |
915dabe1 | 71 | |
cec82a67 | 72 | ClassDef(BoxSet, 1); // Visual class showing a set of boxes. |
915dabe1 | 73 | }; // endclass BoxSet |
74 | ||
75 | } | |
76 | ||
77 | #endif |