CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWEveDigitSetScalableMarker.cc
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWMarkerDigitSetGL_h
2 #define Fireworks_Core_FWMarkerDigitSetGL_h
3 
4 #include "TEveQuadSet.h"
5 #include "TEveQuadSetGL.h"
6 #include "TGLIncludes.h"
7 #include "TGLRnrCtx.h"
8 #include "TAttMarker.h"
9 
10 class FWEveDigitSetScalableMarker : public TEveQuadSet, public TAttMarker
11 {
12 public:
15 
17 };
18 
19 //--------------------------------------------
20 class FWEveDigitSetScalableMarkerGL : public TEveQuadSetGL
21 {
22 public:
25 
26  virtual void DirectDraw(TGLRnrCtx & rnrCtx) const
27  {
28  glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_POINT_BIT);
29  glEnable(GL_POINT_SMOOTH);
30  glDisable(GL_LIGHTING);
31 
32  TEveChunkManager::iterator qi(fM->GetPlex());
33  if (rnrCtx.Highlight() && fHighlightSet)
34  qi.fSelection = fHighlightSet;
35 
36  if (rnrCtx.SecSelection()) glPushName(0);
37 
38  glPointSize(((FWEveDigitSetScalableMarker*)fM)->GetMarkerSize());
39  while (qi.next()) {
40  TEveQuadSet::QFreeQuad_t* q = (TEveQuadSet::QFreeQuad_t*) qi();
41  if (q->fValue < 0)
42  continue;
43  TGLUtil::ColorAlpha(Color_t(q->fValue));
44  if (rnrCtx.SecSelection()) glLoadName(qi.index());
45  float* p = &q->fVertices[0];
46  glBegin(GL_LINES);
47  float c[3] = {0.5f*(p[0]+p[6]), 0.5f*(p[1]+p[7]), 0.5f*(p[2]+p[8])};
48 
49  float d = p[6] - p[0];
50  glVertex3f( c[0] -d, c[1], c[2]); glVertex3f(c[0] + d, c[1], c[2]);
51  glVertex3f( c[0] , c[1] -d, c[2]); glVertex3f(c[0] , c[1] +d, c[2]);
52  glVertex3f( c[0] , c[1], c[2]-d); glVertex3f(c[0] , c[1], c[2] +d);
53 
54  glEnd();
55 
56  glBegin(GL_POINTS);
57  glVertex3fv(&c[0]);
58  glEnd();
59 
60  }
61 
62  glPopAttrib();
63  }
64 
66 };
67 
68 
69 #endif
ClassDef(FWEveDigitSetScalableMarkerGL, 0)
double f[11][100]
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
if(dp >Float(M_PI)) dp-
ClassDef(FWEveDigitSetScalableMarker, 0)