Logo ROOT  
Reference Guide
REveBoxSet.hxx
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_REveBoxSet
13 #define ROOT_REveBoxSet
14 
15 #include "ROOT/REveDigitSet.hxx"
16 #include "ROOT/REveVector.hxx"
17 
18 class TGeoMatrix;
19 class TRandom;
20 
21 namespace ROOT {
22 namespace Experimental {
23 class REveBoxSet: public REveDigitSet
24 {
25  friend class REveBoxSetGL;
26 
27  REveBoxSet(const REveBoxSet&) = delete;
28  REveBoxSet& operator=(const REveBoxSet&) = delete;
29 
30 public:
31  enum EBoxType_e {
32  kBT_Undef, // unknown-ignored
33  kBT_FreeBox, // arbitrary box: specify 8*(x,y,z) box corners
34  kBT_AABox, // axis-aligned box: specify (x,y,z) and (w, h, d)
35  kBT_AABoxFixedDim, // axis-aligned box w/ fixed dimensions: specify (x,y,z)
38  kBT_Hex
39  };
40 
41  struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };
42 
43  struct BOrigin_t : public DigitBase_t { Float_t fA, fB, fC; };
44 
45  struct BAABox_t : public BOrigin_t { Float_t fW, fH, fD; };
46 
47  struct BAABoxFixedDim_t : public BOrigin_t {};
48 
49  struct BCone_t : public DigitBase_t { REveVector fPos, fDir; Float_t fR; };
50 
51  struct BEllipticCone_t : public BCone_t { Float_t fR2, fAngle; };
52 
54 
55 protected:
56  EBoxType_e fBoxType; // Type of rendered box.
57 
58  Float_t fDefWidth; // Breadth assigned to first coordinate (A).
59  Float_t fDefHeight; // Breadth assigned to second coordinate (B).
60  Float_t fDefDepth; // Breadth assigned to third coordinate (C).
61 
62  Int_t fBoxSkip; // Number of boxes to skip for each drawn box during scene rotation.
63 
65 
66  static Int_t SizeofAtom(EBoxType_e bt);
67 
68 public:
69  REveBoxSet(const char* n="REveBoxSet", const char* t="");
70  virtual ~REveBoxSet() {}
71 
72  void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
73  void Reset();
74 
75  void AddBox(const Float_t* verts);
77  void AddBox(Float_t a, Float_t b, Float_t c);
78 
79  void AddCone(const REveVector& pos, const REveVector& dir, Float_t r);
80  void AddEllipticCone(const REveVector& pos, const REveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
81 
82  void AddHex(const REveVector& pos, Float_t r, Float_t angle, Float_t depth);
83 
84  void ComputeBBox() override;
85 
86  void Test(Int_t nboxes);
87 
88  Float_t GetDefWidth() const { return fDefWidth; }
89  Float_t GetDefHeight() const { return fDefHeight; }
90  Float_t GetDefDepth() const { return fDefDepth; }
91  Bool_t GetDrawConeCap() const { return fDrawConeCap; }
92 
97 
98  Int_t GetBoxSkip() const { return fBoxSkip; }
99  void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }
100 
101 
102  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
103  void BuildRenderData() override;
104 };
105 
106 } // namespace Experimental
107 } // namespace ROOT
108 #endif
c
#define c(i)
Definition: RSha256.hxx:101
ROOT::Experimental::REveBoxSet::SetBoxSkip
void SetBoxSkip(Int_t bs)
Definition: REveBoxSet.hxx:99
n
const Int_t n
Definition: legend1.C:16
ROOT::Experimental::REveBoxSet::BAABox_t::fH
Float_t fH
Definition: REveBoxSet.hxx:45
REveDigitSet.hxx
DigitBase_t
ROOT::Experimental::REveBoxSet::SetDefDepth
void SetDefDepth(Float_t v)
Definition: REveBoxSet.hxx:95
ROOT::Experimental::REveDigitSet
Definition: REveDigitSet.hxx:35
ROOT::Experimental::REveBoxSet::kBT_Hex
@ kBT_Hex
Definition: REveBoxSet.hxx:38
ROOT::Experimental::REveBoxSet::REveBoxSetGL
friend class REveBoxSetGL
Definition: REveBoxSet.hxx:25
ROOT::Experimental::REveBoxSet::AddBox
void AddBox(const Float_t *verts)
Create a new box from a set of 8 vertices.
Definition: REveBoxSet.cxx:114
ROOT::Experimental::REveBoxSet::BEllipticCone_t
Definition: REveBoxSet.hxx:51
ROOT::Experimental::REveBoxSet::~REveBoxSet
virtual ~REveBoxSet()
Definition: REveBoxSet.hxx:70
r
ROOT::R::TRInterface & r
Definition: Object.C:4
ROOT::Experimental::REveBoxSet::GetDefHeight
Float_t GetDefHeight() const
Definition: REveBoxSet.hxx:89
ROOT::Experimental::REveBoxSet::Test
void Test(Int_t nboxes)
Fill the structure with a random set of boxes.
Definition: REveBoxSet.cxx:429
Float_t
float Float_t
Definition: RtypesCore.h:57
ROOT::Experimental::REveBoxSet::fDefWidth
Float_t fDefWidth
Definition: REveBoxSet.hxx:58
ROOT::Experimental::REveBoxSet::fDefHeight
Float_t fDefHeight
Definition: REveBoxSet.hxx:59
ROOT::Experimental::REveBoxSet::AddHex
void AddHex(const REveVector &pos, Float_t r, Float_t angle, Float_t depth)
Create a hexagonal prism with center of one hexagon at pos, radius of hexagon vertices r,...
Definition: REveBoxSet.cxx:200
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REveBoxSet::Reset
void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize)
ROOT::Experimental::REveBoxSet::AddCone
void AddCone(const REveVector &pos, const REveVector &dir, Float_t r)
Create a cone with apex at pos, axis dir and radius r.
Definition: REveBoxSet.cxx:162
ROOT::Experimental::REveBoxSet::GetBoxSkip
Int_t GetBoxSkip() const
Definition: REveBoxSet.hxx:98
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Experimental::REveBoxSet::BAABox_t::fW
Float_t fW
Definition: REveBoxSet.hxx:45
ROOT::Experimental::REveBoxSet::operator=
REveBoxSet & operator=(const REveBoxSet &)=delete
ROOT::Experimental::REveBoxSet::kBT_AABoxFixedDim
@ kBT_AABoxFixedDim
Definition: REveBoxSet.hxx:35
ROOT::Experimental::REveBoxSet::BAABoxFixedDim_t
Definition: REveBoxSet.hxx:47
ROOT::Experimental::REveVectorT< Float_t >
v
@ v
Definition: rootcling_impl.cxx:3635
b
#define b(i)
Definition: RSha256.hxx:100
bool
ROOT::Experimental::REveBoxSet::BHex_t::fDepth
Float_t fDepth
Definition: REveBoxSet.hxx:53
ROOT::Experimental::REveBoxSet::BOrigin_t::fB
Float_t fB
Definition: REveBoxSet.hxx:43
ROOT::Experimental::REveDigitSet::DigitBase_t
Definition: REveDigitSet.hxx:49
ROOT::Experimental::REveBoxSet::BOrigin_t::fC
Float_t fC
Definition: REveBoxSet.hxx:43
ROOT::Experimental::REveBoxSet::WriteCoreJson
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition: REveBoxSet.cxx:334
ROOT::Experimental::REveBoxSet::BCone_t::fPos
REveVector fPos
Definition: REveBoxSet.hxx:49
ROOT::Experimental::REveBoxSet::BAABox_t::fD
Float_t fD
Definition: REveBoxSet.hxx:45
TRandom
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
ROOT::Experimental::REveBoxSet::SetDefWidth
void SetDefWidth(Float_t v)
Definition: REveBoxSet.hxx:93
ROOT::Experimental::REveBoxSet::fBoxType
EBoxType_e fBoxType
Definition: REveBoxSet.hxx:56
h
#define h(i)
Definition: RSha256.hxx:106
ROOT::Experimental::REveBoxSet::kBT_FreeBox
@ kBT_FreeBox
Definition: REveBoxSet.hxx:33
ROOT::Experimental::REveBoxSet::BCone_t::fR
Float_t fR
Definition: REveBoxSet.hxx:49
ROOT::Experimental::REveBoxSet::BHex_t::fPos
REveVector fPos
Definition: REveBoxSet.hxx:53
a
auto * a
Definition: textangle.C:12
ROOT::Experimental::REveBoxSet::REveBoxSet
REveBoxSet(const char *n="REveBoxSet", const char *t="")
ROOT::Experimental::REveBoxSet::fDefDepth
Float_t fDefDepth
Definition: REveBoxSet.hxx:60
ROOT::Experimental::REveBoxSet::BAABox_t
Definition: REveBoxSet.hxx:45
ROOT::Experimental::REveBoxSet::BOrigin_t::fA
Float_t fA
Definition: REveBoxSet.hxx:43
ROOT::Experimental::REveBoxSet::kBT_Cone
@ kBT_Cone
Definition: REveBoxSet.hxx:36
ROOT::Experimental::REveBoxSet::fDrawConeCap
Bool_t fDrawConeCap
Definition: REveBoxSet.hxx:64
ROOT::Experimental::REveBoxSet::BFreeBox_t::fVertices
Float_t fVertices[8][3]
Definition: REveBoxSet.hxx:41
ROOT::Experimental::REveBoxSet::EBoxType_e
EBoxType_e
Definition: REveBoxSet.hxx:31
ROOT::Experimental::REveBoxSet::GetDefWidth
Float_t GetDefWidth() const
Definition: REveBoxSet.hxx:88
ROOT::Experimental::REveBoxSet::kBT_Undef
@ kBT_Undef
Definition: REveBoxSet.hxx:32
ROOT::Experimental::REveBoxSet
Definition: REveBoxSet.hxx:24
ROOT::Experimental::REveBoxSet::SizeofAtom
static Int_t SizeofAtom(EBoxType_e bt)
Return size of data-structure describing a box of type bt.
Definition: REveBoxSet.cxx:70
ROOT::Experimental::REveBoxSet::BCone_t
Definition: REveBoxSet.hxx:49
ROOT::Experimental::REveElement::StampObjProps
void StampObjProps()
Definition: REveElement.hxx:341
ROOT::Experimental::REveBoxSet::GetDrawConeCap
Bool_t GetDrawConeCap() const
Definition: REveBoxSet.hxx:91
ROOT::Experimental::REveBoxSet::GetDefDepth
Float_t GetDefDepth() const
Definition: REveBoxSet.hxx:90
TGeoMatrix
Geometrical transformation package.
Definition: TGeoMatrix.h:41
ROOT::Experimental::REveBoxSet::kBT_EllipticCone
@ kBT_EllipticCone
Definition: REveBoxSet.hxx:37
ROOT::Experimental::REveBoxSet::REveBoxSet
REveBoxSet(const REveBoxSet &)=delete
ROOT::Experimental::REveBoxSet::fBoxSkip
Int_t fBoxSkip
Definition: REveBoxSet.hxx:62
ROOT::Experimental::REveBoxSet::BEllipticCone_t::fR2
Float_t fR2
Definition: REveBoxSet.hxx:51
ROOT::Experimental::REveBoxSet::SetDefHeight
void SetDefHeight(Float_t v)
Definition: REveBoxSet.hxx:94
ROOT::Experimental::REveBoxSet::BFreeBox_t
Definition: REveBoxSet.hxx:41
ROOT::Experimental::REveBoxSet::ComputeBBox
void ComputeBBox() override
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition: REveBoxSet.cxx:218
ROOT::Experimental::REveBoxSet::kBT_AABox
@ kBT_AABox
Definition: REveBoxSet.hxx:34
REveVector.hxx
d
#define d(i)
Definition: RSha256.hxx:102
ROOT::Experimental::REveBoxSet::BEllipticCone_t::fAngle
Float_t fAngle
Definition: REveBoxSet.hxx:51
ROOT::Experimental::REveBoxSet::BHex_t::fR
Float_t fR
Definition: REveBoxSet.hxx:53
ROOT::Experimental::REveBoxSet::AddEllipticCone
void AddEllipticCone(const REveVector &pos, const REveVector &dir, Float_t r, Float_t r2, Float_t angle=0)
Create a cone with apex at pos, axis dir and radius r.
Definition: REveBoxSet.cxx:179
ROOT::Experimental::REveBoxSet::BCone_t::fDir
REveVector fDir
Definition: REveBoxSet.hxx:49
ROOT::Experimental::REveBoxSet::BuildRenderData
void BuildRenderData() override
Crates 3D point array for rendering.
Definition: REveBoxSet.cxx:345
ROOT::Experimental::REveBoxSet::BHex_t::fAngle
Float_t fAngle
Definition: REveBoxSet.hxx:53
ROOT::Experimental::REveBoxSet::Reset
void Reset()
Reset the data containers to zero size.
Definition: REveBoxSet.cxx:104
ROOT::Experimental::REveBoxSet::BHex_t
Definition: REveBoxSet.hxx:53
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveBoxSet::SetDrawConeCap
void SetDrawConeCap(Bool_t x)
Definition: REveBoxSet.hxx:96
ROOT::Experimental::REveBoxSet::BOrigin_t
Definition: REveBoxSet.hxx:43
int