From a4ee21d5d7a7e1b98acf2e21dc67220561dd11c8 Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Mon, 3 Sep 2012 15:58:38 +0000 Subject: [PATCH] added GLDrawSeams function --- wrap/gl/gl_field.h | 68 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/wrap/gl/gl_field.h b/wrap/gl/gl_field.h index a5fad6e9..2cb5b586 100644 --- a/wrap/gl/gl_field.h +++ b/wrap/gl/gl_field.h @@ -4,25 +4,34 @@ class GLField { typedef typename MeshType::FaceType FaceType; typedef typename MeshType::VertexType VertexType; + typedef typename MeshType::CoordType CoordType; typedef typename MeshType::ScalarType ScalarType; static void GLDrawField(CoordType dir[4], CoordType center, ScalarType &size) { - glLineWidth(1); - vcg::Color4b c; - vcg::glColor(vcg::Color4b(0,0,0,255)); + + glLineWidth(3); + vcg::glColor(vcg::Color4b(0,0,255,255)); + glBegin(GL_LINES); + glVertex(center); + glVertex(center+dir[0]*size); + glEnd(); + + glLineWidth(1); + vcg::glColor(vcg::Color4b(0,0,0,255)); glBegin(GL_LINES); - for (int i=0;i<4;i++) - { - glVertex(center); - glVertex(center+dir[i]*size); + for (int i=1;i<4;i++) + { + glVertex(center); + glVertex(center+dir[i]*size); } glEnd(); } + ///draw the cross field of a given face static void GLDrawFaceField(const MeshType &mesh, const FaceType &f, @@ -35,6 +44,21 @@ class GLField GLDrawField(dir,center,size); } + static void GLDrawFaceSeams(const FaceType &f) + { + glLineWidth(3); + + glBegin(GL_LINES); + for (int i=0;i<3;i++) + { + if (!f.IsSeam(i))continue; + + glVertex(f.V0(i)->P()); + glVertex(f.V1(i)->P()); + } + glEnd(); + } + static void GLDrawVertField(const MeshType &mesh, const VertexType &v, ScalarType &size) @@ -55,7 +79,7 @@ public: glEnable(GL_COLOR_MATERIAL); glDisable(GL_LIGHTING); glDepthRange(0,0.999); - MyScalarType size=10; + ScalarType size=10; glPointSize(size); glBegin(GL_POINTS); for (int i=0;i