16#include "TGLIncludes.h"
62 Float_t d = sqrtf(o[0]*o[0] + o[1]*o[1] + o[2]*o[2]);
79 glBegin(GL_LINE_STRIP);
80 glVertex3fv(p[0]); glVertex3fv(p[1]);
81 glVertex3fv(p[5]); glVertex3fv(p[6]);
82 glVertex3fv(p[2]); glVertex3fv(p[3]);
83 glVertex3fv(p[7]); glVertex3fv(p[4]);
84 glVertex3fv(p[0]); glVertex3fv(p[3]);
88 glVertex3fv(p[1]); glVertex3fv(p[2]);
89 glVertex3fv(p[4]); glVertex3fv(p[5]);
90 glVertex3fv(p[6]); glVertex3fv(p[7]);
102 glNormal3f(0, 0, -1);
103 glVertex3fv(p[0]); glVertex3fv(p[1]);
104 glVertex3fv(p[2]); glVertex3fv(p[3]);
107 glVertex3fv(p[7]); glVertex3fv(p[6]);
108 glVertex3fv(p[5]); glVertex3fv(p[4]);
111 glVertex3fv(p[0]); glVertex3fv(p[4]);
112 glVertex3fv(p[5]); glVertex3fv(p[1]);
114 glNormal3f(0, -1, 0);
115 glVertex3fv(p[3]); glVertex3fv(p[2]);
116 glVertex3fv(p[6]); glVertex3fv(p[7]);
118 glNormal3f(-1, 0, 0);
119 glVertex3fv(p[0]); glVertex3fv(p[3]);
120 glVertex3fv(p[7]); glVertex3fv(p[4]);
123 glVertex3fv(p[1]); glVertex3fv(p[5]);
124 glVertex3fv(p[6]); glVertex3fv(p[2]);
135 subtract_and_normalize(p[1], p[0],
e[0]);
136 subtract_and_normalize(p[3], p[0],
e[1]);
137 subtract_and_normalize(p[4], p[0],
e[2]);
138 subtract_and_normalize(p[5], p[6],
e[3]);
139 subtract_and_normalize(p[7], p[6],
e[4]);
140 subtract_and_normalize(p[2], p[6],
e[5]);
146 glVertex3fv(p[0]); glVertex3fv(p[1]);
147 glVertex3fv(p[2]); glVertex3fv(p[3]);
150 glVertex3fv(p[7]); glVertex3fv(p[6]);
151 glVertex3fv(p[5]); glVertex3fv(p[4]);
154 glVertex3fv(p[0]); glVertex3fv(p[4]);
155 glVertex3fv(p[5]); glVertex3fv(p[1]);
158 glVertex3fv(p[3]); glVertex3fv(p[2]);
159 glVertex3fv(p[6]); glVertex3fv(p[7]);
162 glVertex3fv(p[0]); glVertex3fv(p[3]);
163 glVertex3fv(p[7]); glVertex3fv(p[4]);
166 glVertex3fv(p[1]); glVertex3fv(p[5]);
167 glVertex3fv(p[6]); glVertex3fv(p[2]);
206 glPushAttrib(GL_ENABLE_BIT);
208 glEnable(GL_POLYGON_OFFSET_FILL);
209 glPolygonOffset(1.0f, 1.0f);
211 glDisable(GL_POLYGON_OFFSET_FILL);
269 for (
Int_t i = 0; i < B; ++i)
271 glVertex2fv(
fM->fPoints[i]);
276 for (
Int_t i = B; i <
N; ++i)
278 glVertex2fv(
fM->fPoints[i]);
292 glTranslatef(0.0f, 0.0f,
fM->fDepth);
315 for (
Int_t i = 0; i <
N; ++i)
317 glVertex2fv(
fM->fDebugPoints[i]);
332 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
334 glDisable(GL_LIGHTING);
336 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
337 glEnable(GL_COLOR_MATERIAL);
338 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
339 glDisable(GL_CULL_FACE);
341 glEnable(GL_POLYGON_OFFSET_FILL);
342 glPolygonOffset(1.0f, 1.0f);
344 glDisable(GL_POLYGON_OFFSET_FILL);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
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.
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
! Also plays the role of ID.
TT * SetModelDynCast(TObject *obj)
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].