20 #include "TEveProjectionManager.h"
21 #include "TEveTrans.h"
22 #include "TGLBoundingBox.h"
24 #include "TGLIncludes.h"
26 #include "TGLRnrCtx.h"
28 #include "TGLCamera.h"
34 return FWEveTextProjected::Class();
44 TEveTrans *tr = als.PtrMainTrans(kFALSE);
46 fText = als.GetText();
47 *fMainColorPtr = als.GetMainColor();
51 TEveProjection&
proj = * fManager->GetProjection();
52 proj.ProjectPoint(pos[0],pos[1], pos[2], fDepth);
54 RefMainTrans().SetPos(pos[0], pos[1], pos[2] + als.
m_offsetZ);
62 Int_t fm = fM->GetFontMode();
63 if (fm == TGLFont::kBitmap || fm == TGLFont::kPixmap || fm == TGLFont::kTexture)
64 rnrCtx.RegisterFont(fM->GetFontSize(), fM->GetFontFile(), fM->GetFontMode(), fFont);
66 rnrCtx.RegisterFontNoScale(fM->GetFontSize(), fM->GetFontFile(), fM->GetFontMode(), fFont);
71 fFont.PreRender(fM->GetAutoLighting(), fM->GetLighting());
74 const GLdouble *pm = rnrCtx.RefCamera().RefLastNoPickProjM().CArr();
78 glGetDoublev(GL_MODELVIEW_MATRIX, mm);
79 glGetIntegerv(GL_VIEWPORT, vp);
81 fX[0][0] = fX[0][1] = fX[0][2] = 0;
83 gluProject(fX[0][0], fX[0][1], fX[0][2], mm, pm, vp, &x, &y, &z);
85 fFont.BBox(fM->GetText(), bbox[0], bbox[1], bbox[2],
86 bbox[3], bbox[4], bbox[5]);
89 gluUnProject(x + bbox[0], y + bbox[1], z, mm, pm, vp, &fX[0][0], &fX[0][1], &fX[0][2]);
90 gluUnProject(x + bbox[3], y + bbox[1], z, mm, pm, vp, &fX[1][0], &fX[1][1], &fX[1][2]);
91 gluUnProject(x + bbox[3], y + bbox[4], z, mm, pm, vp, &fX[2][0], &fX[2][1], &fX[2][2]);
92 gluUnProject(x + bbox[0], y + bbox[4], z, mm, pm, vp, &fX[3][0], &fX[3][1], &fX[3][2]);
93 glEnable(GL_POLYGON_OFFSET_FILL);
103 if (rnrCtx.ColorSet().Background().GetRed())
104 TGLUtil::Color(kWhite);
106 TGLUtil::Color(kBlack);
108 glPolygonOffset(1,1 );
117 TGLUtil::Color(fM->GetMainColor());
119 glPolygonOffset(0, 0 );
120 glBegin(GL_LINE_LOOP);
128 glPolygonOffset(0, 0 );
130 glRasterPos3i(0, 0, 0);
131 fFont.Render(fM->GetText());
virtual void UpdateProjection()
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
virtual TClass * ProjectedClass(const TEveProjection *p) const