TEveBoxSet.h

Go to the documentation of this file.
00001 // @(#)root/eve:$Id: TEveBoxSet.h 37234 2010-12-03 18:20:15Z matevz $
00002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
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&);            // Not implemented
00026    TEveBoxSet& operator=(const TEveBoxSet&); // Not implemented
00027 
00028 public:
00029    enum EBoxType_e {
00030       kBT_Undef,           // unknown-ignored
00031       kBT_FreeBox,         // arbitrary box: specify 8*(x,y,z) box corners
00032       kBT_AABox,           // axis-aligned box: specify (x,y,z) and (w, h, d)
00033       kBT_AABoxFixedDim,   // axis-aligned box w/ fixed dimensions: specify (x,y,z)
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;      // Type of rendered box.
00052 
00053    Float_t           fDefWidth;     // Breadth assigned to first coordinate  (A).
00054    Float_t           fDefHeight;    // Breadth assigned to second coordinate (B).
00055    Float_t           fDefDepth;     // Breadth assigned to third coordinate  (C).
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    // virtual void Paint(Option_t* option = "");
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); // Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds); each primitive can be assigned a signal value and a TRef.
00091 };
00092 
00093 #endif

Generated on Tue Jul 5 14:14:47 2011 for ROOT_528-00b_version by  doxygen 1.5.1