19#include "TGLIncludes.h"
42 fM = SetModelDynCast<TEvePolygonSetProjected>(obj);
77 std::map<Edge_t, Int_t> edges;
82 for(
Int_t k = 0; k < i->fNPnts - 1; ++k)
84 ++edges[
Edge_t(i->fPnts[k], i->fPnts[k+1])];
86 ++edges[
Edge_t(i->fPnts[0], i->fPnts[i->fNPnts - 1])];
90 for (std::map<Edge_t, Int_t>::iterator i = edges.begin(); i != edges.end(); ++i)
108 for(
Int_t k = 0; k < i->fNPnts; ++k)
124 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
126 glDisable(GL_LIGHTING);
127 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
128 glEnable(GL_COLOR_MATERIAL);
129 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
130 glDisable(GL_CULL_FACE);
136 glEnable(GL_POLYGON_OFFSET_FILL);
137 glPolygonOffset(1, 1);
145 Int_t pntsN = (*i).fNPnts;
149 for (
Int_t k = 0; k < pntsN; ++k)
152 glVertex3fv(pnts[vi].Arr());
163 for (
Int_t k = 0; k < pntsN; ++k)
166 coords[0] = pnts[vi].
fX;
167 coords[1] = pnts[vi].
fY;
173 glDisable(GL_POLYGON_OFFSET_FILL);
179 glEnable(GL_LINE_SMOOTH);
void gluNextContour(GLUtesselator *tess, GLenum type)
void gluBeginPolygon(GLUtesselator *tess)
void gluEndPolygon(GLUtesselator *tess)
void gluTessVertex(GLUtesselator *tess, GLdouble *location, GLvoid *data)
GL-renderer for TEvePolygonSetProjected class.
void DrawOutline() const
Draw polygons outline.
void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *pshp, Int_t lvl=-1) const override
Draw polygons in highlight mode.
void SetBBox() override
Setup bounding-box information.
void Draw(TGLRnrCtx &rnrCtx) const override
Draw function for TEvePolygonSetProjectedGL.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Do GL rendering.
TEvePolygonSetProjected * fM
TEvePolygonSetProjectedGL()
Constructor.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
vpPolygon_t::const_iterator vpPolygon_ci
virtual Bool_t GetMiniFrame() const
virtual Bool_t GetHighlightFrame() const
TGLColor & Selection(Int_t i)
const UChar_t * CArr() const
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw the GL drawable, using draw flags.
Base-class for direct OpenGL renderers.
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
Concrete physical shape - a GL drawable.
UChar_t GetSelected() const
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Bool_t IsDrawPassOutlineLine() const
static UInt_t LockColor()
Prevent further color changes.
static UInt_t UnlockColor()
Allow color changes.
static void Color(const TGLColor &color)
Set color from TGLColor.
static GLUtesselator * GetDrawTesselator3fv()
Returns a tesselator for direct drawing when using 3-vertices with single precision.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Mother of all ROOT objects.