17#include "TGLIncludes.h"
72 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
73 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
74 glEnable(GL_COLOR_MATERIAL);
75 glDisable(GL_CULL_FACE);
80 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
82 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
102 static const TEveException eH(
"TEveQuadSetGL::RenderQuads ");
106 GLenum primitiveType;
109 primitiveType = GL_QUADS;
111 glEnable(GL_NORMALIZE);
115 primitiveType = GL_LINE_LOOP;
128 Float_t e1[3], e2[3], normal[3];
134 e1[0] = p[3] - p[0]; e1[1] = p[4] - p[1]; e1[2] = p[5] - p[2];
135 e2[0] = p[6] - p[0]; e2[1] = p[7] - p[1]; e2[2] = p[8] - p[2];
138 glBegin(primitiveType);
146 AntiFlick(0.5f*(p[0]+p[6]), 0.5f*(p[1]+p[7]), 0.5f*(p[2]+p[8]));
159 glBegin(primitiveType);
160 glVertex3f(
q.fA,
q.fB,
q.fC);
161 glVertex3f(
q.fA +
q.fW,
q.fB,
q.fC);
162 glVertex3f(
q.fA +
q.fW,
q.fB +
q.fH,
q.fC);
163 glVertex3f(
q.fA,
q.fB +
q.fH,
q.fC);
166 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH,
q.fC);
179 glBegin(primitiveType);
180 glVertex3f(
q.fA,
q.fC,
q.fB);
181 glVertex3f(
q.fA +
q.fW,
q.fC,
q.fB);
182 glVertex3f(
q.fA +
q.fW,
q.fC,
q.fB +
q.fH);
183 glVertex3f(
q.fA,
q.fC,
q.fB +
q.fH);
186 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fC,
q.fB + 0.5f*
q.fH);
199 glBegin(primitiveType);
200 glVertex3f(
q.fC,
q.fA,
q.fB);
201 glVertex3f(
q.fC,
q.fA +
q.fW,
q.fB);
202 glVertex3f(
q.fC,
q.fA +
q.fW,
q.fB +
q.fH);
203 glVertex3f(
q.fC,
q.fA,
q.fB +
q.fH);
206 AntiFlick(
q.fC,
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH);
221 glBegin(primitiveType);
222 glVertex3f(
q.fA,
q.fB,
q.fC);
223 glVertex3f(
q.fA + w,
q.fB,
q.fC);
224 glVertex3f(
q.fA + w,
q.fB +
h,
q.fC);
225 glVertex3f(
q.fA,
q.fB +
h,
q.fC);
229 AntiFlick(
q.fA + 0.5f*w,
q.fB + 0.5f*
h,
q.fC);
243 glBegin(primitiveType);
244 glVertex3f(
q.fA,
q.fB, z);
245 glVertex3f(
q.fA +
q.fW,
q.fB, z);
246 glVertex3f(
q.fA +
q.fW,
q.fB +
q.fH, z);
247 glVertex3f(
q.fA,
q.fB +
q.fH, z);
250 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH, z);
264 glBegin(primitiveType);
265 glVertex3f(
q.fA,
y,
q.fB);
266 glVertex3f(
q.fA +
q.fW,
y,
q.fB);
267 glVertex3f(
q.fA +
q.fW,
y,
q.fB +
q.fH);
268 glVertex3f(
q.fA,
y,
q.fB +
q.fH);
271 AntiFlick(
q.fA + 0.5f*
q.fW,
y,
q.fB + 0.5f*
q.fH);
285 glBegin(primitiveType);
286 glVertex3f(
x,
q.fA,
q.fB);
287 glVertex3f(
x,
q.fA +
q.fW,
q.fB);
288 glVertex3f(
x,
q.fA +
q.fW,
q.fB +
q.fH);
289 glVertex3f(
x,
q.fA,
q.fB +
q.fH);
292 AntiFlick(
x,
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH);
308 glBegin(primitiveType);
309 glVertex3f(
q.fA,
q.fB, z);
310 glVertex3f(
q.fA + w,
q.fB, z);
311 glVertex3f(
q.fA + w,
q.fB +
h, z);
312 glVertex3f(
q.fA,
q.fB +
h, z);
315 AntiFlick(
q.fA + 0.5f*w,
q.fB + 0.5f*
h, z);
331 glBegin(primitiveType);
332 glVertex3f(
q.fA,
y,
q.fB);
333 glVertex3f(
q.fA + w,
y,
q.fB);
334 glVertex3f(
q.fA + w,
y,
q.fB +
h);
335 glVertex3f(
q.fA,
y,
q.fB +
h);
338 AntiFlick(
q.fA + 0.5f*w,
y,
q.fB + 0.5f*
h);
354 glBegin(primitiveType);
355 glVertex3f(
x,
q.fA,
q.fB);
356 glVertex3f(
x,
q.fA + w,
q.fB);
357 glVertex3f(
x,
q.fA + w,
q.fB +
h);
358 glVertex3f(
x,
q.fA,
q.fB +
h);
361 AntiFlick(
x,
q.fA + 0.5f*w,
q.fB + 0.5f*
h);
368 throw(eH +
"unsupported quad-type.");
380 static const TEveException eH(
"TEveQuadSetGL::RenderLines ");
402 glVertex3f(
q.fA,
q.fB, z);
403 glVertex3f(
q.fA +
q.fDx,
q.fB +
q.fDy, z);
419 glVertex3f(
q.fA, z,
q.fB);
420 glVertex3f(
q.fA +
q.fDx, z,
q.fB +
q.fDy);
428 throw(eH +
"unsupported quad-type.");
440 static const TEveException eH(
"TEveQuadSetGL::RenderHexagons ");
447 GL_POLYGON : GL_LINE_LOOP;
468 glBegin(primitveType);
469 glVertex3f(
q.fR +
q.fA,
q.fB,
q.fC);
470 glVertex3f( rh +
q.fA, rs +
q.fB,
q.fC);
471 glVertex3f( -rh +
q.fA, rs +
q.fB,
q.fC);
472 glVertex3f(-
q.fR +
q.fA,
q.fB,
q.fC);
473 glVertex3f( -rh +
q.fA, -rs +
q.fB,
q.fC);
474 glVertex3f( rh +
q.fA, -rs +
q.fB,
q.fC);
477 AntiFlick(
q.fA,
q.fB,
q.fC);
492 glBegin(primitveType);
493 glVertex3f( rs +
q.fA, rh +
q.fB,
q.fC);
494 glVertex3f(
q.fA,
q.fR +
q.fB,
q.fC);
495 glVertex3f(-rs +
q.fA, rh +
q.fB,
q.fC);
496 glVertex3f(-rs +
q.fA, -rh +
q.fB,
q.fC);
497 glVertex3f(
q.fA, -
q.fR +
q.fB,
q.fC);
498 glVertex3f( rs +
q.fA, -rh +
q.fB,
q.fC);
501 AntiFlick(
q.fA,
q.fB,
q.fC);
508 throw(eH +
"unsupported quad-type.");
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
const std::set< Int_t > * fHighlightSet
TEveDigitSetGL(const TEveDigitSetGL &)
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.
TEveQuadSetGL()
Constructor.
void RenderQuads(TGLRnrCtx &rnrCtx) const
GL rendering for free-quads and rectangles.
void RenderHexagons(TGLRnrCtx &rnrCtx) const
GL rendering for hexagons.
void RenderLines(TGLRnrCtx &rnrCtx) const
GL rendering for line-types.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Draw quad-set with GL.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
Supports various internal formats that result in rendering of a set of planar (lines,...
@ kQT_RectangleXZFixedDimY
@ kQT_RectangleXYFixedDim
@ kQT_RectangleXYFixedDimZ
@ kQT_RectangleYZFixedDimX
TT * SetModelDynCast(TObject *obj)
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)
Returns the square root of x.
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculates the Cross Product of two vectors: out = [v1 x v2].
Bool_t next()
Go to next atom.
const std::set< Int_t > * fSelection