]>
Commit | Line | Data |
---|---|---|
915dabe1 | 1 | // $Header$ |
2 | ||
3 | #ifndef REVE_BoxSet_H | |
4 | #define REVE_BoxSet_H | |
5 | ||
6 | #include <Gtypes.h> | |
7 | #include <TNamed.h> | |
8 | #include <TAtt3D.h> | |
9 | #include <TAttBBox.h> | |
f0f769a9 | 10 | #include <Reve/RenderElement.h> |
915dabe1 | 11 | #include <Reve/Reve.h> |
f0f769a9 | 12 | #include "ZTrans.h" |
13 | ||
915dabe1 | 14 | #include <vector> |
15 | ||
f0f769a9 | 16 | class TGeoMatrix; |
915dabe1 | 17 | class TRandom; |
18 | ||
19 | namespace Reve { | |
20 | ||
21 | struct Box | |
22 | { | |
23 | Float_t vertices[24]; | |
24 | UChar_t color[4]; | |
25 | ||
f0f769a9 | 26 | Box(Color_t col = 1); |
27 | Box(Color_t col, Float_t* p); | |
28 | Box(Color_t col, Float_t x, Float_t y, Float_t z, | |
29 | Float_t dx, Float_t dy, Float_t dz); | |
915dabe1 | 30 | |
31 | Box(TRandom& rnd, Float_t origin, Float_t size); | |
32 | ||
33 | virtual ~Box() {} | |
34 | ||
f0f769a9 | 35 | void MakeAxisAlignedBox(Float_t x, Float_t y, Float_t z, |
36 | Float_t dx, Float_t dy, Float_t dz); | |
37 | ||
915dabe1 | 38 | ClassDef(Box, 1); |
39 | }; | |
40 | ||
41 | /**************************************************************************/ | |
42 | ||
f0f769a9 | 43 | class BoxSet: public RenderElement, |
44 | public TNamed, | |
45 | public TAtt3D, | |
46 | public TAttBBox | |
915dabe1 | 47 | { |
48 | friend class BoxSetGL; | |
49 | ||
f0f769a9 | 50 | public: |
51 | enum RenderMode_e { RM_AsIs, RM_Line, RM_Fill }; | |
52 | ||
915dabe1 | 53 | protected: |
f0f769a9 | 54 | Color_t fDefaultColor; |
55 | RenderMode_e fRenderMode; | |
56 | ZTrans fHMTrans; | |
915dabe1 | 57 | |
58 | public: | |
59 | std::vector<Box> fBoxes; | |
60 | ||
092578a7 | 61 | BoxSet(const Text_t* n="BoxSet", const Text_t* t=""); |
915dabe1 | 62 | virtual ~BoxSet() {} |
63 | ||
f0f769a9 | 64 | void AddBox(const Box& b) { fBoxes.push_back(b); } |
915dabe1 | 65 | void ClearSet() { fBoxes.clear(); } |
66 | ||
f0f769a9 | 67 | virtual Bool_t CanEditMainColor() { return kTRUE; } |
915dabe1 | 68 | |
69 | virtual void ComputeBBox(); | |
70 | virtual void Paint(Option_t* option = ""); | |
71 | ||
f0f769a9 | 72 | RenderMode_e GetRenderMode() const { return fRenderMode; } |
73 | void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; } | |
74 | ||
75 | ZTrans& RefHMTrans() { return fHMTrans; } | |
76 | void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); } | |
77 | void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); } | |
78 | ||
915dabe1 | 79 | void Test(Int_t nboxes); |
80 | ||
81 | ClassDef(BoxSet, 1); | |
82 | }; // endclass BoxSet | |
83 | ||
84 | } | |
85 | ||
86 | #endif |