]>
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> | |
10 | #include <Reve/Reve.h> | |
11 | #include <vector> | |
12 | ||
13 | class TRandom; | |
14 | ||
15 | namespace Reve { | |
16 | ||
17 | struct Box | |
18 | { | |
19 | Float_t vertices[24]; | |
20 | UChar_t color[4]; | |
21 | ||
22 | Box(Color_t col = 1) | |
23 | { Reve::ColorFromIdx(col, color); } | |
24 | Box(Color_t col, Float_t* p) | |
25 | { Reve::ColorFromIdx(col, color); memcpy(vertices, p, 32*sizeof(Float_t)); } | |
26 | ||
27 | Box(TRandom& rnd, Float_t origin, Float_t size); | |
28 | ||
29 | virtual ~Box() {} | |
30 | ||
31 | ClassDef(Box, 1); | |
32 | }; | |
33 | ||
34 | /**************************************************************************/ | |
35 | ||
36 | class BoxSet: public TNamed, public TAtt3D, public TAttBBox | |
37 | { | |
38 | friend class BoxSetGL; | |
39 | ||
915dabe1 | 40 | protected: |
41 | Double_t fMatrix[16]; | |
42 | Bool_t fTrans; | |
43 | ||
44 | public: | |
45 | std::vector<Box> fBoxes; | |
46 | ||
092578a7 | 47 | BoxSet(const Text_t* n="BoxSet", const Text_t* t=""); |
915dabe1 | 48 | virtual ~BoxSet() {} |
49 | ||
50 | void ClearSet() { fBoxes.clear(); } | |
51 | ||
52 | Bool_t GetTrans() const { return fTrans; } | |
53 | void SetTrans(Bool_t t) { fTrans = t; } | |
54 | ||
55 | virtual void ComputeBBox(); | |
56 | virtual void Paint(Option_t* option = ""); | |
57 | ||
58 | void Test(Int_t nboxes); | |
59 | ||
60 | ClassDef(BoxSet, 1); | |
61 | }; // endclass BoxSet | |
62 | ||
63 | } | |
64 | ||
65 | #endif |