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_Instanced, // axis-aligned digit w/ fixed dimensions: specify (x,y,z)
35 kBT_InstancedScaled, // axis-aligned digit: specify (x,y,z) and (w, h, d)
36 kBT_InstancedScaledRotated // generic Mat4 transformation
37 };
38
39 enum EShape_e {
44 };
45
46 struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };
47
48 struct Instanced_t : public DigitBase_t { Float_t fX, fY, fZ; }; // save only position == INSTANCED_T
49
50 struct InstancedScaled_t : public Instanced_t { Float_t fW, fH, fD; }; // scaled box INSTANCED_SCALED_T
51
52 struct InstancedScaledRotated_t : public DigitBase_t { Float_t fMat[16]; }; // INSTANCED_SCALEDROTATED
53
54 // ++ TODO add rotated
55
56protected:
57 EBoxType_e fBoxType; // Type of rendered box.
59
60 Float_t fDefWidth {1}; // Breadth assigned to first coordinate (A).
61 Float_t fDefHeight {1}; // Breadth assigned to second coordinate (B).
62 Float_t fDefDepth {1}; // Breadth assigned to third coordinate (C).
63
64 Int_t fBoxSkip; // Number of boxes to skip for each drawn box during scene rotation.
65
67
68 int fTexX{0}, fTexY{0};
69 static Int_t SizeofAtom(EBoxType_e bt);
70 void WriteShapeData(REveDigitSet::DigitBase_t &digit);
71 unsigned int GetColorFromDigit(REveDigitSet::DigitBase_t &digit);
72 float GetColorFromDigitAsFloat(REveDigitSet::DigitBase_t &digit);
73
74public:
75 REveBoxSet(const char* n="REveBoxSet", const char* t="");
76 ~REveBoxSet() override {}
77
78 void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
79 void Reset();
80
81 void AddFreeBox(const Float_t* verts);
84 void AddInstanceMat4(const Float_t* mat4);
85
86 void AddBox(const Float_t* verts) { AddFreeBox(verts); }
89
90 void AddCone(const REveVector& pos, const REveVector& dir, Float_t r);
91 void AddEllipticCone(const REveVector& pos, const REveVector& dir, Float_t r, Float_t r2, Float_t angle=0);
92
93 void AddHex(const REveVector& pos, Float_t r, Float_t angle, Float_t depth);
95
96 void ComputeBBox() override;
97
98 void Test(Int_t nboxes);
99
100 Float_t GetDefWidth() const { return fDefWidth; }
101 Float_t GetDefHeight() const { return fDefHeight; }
102 Float_t GetDefDepth() const { return fDefDepth; }
104
109
110 Int_t GetBoxSkip() const { return fBoxSkip; }
111 void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }
112
113
114 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
115 void BuildRenderData() override;
116
117 bool Instanced();
118};
119
120} // namespace Experimental
121} // namespace ROOT
122#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
int Int_t
Definition RtypesCore.h:45
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
Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds,...
void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d)
void AddInstanceMat4(const Float_t *mat4)
Create shape with arbitrary transformtaion.
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)
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 AddInstanceScaled(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d)
Create a new axis-aligned box from at a given position and with specified dimensions.
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,...
unsigned int GetColorFromDigit(REveDigitSet::DigitBase_t &digit)
Get int value for color.
float GetColorFromDigitAsFloat(REveDigitSet::DigitBase_t &digit)
void WriteShapeData(REveDigitSet::DigitBase_t &digit)
Write shape data for different cases.
void AddFreeBox(const Float_t *verts)
Create a new box from a set of 8 vertices.
static Int_t SizeofAtom(EBoxType_e bt)
Return size of data-structure describing a box of type bt.
bool Instanced()
Use instancing in RenderCore.
void AddInstance(Float_t a, Float_t b, Float_t c)
Create a new axis-aligned box from at a given position.
void AddBox(Float_t a, Float_t b, Float_t c)
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
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...