]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/BoxSet.h
Merge from EVE-dev to HEAD.
[u/mrichter/AliRoot.git] / EVE / Reve / BoxSet.h
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, 24*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
40 protected:
41   Double_t          fMatrix[16];
42   Bool_t            fTrans;
43
44 public:
45   std::vector<Box>  fBoxes;
46
47   BoxSet(const Text_t* n="BoxSet", const Text_t* t="");
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   Double_t* ArrTrans()      { return fMatrix; }
55
56   virtual void ComputeBBox();
57   virtual void Paint(Option_t* option = "");
58
59   void Test(Int_t nboxes);
60
61   ClassDef(BoxSet, 1);
62 }; // endclass BoxSet
63
64 }
65
66 #endif