00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TEveBoxSet
00013 #define ROOT_TEveBoxSet
00014
00015 #include "TEveDigitSet.h"
00016 #include "TEveVector.h"
00017
00018 class TGeoMatrix;
00019 class TRandom;
00020
00021 class TEveBoxSet: public TEveDigitSet
00022 {
00023 friend class TEveBoxSetGL;
00024
00025 TEveBoxSet(const TEveBoxSet&);
00026 TEveBoxSet& operator=(const TEveBoxSet&);
00027
00028 public:
00029 enum EBoxType_e {
00030 kBT_Undef,
00031 kBT_FreeBox,
00032 kBT_AABox,
00033 kBT_AABoxFixedDim,
00034 kBT_Cone,
00035 kBT_EllipticCone
00036 };
00037
00038 struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };
00039
00040 struct BOrigin_t : public DigitBase_t { Float_t fA, fB, fC; };
00041
00042 struct BAABox_t : public BOrigin_t { Float_t fW, fH, fD; };
00043
00044 struct BAABoxFixedDim_t : public BOrigin_t {};
00045
00046 struct BCone_t : public DigitBase_t { TEveVector fPos, fDir; Float_t fR; };
00047
00048 struct BEllipticCone_t : public BCone_t { Float_t fR2, fAngle; };
00049
00050 protected:
00051 EBoxType_e fBoxType;
00052
00053 Float_t fDefWidth;
00054 Float_t fDefHeight;
00055 Float_t fDefDepth;
00056
00057 Bool_t fDrawConeCap;
00058
00059 static Int_t SizeofAtom(EBoxType_e bt);
00060
00061 public:
00062 TEveBoxSet(const char* n="TEveBoxSet", const char* t="");
00063 virtual ~TEveBoxSet() {}
00064
00065 void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
00066 void Reset();
00067
00068 void AddBox(const Float_t* verts);
00069 void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d);
00070 void AddBox(Float_t a, Float_t b, Float_t c);
00071
00072 void AddCone(const TEveVector& pos, const TEveVector& dir, Float_t r);
00073 void AddEllipticCone(const TEveVector& pos, const TEveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
00074
00075 virtual void ComputeBBox();
00076
00077
00078 void Test(Int_t nboxes);
00079
00080 Float_t GetDefWidth() const { return fDefWidth; }
00081 Float_t GetDefHeight() const { return fDefHeight; }
00082 Float_t GetDefDepth() const { return fDefDepth; }
00083 Bool_t GetDrawConeCap() const { return fDrawConeCap; }
00084
00085 void SetDefWidth(Float_t v) { fDefWidth = v ; }
00086 void SetDefHeight(Float_t v) { fDefHeight = v ; }
00087 void SetDefDepth(Float_t v) { fDefDepth = v ; }
00088 void SetDrawConeCap(Bool_t x) { fDrawConeCap=x; StampObjProps(); }
00089
00090 ClassDef(TEveBoxSet, 0);
00091 };
00092
00093 #endif