From 3627a7ccfd875c599f36dd7279a55c2eff4ab59d Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Mon, 14 Sep 2015 12:05:03 +0000 Subject: [PATCH] minor changes --- wrap/gl/gl_field.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/wrap/gl/gl_field.h b/wrap/gl/gl_field.h index 48dde889..1cd53f9c 100644 --- a/wrap/gl/gl_field.h +++ b/wrap/gl/gl_field.h @@ -13,6 +13,8 @@ class GLField typedef typename MeshType::CoordType CoordType; typedef typename MeshType::ScalarType ScalarType; +public: + static void GLDrawField(CoordType dir[4], CoordType center, ScalarType &size, @@ -24,7 +26,8 @@ class GLField if (oneside)size2=0; glLineWidth(2); - vcg::glColor(vcg::Color4b(0,0,255,255)); + //vcg::glColor(vcg::Color4b(0,0,255,255)); + vcg::glColor(vcg::Color4b(0,0,0,255)); glBegin(GL_LINES); glVertex(center+dir[0]*size1); glVertex(center-dir[0]*size2); @@ -32,7 +35,8 @@ class GLField if (onlyPD1)return; glLineWidth(2); - vcg::glColor(vcg::Color4b(0,255,0,255)); + //vcg::glColor(vcg::Color4b(0,255,0,255)); + vcg::glColor(vcg::Color4b(0,0,0,255)); glBegin(GL_LINES); glVertex(center+dir[1]*size1); glVertex(center-dir[1]*size2); @@ -40,9 +44,22 @@ class GLField } + ///draw the cross field of a given face in a given position + static void GLDrawSingleFaceField(const FaceType &f, + CoordType pos, + ScalarType &size, + bool onlyPD1=false, + bool oneside=false) + { + CoordType center=pos; + CoordType normal=f.cN(); + CoordType dir[4]; + vcg::tri::CrossField::CrossVector(f,dir); + GLDrawField(dir,center,size,onlyPD1,oneside); + } ///draw the cross field of a given face - static void GLDrawFaceField(const FaceType &f, + static void GLDrawSingleFaceField(const FaceType &f, ScalarType &size, bool onlyPD1=false, bool oneside=false) @@ -81,8 +98,6 @@ class GLField GLDrawField(dir,center,size); } -public: - static void GLDrawFaceField(const MeshType &mesh, bool onlyPD1=false, @@ -99,7 +114,7 @@ public: for (unsigned int i=0;i