59 p[0][0] = 0; p[0][1] = dy; p[0][2] = 0;
60 p[1][0] = dx; p[1][1] = dy; p[1][2] = 0;
61 p[2][0] = dx; p[2][1] = 0; p[2][2] = 0;
62 p[3][0] = 0; p[3][1] = 0; p[3][2] = 0;
64 p[4][0] = 0; p[4][1] = dy; p[4][2] = dz;
65 p[5][0] = dx; p[5][1] = dy; p[5][2] = dz;
66 p[6][0] = dx; p[6][1] = 0; p[6][2] = dz;
67 p[7][0] = 0; p[7][1] = 0; p[7][2] = dz;
78 glVertex3fv(p[0]); glVertex3fv(p[1]);
79 glVertex3fv(p[2]); glVertex3fv(p[3]);
82 glVertex3fv(p[7]); glVertex3fv(p[6]);
83 glVertex3fv(p[5]); glVertex3fv(p[4]);
86 glVertex3fv(p[0]); glVertex3fv(p[4]);
87 glVertex3fv(p[5]); glVertex3fv(p[1]);
90 glVertex3fv(p[3]); glVertex3fv(p[2]);
91 glVertex3fv(p[6]); glVertex3fv(p[7]);
94 glVertex3fv(p[0]); glVertex3fv(p[3]);
95 glVertex3fv(p[7]); glVertex3fv(p[4]);
98 glVertex3fv(p[1]); glVertex3fv(p[5]);
99 glVertex3fv(p[6]); glVertex3fv(p[2]);
111 Float_t d = sqrtf(o[0]*o[0] + o[1]*o[1] + o[2]*o[2]);
127 subtract_and_normalize(p[1], p[0],
e[0]);
128 subtract_and_normalize(p[3], p[0],
e[1]);
129 subtract_and_normalize(p[4], p[0],
e[2]);
130 subtract_and_normalize(p[5], p[6],
e[3]);
131 subtract_and_normalize(p[7], p[6],
e[4]);
132 subtract_and_normalize(p[2], p[6],
e[5]);
136 glVertex3fv(p[0]); glVertex3fv(p[1]);
137 glVertex3fv(p[2]); glVertex3fv(p[3]);
140 glVertex3fv(p[7]); glVertex3fv(p[6]);
141 glVertex3fv(p[5]); glVertex3fv(p[4]);
144 glVertex3fv(p[0]); glVertex3fv(p[4]);
145 glVertex3fv(p[5]); glVertex3fv(p[1]);
148 glVertex3fv(p[3]); glVertex3fv(p[2]);
149 glVertex3fv(p[6]); glVertex3fv(p[7]);
152 glVertex3fv(p[0]); glVertex3fv(p[3]);
153 glVertex3fv(p[7]); glVertex3fv(p[4]);
156 glVertex3fv(p[1]); glVertex3fv(p[5]);
157 glVertex3fv(p[6]); glVertex3fv(p[2]);
176 glNewList(
fBoxDL, GL_COMPILE);
193 gluCylinder(quad.
Get(), 0, 1, 1, nt, 1);
198 glTranslatef(0, 0, 1);
199 gluDisk(quad.
Get(), 0, 1, nt, 1);
250 fM = SetModelDynCast<TEveBoxSet>(obj);
297 glBegin(primitiveType);
301 AntiFlick(0.5f*(
b.fVertices[0][0] +
b.fVertices[6][0]),
302 0.5f*(
b.fVertices[0][1] +
b.fVertices[6][1]),
303 0.5f*(
b.fVertices[0][2] +
b.fVertices[6][2]));
305 if (boxSkip) {
Int_t s = boxSkip;
while (
s--) bi.
next(); }
312 glEnable(GL_NORMALIZE);
320 glTranslatef(
b.fA,
b.fB,
b.fC);
321 glScalef (
b.fW,
b.fH,
b.fD);
324 AntiFlick(0.5f, 0.5f, 0.5f);
327 if (boxSkip) {
Int_t s = boxSkip;
while (
s--) bi.
next(); }
340 glTranslatef(
b.fA,
b.fB,
b.fC);
344 glTranslatef(-
b.fA, -
b.fB, -
b.fC);
346 if (boxSkip) {
Int_t s = boxSkip;
while (
s--) bi.
next(); }
353 using namespace TMath;
355 glEnable(GL_NORMALIZE);
367 glTranslatef(
b.fPos.fX,
b.fPos.fY,
b.fPos.fZ);
368 glRotatef(phi, 0, 0, 1);
369 glRotatef(90 - theta, 0, 1, 0);
370 glScalef (
b.fR,
b.fR,
h);
373 AntiFlick(0.0f, 0.0f, 0.5f);
376 if (boxSkip) {
Int_t s = boxSkip;
while (
s--) bi.
next(); }
383 using namespace TMath;
385 glEnable(GL_NORMALIZE);
397 glTranslatef(
b.fPos.fX,
b.fPos.fY,
b.fPos.fZ);
398 glRotatef(phi, 0, 0, 1);
399 glRotatef(90 - theta, 0, 1, 0);
400 glRotatef(
b.fAngle, 0, 0, 1);
401 glScalef (
b.fR,
b.fR2,
h);
404 AntiFlick(0.0f, 0.0f, 0.5f);
407 if (boxSkip) {
Int_t s = boxSkip;
while (
s--) bi.
next(); }
414 throw(eH +
"unsupported box-type.");
438 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
443 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
445 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
451 glDisable(GL_CULL_FACE);
A GL rendering class for TEveBoxSet.
TEveBoxSetGL()
Default constructor.
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Determines if display-list will be used for rendering.
virtual void DLCachePurge()
Called when display-lists need to be returned to the system.
void MakeDisplayList() const
Create a display-list for rendering a single box, based on the current box-type.
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
void RenderBoxAutoNorm(const Float_t p[8][3]) const
Render box, calculate normals on the fly from first three points.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Actual rendering code.
virtual void Render(TGLRnrCtx &rnrCtx)
Interface for direct rendering from classes that include TEveBoxSet as a member.
void RenderBoxes(TGLRnrCtx &rnrCtx) const
GL rendering for all box-types.
Int_t PrimitiveType() const
Return GL primitive used to render the boxes, based on the render-mode specified in the model object.
void MakeOriginBox(Float_t p[8][3], Float_t dx, Float_t dy, Float_t dz) const
Fill array p to represent a box (0,0,0) - (dx,dy,dz).
virtual ~TEveBoxSetGL()
Destructor.
virtual void DLCacheDrop()
Called when display lists have been destroyed externally and the internal display-list data needs to ...
void RenderBoxStdNorm(const Float_t p[8][3]) const
Render a box specified by points in array p with standard axis-aligned normals.
Collection of 3D primitives (fixed-size boxes, boxes of different sizes, or arbitrary sexto-epipeds,...
OpenGL renderer class for TEveDigitSet.
const std::set< Int_t > * fHighlightSet
void DrawFrameIfNeeded(TGLRnrCtx &rnrCtx) const
Make a decision if the frame should be drawn.
Bool_t SetupColor(const TEveDigitSet::DigitBase_t &q) const
Set color for rendering of the specified digit.
TEveRGBAPalette * fPalette
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
ERenderMode_e fRenderMode
Exception class thrown by TEve classes and macros.
virtual void DLCachePurge()
Purge all entries for all LODs for this drawable from the display list cache, returning the reserved ...
virtual void DLCacheDrop()
Drop all entries for all LODs for this drawable from the display list cache, WITHOUT returning the re...
void PurgeDLRange(UInt_t base, Int_t size) const
External object is a fake.
Bool_t fDLCache
display-list validity bit-field
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Decide if display-list should be used for this pass rendering, as determined by rnrCtx.
Wrapper class for GLU quadric shape drawing object.
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t SecSelection() const
Bool_t IsDrawPassOutlineLine() const
Mother of all ROOT objects.
Double_t Sqrt(Double_t x)
static constexpr double s
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Double_t ATan2(Double_t, Double_t)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculate the Cross Product of two vectors: out = [v1 x v2].
constexpr Double_t RadToDeg()
Conversion from radian to degree:
Bool_t next()
Go to next atom.
const std::set< Int_t > * fSelection