From 70b2cd1d254c1312b585dbb1ee4920069147a16e Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Sun, 18 Nov 2012 18:07:39 +0000 Subject: [PATCH] removed several functions and moved to the gl wrapper of mixed integer --- wrap/gl/gl_field.h | 163 ++++++++++++++++++++++++++------------------- 1 file changed, 93 insertions(+), 70 deletions(-) diff --git a/wrap/gl/gl_field.h b/wrap/gl/gl_field.h index 21ac8f8b..ec9bc9ed 100644 --- a/wrap/gl/gl_field.h +++ b/wrap/gl/gl_field.h @@ -47,28 +47,29 @@ class GLField static void GLDrawFaceField(const FaceType &f, ScalarType &size) { - CoordType center=(f.P0(0)+f.P0(1)+f.P0(2))/3; + CoordType center=(f.cP0(0)+f.cP0(1)+f.cP0(2))/3; CoordType normal=f.cN(); CoordType dir[4]; vcg::tri::CrossField::CrossVector(f,dir); GLDrawField(dir,center,size); } - static void GLDrawFaceSeams(const FaceType &f, - vcg::Point3 seams) - { - glLineWidth(3); +// static void GLDrawFaceSeams(const FaceType &f, +// vcg::Point3 seams, +// vcg::Color4b seamCol[3]) +// { +// glLineWidth(2); - glBegin(GL_LINES); - for (int i=0;i<3;i++) - { - if (!seams[i])continue; - - glVertex(f.V0(i)->P()); - glVertex(f.V1(i)->P()); - } - glEnd(); - } +// glBegin(GL_LINES); +// for (int i=0;i<3;i++) +// { +// if (!seams[i])continue; +// vcg::glColor(seamCol[i]); +// glVertex(f.V0(i)->P()); +// glVertex(f.V1(i)->P()); +// } +// glEnd(); +// } static void GLDrawVertField(const MeshType &mesh, const VertexType &v, @@ -83,49 +84,49 @@ class GLField public: - ///singular vertices should be selected - static void GLDrawSingularities(MeshType &mesh) - { - bool hasSingular = vcg::tri::HasPerVertexAttribute(mesh,std::string("Singular")); - bool hasSingularDegree = vcg::tri::HasPerVertexAttribute(mesh,std::string("SingularityDegree")); +// ///singular vertices should be selected +// static void GLDrawSingularities(MeshType &mesh) +// { +// bool hasSingular = vcg::tri::HasPerVertexAttribute(mesh,std::string("Singular")); +// bool hasSingularDegree = vcg::tri::HasPerVertexAttribute(mesh,std::string("SingularityDegree")); - if (!hasSingular)return; +// if (!hasSingular)return; - typename MeshType::template PerVertexAttributeHandle Handle_Singular; - typename MeshType::template PerVertexAttributeHandle Handle_SingularDegree; +// typename MeshType::template PerVertexAttributeHandle Handle_Singular; +// typename MeshType::template PerVertexAttributeHandle Handle_SingularDegree; - Handle_Singular=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("Singular")); +// Handle_Singular=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("Singular")); - Handle_SingularDegree=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("SingularityDegree")); +// Handle_SingularDegree=vcg::tri::Allocator::template GetPerVertexAttribute(mesh,std::string("SingularityDegree")); - glPushAttrib(GL_ALL_ATTRIB_BITS); - glEnable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHTING); - glDepthRange(0,0.999); - ScalarType size=10; - glPointSize(size); - glBegin(GL_POINTS); - for (unsigned int i=0;i > SeamsHandleType; - typedef typename vcg::tri::Allocator SeamsAllocator; +// static void GLDrawSeams(MeshType &mesh) +// { +// bool hasSeam = vcg::tri::HasPerFaceAttribute(mesh,std::string("Seams")); +// if(!hasSeam)return; +// bool HasSeamIndex=vcg::tri::HasPerFaceAttribute(mesh,std::string("SeamsIndex")); - SeamsHandleType Handle_Seam; - Handle_Seam=SeamsAllocator::template GetPerFaceAttribute >(mesh,std::string("Seams")); +// typedef typename MeshType::template PerFaceAttributeHandle > SeamsHandleType; +// typedef typename MeshType::template PerFaceAttributeHandle SeamsIndexHandleType; - glPushAttrib(GL_ALL_ATTRIB_BITS); - glEnable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHTING); - vcg::glColor(vcg::Color4b(255,0,0,255)); - glDepthRange(0,0.999); - for (unsigned int i=0;i seams=Handle_Seam[i]; - GLDrawFaceSeams(mesh.face[i],seams); - } - glPopAttrib(); - } +// typedef typename vcg::tri::Allocator SeamsAllocator; + +// SeamsHandleType Handle_Seam; +// Handle_Seam=SeamsAllocator::template GetPerFaceAttribute >(mesh,std::string("Seams")); + +// SeamsIndexHandleType Handle_SeamIndex; +// if (HasSeamIndex) +// Handle_SeamIndex=SeamsAllocator::template GetPerFaceAttribute(mesh,std::string("SeamsIndex")); + +// glPushAttrib(GL_ALL_ATTRIB_BITS); +// glEnable(GL_COLOR_MATERIAL); +// glDisable(GL_LIGHTING); + +// glDepthRange(0,0.999); +// for (unsigned int i=0;i seams=Handle_Seam[i]; +// vcg::Color4b seamCol[3]; +// for (int j=0;j<3;j++) +// { +// seamCol[j]=vcg::Color4b(0,255,0,255); +// if (HasSeamIndex) +// { +// int index=Handle_SeamIndex[i][j]; +// //assert(index>0); +// if (index>=0) +// seamCol[j]=vcg::Color4b::Scatter(100,index); +// } +// } + +// GLDrawFaceSeams(mesh.face[i],seams,seamCol); + +// } +// glPopAttrib(); +// } }; }