40 fM = SetModelDynCast<TEveQuadSet>(obj);
73 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
74 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
75 glEnable(GL_COLOR_MATERIAL);
76 glDisable(GL_CULL_FACE);
81 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
83 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
103 static const TEveException eH(
"TEveQuadSetGL::RenderQuads ");
107 GLenum primitiveType;
110 primitiveType = GL_QUADS;
112 glEnable(GL_NORMALIZE);
116 primitiveType = GL_LINE_LOOP;
129 Float_t e1[3], e2[3], normal[3];
135 e1[0] = p[3] - p[0]; e1[1] = p[4] - p[1]; e1[2] = p[5] - p[2];
136 e2[0] = p[6] - p[0]; e2[1] = p[7] - p[1]; e2[2] = p[8] - p[2];
139 glBegin(primitiveType);
147 AntiFlick(0.5f*(p[0]+p[6]), 0.5f*(p[1]+p[7]), 0.5f*(p[2]+p[8]));
160 glBegin(primitiveType);
161 glVertex3f(
q.fA,
q.fB,
q.fC);
162 glVertex3f(
q.fA +
q.fW,
q.fB,
q.fC);
163 glVertex3f(
q.fA +
q.fW,
q.fB +
q.fH,
q.fC);
164 glVertex3f(
q.fA,
q.fB +
q.fH,
q.fC);
167 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH,
q.fC);
180 glBegin(primitiveType);
181 glVertex3f(
q.fA,
q.fC,
q.fB);
182 glVertex3f(
q.fA +
q.fW,
q.fC,
q.fB);
183 glVertex3f(
q.fA +
q.fW,
q.fC,
q.fB +
q.fH);
184 glVertex3f(
q.fA,
q.fC,
q.fB +
q.fH);
187 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fC,
q.fB + 0.5f*
q.fH);
200 glBegin(primitiveType);
201 glVertex3f(
q.fC,
q.fA,
q.fB);
202 glVertex3f(
q.fC,
q.fA +
q.fW,
q.fB);
203 glVertex3f(
q.fC,
q.fA +
q.fW,
q.fB +
q.fH);
204 glVertex3f(
q.fC,
q.fA,
q.fB +
q.fH);
207 AntiFlick(
q.fC,
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH);
222 glBegin(primitiveType);
223 glVertex3f(
q.fA,
q.fB,
q.fC);
224 glVertex3f(
q.fA + w,
q.fB,
q.fC);
225 glVertex3f(
q.fA + w,
q.fB +
h,
q.fC);
226 glVertex3f(
q.fA,
q.fB +
h,
q.fC);
230 AntiFlick(
q.fA + 0.5f*w,
q.fB + 0.5f*
h,
q.fC);
244 glBegin(primitiveType);
245 glVertex3f(
q.fA,
q.fB, z);
246 glVertex3f(
q.fA +
q.fW,
q.fB, z);
247 glVertex3f(
q.fA +
q.fW,
q.fB +
q.fH, z);
248 glVertex3f(
q.fA,
q.fB +
q.fH, z);
251 AntiFlick(
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH, z);
265 glBegin(primitiveType);
266 glVertex3f(
q.fA,
y,
q.fB);
267 glVertex3f(
q.fA +
q.fW,
y,
q.fB);
268 glVertex3f(
q.fA +
q.fW,
y,
q.fB +
q.fH);
269 glVertex3f(
q.fA,
y,
q.fB +
q.fH);
272 AntiFlick(
q.fA + 0.5f*
q.fW,
y,
q.fB + 0.5f*
q.fH);
286 glBegin(primitiveType);
287 glVertex3f(
x,
q.fA,
q.fB);
288 glVertex3f(
x,
q.fA +
q.fW,
q.fB);
289 glVertex3f(
x,
q.fA +
q.fW,
q.fB +
q.fH);
290 glVertex3f(
x,
q.fA,
q.fB +
q.fH);
293 AntiFlick(
x,
q.fA + 0.5f*
q.fW,
q.fB + 0.5f*
q.fH);
309 glBegin(primitiveType);
310 glVertex3f(
q.fA,
q.fB, z);
311 glVertex3f(
q.fA + w,
q.fB, z);
312 glVertex3f(
q.fA + w,
q.fB +
h, z);
313 glVertex3f(
q.fA,
q.fB +
h, z);
316 AntiFlick(
q.fA + 0.5f*w,
q.fB + 0.5f*
h, z);
332 glBegin(primitiveType);
333 glVertex3f(
q.fA,
y,
q.fB);
334 glVertex3f(
q.fA + w,
y,
q.fB);
335 glVertex3f(
q.fA + w,
y,
q.fB +
h);
336 glVertex3f(
q.fA,
y,
q.fB +
h);
339 AntiFlick(
q.fA + 0.5f*w,
y,
q.fB + 0.5f*
h);
355 glBegin(primitiveType);
356 glVertex3f(
x,
q.fA,
q.fB);
357 glVertex3f(
x,
q.fA + w,
q.fB);
358 glVertex3f(
x,
q.fA + w,
q.fB +
h);
359 glVertex3f(
x,
q.fA,
q.fB +
h);
362 AntiFlick(
x,
q.fA + 0.5f*w,
q.fB + 0.5f*
h);
369 throw(eH +
"unsupported quad-type.");
381 static const TEveException eH(
"TEveQuadSetGL::RenderLines ");
403 glVertex3f(
q.fA,
q.fB, z);
404 glVertex3f(
q.fA +
q.fDx,
q.fB +
q.fDy, z);
420 glVertex3f(
q.fA, z,
q.fB);
421 glVertex3f(
q.fA +
q.fDx, z,
q.fB +
q.fDy);
429 throw(eH +
"unsupported quad-type.");
441 static const TEveException eH(
"TEveQuadSetGL::RenderHexagons ");
448 GL_POLYGON : GL_LINE_LOOP;
469 glBegin(primitveType);
470 glVertex3f(
q.fR +
q.fA,
q.fB,
q.fC);
471 glVertex3f( rh +
q.fA, rs +
q.fB,
q.fC);
472 glVertex3f( -rh +
q.fA, rs +
q.fB,
q.fC);
473 glVertex3f(-
q.fR +
q.fA,
q.fB,
q.fC);
474 glVertex3f( -rh +
q.fA, -rs +
q.fB,
q.fC);
475 glVertex3f( rh +
q.fA, -rs +
q.fB,
q.fC);
478 AntiFlick(
q.fA,
q.fB,
q.fC);
493 glBegin(primitveType);
494 glVertex3f( rs +
q.fA, rh +
q.fB,
q.fC);
495 glVertex3f(
q.fA,
q.fR +
q.fB,
q.fC);
496 glVertex3f(-rs +
q.fA, rh +
q.fB,
q.fC);
497 glVertex3f(-rs +
q.fA, -rh +
q.fB,
q.fC);
498 glVertex3f(
q.fA, -
q.fR +
q.fB,
q.fC);
499 glVertex3f( rs +
q.fA, -rh +
q.fB,
q.fC);
502 AntiFlick(
q.fA,
q.fB,
q.fC);
509 throw(eH +
"unsupported quad-type.");
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.
GL-renderer for TEveQuadSet class.
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
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.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Draw quad-set with GL.
Supports various internal formats that result in rendering of a set of planar (lines,...
@ kQT_RectangleXZFixedDimY
@ kQT_RectangleXYFixedDim
@ kQT_RectangleXYFixedDimZ
@ kQT_RectangleYZFixedDimX
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)
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculate the Cross Product of two vectors: out = [v1 x v2].
Bool_t next()
Go to next atom.
const std::set< Int_t > * fSelection