#ifndef MIQ_GL_UTILS #define MIQ_GL_UTILS //#include #include "vertex_indexing.h" #include "quadrangulator.h" class Miq_Gl_Utils { public: template static void GLDrawVertexIndexing(VertexIndexingType &VI) { typedef typename VertexIndexingType::ScalarType ScalarType; glPushAttrib(GL_ALL_ATTRIB_BITS); glEnable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); glDepthRange(0,0.999); typename VertexIndexingType::ScalarType size=5; glPointSize(size); vcg::glColor(vcg::Color4b(0,255,0,255)); glBegin(GL_POINTS); for (unsigned int i=0;iIsD()); vcg::glVertex(VI.duplicated[i]->P()); } glEnd(); glPopAttrib(); } template static void DrawFlippedFacesIfSelected(MeshType &Tmesh) { glPushAttrib(GL_ALL_ATTRIB_BITS); glDisable(GL_LIGHTING); glLineWidth(1.5); glDepthRange(0,0.998); vcg::glColor(vcg::Color4b(255,0,0,255)); glBegin(GL_LINES); for (unsigned int i=0;i static void QuadGLDrawIntegerVertices(QuadrangulatorType &Quadr) { glPushAttrib(GL_ALL_ATTRIB_BITS); glDisable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glDisable(GL_TEXTURE_2D); glPointSize(8); glDepthRange(0,0.997); /*glColor3d(1,0,0);*/ glBegin(GL_POINTS); for (int i=0;iP(); if (v->IsV()) glColor3d(1,0,0); else glColor3d(1,1,0); glVertex(pos); } glEnd(); glPopAttrib(); } template static void GLDrawIntegerLines(QuadrangulatorType &Quadr) { glPushAttrib(GL_ALL_ATTRIB_BITS); glDisable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glDisable(GL_TEXTURE_2D); glLineWidth(2); glColor3d(0,1,0); glDepthRange(0,0.998); for (int i=0;iV0(edge); typename QuadrangulatorType::TriVertexType* v1=f->V1(edge); glBegin(GL_LINES); glVertex(v0->P()); glVertex(v1->P()); glEnd(); } glPopAttrib(); } template static void GLDrawPolygons(QuadrangulatorType &Quadr) { glPushAttrib(GL_ALL_ATTRIB_BITS); glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glDisable(GL_TEXTURE_2D); glColor3d(0.7,0.8,0.9); //glFrontFace(GL_CW); glDepthRange(0,0.998); for (unsigned int i=0;iN()); glVertex(v->P()); } glEnd(); } glDepthRange(0,0.997); glDisable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glColor3d(0,0,0); for (unsigned int i=0;iP()); } glEnd(); } glPopAttrib(); } }; #endif