22#include <nlohmann/json.hpp>
24using namespace::ROOT::Experimental;
81 default:
throw(eH +
"unexpected atom type.");
118 throw(eH +
"expect free box-type.");
121 memcpy(
b->fVertices, verts,
sizeof(
b->fVertices));
135 throw(eH +
"expect axis-aligned box-type.");
151 throw(eH +
"expect axis-aligned fixed-dimension box-type.");
164 throw(eH +
"expect Mat4 box-type.");
167 memcpy(
b->fMat, arr,
sizeof(
b->fMat));
177 using namespace TMath;
185 theta =
Pi()/2 -theta;
192 for(
Int_t i=0; i<16; ++i)
193 cone->
fMat[i] = t[i];
203 static const REveException eH(
"REveBoxSet::AddEllipticCone ");
204 using namespace TMath;
211 theta =
Pi()/2 -theta;
219 for(
Int_t i=0; i<16; ++i)
220 cone->
fMat[i] = t[i];
233 throw(eH +
"expect hex box-type.");
242 for(
Int_t i=0; i<16; ++i)
258 for (
int i=0; i<
n; ++i, bbps+=3)
263 if(
fPlex.Size() == 0)
279 for (
Int_t i = 0; i < 8; ++i)
317 throw eH +
"unsupported box-type.";
341 std::string instanceFlag;
345 instanceFlag =
"FixedDimension";
349 instanceFlag =
"ScalePerDigit";
353 instanceFlag =
"Mat4Trans";
365 j[
"instanceFlag"] = instanceFlag;
384 if (
fPlex.Size() == 0)
402 int value =
c[0] +
c[1] * 256 +
c[2] * 256 * 256;
431 return (
c[0] << 16) + (
c[1] << 8) +
c[2];
436 return (
c[0] << 16) + (
c[1] << 8) +
c[2];
443 return (
c[0] << 16) + (
c[1] << 8) +
c[2];
450 auto pc = (
float *) &
c;
464 for (
int c = 0;
c < 8;
c++) {
465 for (
int j = 0; j < 3; j++)
494 for (
int i = 0; i < 12; i++) {
500 default: assert(
false &&
"REveBoxSet::BuildRenderData only kBT_FreeBox type supported");
513 for(
Int_t i=0; i<nboxes; ++i)
540bool REveBoxSet::SetDigitShape(const std::vector<float>& vrtBuff, const std::vector<int>& idxBuff)
#define R__LOG_ERROR(...)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
void AddInstanceMat4(const Float_t *mat4)
Create shape with arbitrary transformtaion.
@ kBT_InstancedScaledRotated
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).
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 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 Reset(Int_t atom_size, Int_t chunk_size)
Empty the container and reset it with given atom and chunk sizes.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
REveDigitSet(const REveDigitSet &)
DigitBase_t * NewDigit()
Protected method called whenever a new digit is added.
bool IsDigitVisible(const DigitBase_t *) const
Utility function for maping digit idx with visible shape idx.
REveRGBAPalette * fPalette
void ReleaseIds()
Protected method.
void DigitValue(Int_t value)
Set signal value for the last digit added.
std::unique_ptr< REveRenderData > fRenderData
! Vertex / normal / triangle index information for rendering.
virtual Color_t GetMainColor() const
virtual void BuildRenderData()
Write transformation Matrix to render data.
REveException Exception-type thrown by Eve classes.
static void CalcTextureSize(int nel, int align, int &sx, int &sy)
Calculate texture dimensions to hold nel elements with given alignment on x axis.
static void CheckAndFixBoxOrientationFv(Float_t box[8][3])
Make sure box orientation is consistent with standard arrangement.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
Rotate in local frame. Does optimised version of MultRight.
void SetScale(Double_t sx, Double_t sy, Double_t sz)
Set scaling.
void SetPos(Double_t x, Double_t y, Double_t z)
Set position (base-vec 4).
static void ColorFromIdx(Color_t ci, UChar_t col[4], Bool_t alpha=kTRUE)
Fill col with RGBA values corresponding to index ci.
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
void BBoxInit(Float_t infinity=1e6)
Allocate and prepare for incremental filling.
This is the base class for the ROOT Random number generators.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
ROOT::RLogChannel & REveLog()
Log channel for Eve diagnostics.
REveVectorT< Float_t > REveVector
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Bool_t next()
Go to next atom.