Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18class TGeoMatrix;
19class TRandom;
20
21namespace ROOT {
22namespace Experimental {
24{
25 friend class REveBoxSetGL;
26
27 REveBoxSet(const REveBoxSet&) = delete;
28 REveBoxSet& operator=(const REveBoxSet&) = delete;
29
30public:
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)
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
50
51 struct BEllipticCone_t : public BCone_t { Float_t fR2, fAngle; };
52
54
55protected:
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);
68
69public:
70 REveBoxSet(const char* n="REveBoxSet", const char* t="");
71 virtual ~REveBoxSet() {}
72
73 void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
74 void Reset();
75
76 void AddBox(const Float_t* verts);
79
80 void AddCone(const REveVector& pos, const REveVector& dir, Float_t r);
81 void AddEllipticCone(const REveVector& pos, const REveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
82
83 void AddHex(const REveVector& pos, Float_t r, Float_t angle, Float_t depth);
84
85 void ComputeBBox() override;
86
87 void Test(Int_t nboxes);
88
89 Float_t GetDefWidth() const { return fDefWidth; }
90 Float_t GetDefHeight() const { return fDefHeight; }
91 Float_t GetDefDepth() const { return fDefDepth; }
93
98
99 Int_t GetBoxSkip() const { return fBoxSkip; }
100 void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }
101
102
103 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
104 void BuildRenderData() override;
105};
106
107} // namespace Experimental
108} // namespace ROOT
109#endif
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
float Float_t
Definition RtypesCore.h:57
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint angle
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.
void ComputeBBox() override
Fill bounding-box information of the base-class TAttBBox (virtual method).
void AddBox(const Float_t *verts)
Create a new box from a set of 8 vertices.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
void BuildRenderData() override
Creates 3D point array for rendering.
REveBoxSet(const REveBoxSet &)=delete
void Test(Int_t nboxes)
Fill the structure with a random set of boxes.
void AddCone(const REveVector &pos, const REveVector &dir, Float_t r)
Create a cone with apex at pos, axis dir and radius r.
void Reset()
Reset the data containers to zero size.
void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize)
REveBoxSet & operator=(const REveBoxSet &)=delete
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,...
void WriteShapeData(REveDigitSet::DigitBase_t &digit)
Write shape data for different cases.
static Int_t SizeofAtom(EBoxType_e bt)
Return size of data-structure describing a box of type bt.
Geometrical transformation package.
Definition TGeoMatrix.h:38
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.