16#include "TGLIncludes.h"
41 fM = SetModelDynCast<TEveBox>(obj);
63 Float_t d = sqrtf(o[0]*o[0] + o[1]*o[1] + o[2]*o[2]);
81 glVertex3fv(
p[0]); glVertex3fv(
p[1]);
82 glVertex3fv(
p[5]); glVertex3fv(
p[6]);
83 glVertex3fv(
p[2]); glVertex3fv(
p[3]);
84 glVertex3fv(
p[7]); glVertex3fv(
p[4]);
85 glVertex3fv(
p[0]); glVertex3fv(
p[3]);
89 glVertex3fv(
p[1]); glVertex3fv(
p[2]);
90 glVertex3fv(
p[4]); glVertex3fv(
p[5]);
91 glVertex3fv(
p[6]); glVertex3fv(
p[7]);
103 glNormal3f(0, 0, -1);
104 glVertex3fv(
p[0]); glVertex3fv(
p[1]);
105 glVertex3fv(
p[2]); glVertex3fv(
p[3]);
108 glVertex3fv(
p[7]); glVertex3fv(
p[6]);
109 glVertex3fv(
p[5]); glVertex3fv(
p[4]);
112 glVertex3fv(
p[0]); glVertex3fv(
p[4]);
113 glVertex3fv(
p[5]); glVertex3fv(
p[1]);
115 glNormal3f(0, -1, 0);
116 glVertex3fv(
p[3]); glVertex3fv(
p[2]);
117 glVertex3fv(
p[6]); glVertex3fv(
p[7]);
119 glNormal3f(-1, 0, 0);
120 glVertex3fv(
p[0]); glVertex3fv(
p[3]);
121 glVertex3fv(
p[7]); glVertex3fv(
p[4]);
124 glVertex3fv(
p[1]); glVertex3fv(
p[5]);
125 glVertex3fv(
p[6]); glVertex3fv(
p[2]);
136 subtract_and_normalize(
p[1],
p[0],
e[0]);
137 subtract_and_normalize(
p[3],
p[0],
e[1]);
138 subtract_and_normalize(
p[4],
p[0],
e[2]);
139 subtract_and_normalize(
p[5],
p[6],
e[3]);
140 subtract_and_normalize(
p[7],
p[6],
e[4]);
141 subtract_and_normalize(
p[2],
p[6],
e[5]);
147 glVertex3fv(
p[0]); glVertex3fv(
p[1]);
148 glVertex3fv(
p[2]); glVertex3fv(
p[3]);
151 glVertex3fv(
p[7]); glVertex3fv(
p[6]);
152 glVertex3fv(
p[5]); glVertex3fv(
p[4]);
155 glVertex3fv(
p[0]); glVertex3fv(
p[4]);
156 glVertex3fv(
p[5]); glVertex3fv(
p[1]);
159 glVertex3fv(
p[3]); glVertex3fv(
p[2]);
160 glVertex3fv(
p[6]); glVertex3fv(
p[7]);
163 glVertex3fv(
p[0]); glVertex3fv(
p[3]);
164 glVertex3fv(
p[7]); glVertex3fv(
p[4]);
167 glVertex3fv(
p[1]); glVertex3fv(
p[5]);
168 glVertex3fv(
p[6]); glVertex3fv(
p[2]);
207 glPushAttrib(GL_ENABLE_BIT);
209 glEnable(GL_POLYGON_OFFSET_FILL);
210 glPolygonOffset(1.0f, 1.0f);
212 glDisable(GL_POLYGON_OFFSET_FILL);
248 fM = SetModelDynCast<TEveBoxProjected>(obj);
271 for (
Int_t i = 0; i < B; ++i)
278 for (
Int_t i = B; i <
N; ++i)
294 glTranslatef(0.0f, 0.0f,
fM->
fDepth);
317 for (
Int_t i = 0; i <
N; ++i)
334 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
336 glDisable(GL_LIGHTING);
338 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
339 glEnable(GL_COLOR_MATERIAL);
340 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
341 glDisable(GL_CULL_FACE);
343 glEnable(GL_POLYGON_OFFSET_FILL);
344 glPolygonOffset(1.0f, 1.0f);
346 glDisable(GL_POLYGON_OFFSET_FILL);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char mode
OpenGL renderer class for TEveBox.
void RenderBoxAutoNorm(const Float_t p[8][3]) const
Render box, calculate normals on the fly from first three points.
void RenderOutline(const Float_t p[8][3]) const
Render box with without normals.
void RenderBoxStdNorm(const Float_t p[8][3]) const
Render box with standard axis-aligned normals.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL, create display-list.
void Draw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void SetBBox() override
Set bounding box.
OpenGL renderer class for TEveBoxProjected.
void SetBBox() override
Set bounding box.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL, create display-list.
TEveBoxProjectedGL()
Constructor.
void Draw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void RenderPoints(Int_t mode) const
Render points with given GL mode.
static Bool_t fgDebugCornerPoints
3D box with arbitrary vertices (cuboid).
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
TObject * fExternalObj
first replica
Base-class for direct OpenGL renderers.
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t IsDrawPassOutlineLine() const
static void Color(const TGLColor &color)
Set color from TGLColor.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Mother of all ROOT objects.
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculates the Cross Product of two vectors: out = [v1 x v2].