Logo ROOT   6.14/05
Reference Guide
TEveBoxSet.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveBoxSet
13 #define ROOT_TEveBoxSet
14 
15 #include "TEveDigitSet.h"
16 #include "TEveVector.h"
17 
18 class TGeoMatrix;
19 class TRandom;
20 
21 class TEveBoxSet: public TEveDigitSet
22 {
23  friend class TEveBoxSetGL;
24 
25  TEveBoxSet(const TEveBoxSet&); // Not implemented
26  TEveBoxSet& operator=(const TEveBoxSet&); // Not implemented
27 
28 public:
29  enum EBoxType_e {
30  kBT_Undef, // unknown-ignored
31  kBT_FreeBox, // arbitrary box: specify 8*(x,y,z) box corners
32  kBT_AABox, // axis-aligned box: specify (x,y,z) and (w, h, d)
33  kBT_AABoxFixedDim, // axis-aligned box w/ fixed dimensions: specify (x,y,z)
36  };
37 
38  struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };
39 
40  struct BOrigin_t : public DigitBase_t { Float_t fA, fB, fC; };
41 
42  struct BAABox_t : public BOrigin_t { Float_t fW, fH, fD; };
43 
44  struct BAABoxFixedDim_t : public BOrigin_t {};
45 
46  struct BCone_t : public DigitBase_t { TEveVector fPos, fDir; Float_t fR; };
47 
48  struct BEllipticCone_t : public BCone_t { Float_t fR2, fAngle; };
49 
50 protected:
51  EBoxType_e fBoxType; // Type of rendered box.
52 
53  Float_t fDefWidth; // Breadth assigned to first coordinate (A).
54  Float_t fDefHeight; // Breadth assigned to second coordinate (B).
55  Float_t fDefDepth; // Breadth assigned to third coordinate (C).
56 
57  Int_t fBoxSkip; // Number of boxes to skip for each drawn box during scene rotation.
58 
60 
61  static Int_t SizeofAtom(EBoxType_e bt);
62 
63 public:
64  TEveBoxSet(const char* n="TEveBoxSet", const char* t="");
65  virtual ~TEveBoxSet() {}
66 
67  void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
68  void Reset();
69 
70  void AddBox(const Float_t* verts);
72  void AddBox(Float_t a, Float_t b, Float_t c);
73 
74  void AddCone(const TEveVector& pos, const TEveVector& dir, Float_t r);
75  void AddEllipticCone(const TEveVector& pos, const TEveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
76 
77  virtual void ComputeBBox();
78  // virtual void Paint(Option_t* option = "");
79 
80  void Test(Int_t nboxes);
81 
82  Float_t GetDefWidth() const { return fDefWidth; }
83  Float_t GetDefHeight() const { return fDefHeight; }
84  Float_t GetDefDepth() const { return fDefDepth; }
85  Bool_t GetDrawConeCap() const { return fDrawConeCap; }
86 
87  void SetDefWidth(Float_t v) { fDefWidth = v ; }
88  void SetDefHeight(Float_t v) { fDefHeight = v ; }
89  void SetDefDepth(Float_t v) { fDefDepth = v ; }
90  void SetDrawConeCap(Bool_t x) { fDrawConeCap=x; StampObjProps(); }
91 
92  Int_t GetBoxSkip() const { return fBoxSkip; }
93  void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }
94 
95  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.
96 };
97 
98 #endif
A GL rendering class for TEveBoxSet.
Definition: TEveBoxSetGL.h:18
void SetDefDepth(Float_t v)
Definition: TEveBoxSet.h:89
void Test(Int_t nboxes)
Fill the structure with a random set of boxes.
Definition: TEveBoxSet.cxx:294
float Float_t
Definition: RtypesCore.h:53
Geometrical transformation package.
Definition: TGeoMatrix.h:40
Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds...
Definition: TEveBoxSet.h:21
void AddEllipticCone(const TEveVector &pos, const TEveVector &dir, Float_t r, Float_t r2, Float_t angle=0)
Create a cone with apex at pos, axis dir and radius r.
Definition: TEveBoxSet.cxx:177
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void SetDefWidth(Float_t v)
Definition: TEveBoxSet.h:87
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
void SetBoxSkip(Int_t bs)
Definition: TEveBoxSet.h:93
Int_t fBoxSkip
Definition: TEveBoxSet.h:57
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Float_t GetDefDepth() const
Definition: TEveBoxSet.h:84
Int_t GetBoxSkip() const
Definition: TEveBoxSet.h:92
Float_t fDefWidth
Definition: TEveBoxSet.h:53
void SetDefHeight(Float_t v)
Definition: TEveBoxSet.h:88
virtual ~TEveBoxSet()
Definition: TEveBoxSet.h:65
Float_t GetDefWidth() const
Definition: TEveBoxSet.h:82
ROOT::R::TRInterface & r
Definition: Object.C:4
SVector< double, 2 > v
Definition: Dict.h:5
auto * a
Definition: textangle.C:12
void StampObjProps()
Definition: TEveElement.h:397
TEveBoxSet & operator=(const TEveBoxSet &)
#define h(i)
Definition: RSha256.hxx:106
Float_t fDefHeight
Definition: TEveBoxSet.h:54
#define d(i)
Definition: RSha256.hxx:102
EBoxType_e fBoxType
Definition: TEveBoxSet.h:51
void SetDrawConeCap(Bool_t x)
Definition: TEveBoxSet.h:90
void AddCone(const TEveVector &pos, const TEveVector &dir, Float_t r)
Create a cone with apex at pos, axis dir and radius r.
Definition: TEveBoxSet.cxx:160
virtual void ComputeBBox()
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition: TEveBoxSet.cxx:197
TEveBoxSet(const TEveBoxSet &)
Float_t GetDefHeight() const
Definition: TEveBoxSet.h:83
static Int_t SizeofAtom(EBoxType_e bt)
Return size of data-structure describing a box of type bt.
Definition: TEveBoxSet.cxx:67
void Reset()
Reset the data containers to zero size.
Definition: TEveBoxSet.cxx:101
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
#define c(i)
Definition: RSha256.hxx:101
Float_t fDefDepth
Definition: TEveBoxSet.h:55
Bool_t fDrawConeCap
Definition: TEveBoxSet.h:59
const Int_t n
Definition: legend1.C:16
Base-class for storage of digit collections; provides transformation matrix (TEveTrans), signal to color mapping (TEveRGBAPalette) and visual grouping (TEveFrameBox).
Definition: TEveDigitSet.h:29
Float_t fVertices[8][3]
Definition: TEveBoxSet.h:38
void AddBox(const Float_t *verts)
Create a new box from a set of 8 vertices.
Definition: TEveBoxSet.cxx:112
Bool_t GetDrawConeCap() const
Definition: TEveBoxSet.h:85