Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:10

0001 #include "TGLIncludes.h"
0002 #include "Fireworks/Core/src/FWEveDigitSetScalableMarker.h"
0003 
0004 void FWEveDigitSetScalableMarkerGL::DirectDraw(TGLRnrCtx& rnrCtx) const {
0005   glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_POINT_BIT);
0006   glEnable(GL_POINT_SMOOTH);
0007   glDisable(GL_LIGHTING);
0008 
0009   TEveChunkManager::iterator qi(fM->GetPlex());
0010   if (rnrCtx.Highlight() && fHighlightSet)
0011     qi.fSelection = fHighlightSet;
0012 
0013   if (rnrCtx.SecSelection())
0014     glPushName(0);
0015 
0016   glPointSize(((FWEveDigitSetScalableMarker*)fM)->GetMarkerSize());
0017   while (qi.next()) {
0018     TEveQuadSet::QFreeQuad_t* q = (TEveQuadSet::QFreeQuad_t*)qi();
0019     if (q->fValue < 0)
0020       continue;
0021     TGLUtil::ColorAlpha(Color_t(q->fValue));
0022     if (rnrCtx.SecSelection())
0023       glLoadName(qi.index());
0024     float* p = &q->fVertices[0];
0025     glBegin(GL_LINES);
0026     float c[3] = {0.5f * (p[0] + p[6]), 0.5f * (p[1] + p[7]), 0.5f * (p[2] + p[8])};
0027 
0028     float d = p[6] - p[0];
0029     glVertex3f(c[0] - d, c[1], c[2]);
0030     glVertex3f(c[0] + d, c[1], c[2]);
0031     glVertex3f(c[0], c[1] - d, c[2]);
0032     glVertex3f(c[0], c[1] + d, c[2]);
0033     glVertex3f(c[0], c[1], c[2] - d);
0034     glVertex3f(c[0], c[1], c[2] + d);
0035 
0036     glEnd();
0037 
0038     glBegin(GL_POINTS);
0039     glVertex3fv(&c[0]);
0040     glEnd();
0041   }
0042 
0043   glPopAttrib();
0044 }