File indexing completed on 2025-01-18 10:11:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TEveBoxSet
0013 #define ROOT_TEveBoxSet
0014
0015 #include "TEveDigitSet.h"
0016 #include "TEveVector.h"
0017
0018 class TGeoMatrix;
0019 class TRandom;
0020
0021 class TEveBoxSet: public TEveDigitSet
0022 {
0023 friend class TEveBoxSetGL;
0024
0025 TEveBoxSet(const TEveBoxSet&);
0026 TEveBoxSet& operator=(const TEveBoxSet&);
0027
0028 public:
0029 enum EBoxType_e {
0030 kBT_Undef,
0031 kBT_FreeBox,
0032 kBT_AABox,
0033 kBT_AABoxFixedDim,
0034 kBT_Cone,
0035 kBT_EllipticCone,
0036 kBT_Hex
0037 };
0038
0039 struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };
0040
0041 struct BOrigin_t : public DigitBase_t { Float_t fA, fB, fC; };
0042
0043 struct BAABox_t : public BOrigin_t { Float_t fW, fH, fD; };
0044
0045 struct BAABoxFixedDim_t : public BOrigin_t {};
0046
0047 struct BCone_t : public DigitBase_t { TEveVector fPos, fDir; Float_t fR; };
0048
0049 struct BEllipticCone_t : public BCone_t { Float_t fR2, fAngle; };
0050
0051 struct BHex_t : public DigitBase_t { TEveVector fPos; Float_t fR, fAngle, fDepth; };
0052
0053 protected:
0054 EBoxType_e fBoxType;
0055
0056 Float_t fDefWidth;
0057 Float_t fDefHeight;
0058 Float_t fDefDepth;
0059
0060 Int_t fBoxSkip;
0061
0062 Bool_t fDrawConeCap;
0063
0064 static Int_t SizeofAtom(EBoxType_e bt);
0065
0066 public:
0067 TEveBoxSet(const char* n="TEveBoxSet", const char* t="");
0068 ~TEveBoxSet() override {}
0069
0070 void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
0071 void Reset();
0072
0073 void AddBox(const Float_t* verts);
0074 void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d);
0075 void AddBox(Float_t a, Float_t b, Float_t c);
0076
0077 void AddCone(const TEveVector& pos, const TEveVector& dir, Float_t r);
0078 void AddEllipticCone(const TEveVector& pos, const TEveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
0079
0080 void AddHex(const TEveVector& pos, Float_t r, Float_t angle, Float_t depth);
0081
0082 void ComputeBBox() override;
0083
0084
0085 void Test(Int_t nboxes);
0086
0087 Float_t GetDefWidth() const { return fDefWidth; }
0088 Float_t GetDefHeight() const { return fDefHeight; }
0089 Float_t GetDefDepth() const { return fDefDepth; }
0090 Bool_t GetDrawConeCap() const { return fDrawConeCap; }
0091
0092 void SetDefWidth(Float_t v) { fDefWidth = v ; }
0093 void SetDefHeight(Float_t v) { fDefHeight = v ; }
0094 void SetDefDepth(Float_t v) { fDefDepth = v ; }
0095 void SetDrawConeCap(Bool_t x) { fDrawConeCap=x; StampObjProps(); }
0096
0097 Int_t GetBoxSkip() const { return fBoxSkip; }
0098 void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }
0099
0100 ClassDefOverride(TEveBoxSet, 0);
0101 };
0102
0103 #endif