minor modifications

This commit is contained in:
Nico Pietroni 2014-02-16 16:37:39 +00:00
parent 30fb536c78
commit 4b15067dd1
1 changed files with 9 additions and 93 deletions

View File

@ -20,14 +20,14 @@ class GLField
glLineWidth(2);
vcg::glColor(vcg::Color4b(0,0,255,255));
glBegin(GL_LINES);
glVertex(center);
glVertex(center-dir[0]*size);
glVertex(center+dir[0]*size);
glEnd();
glLineWidth(2);
vcg::glColor(vcg::Color4b(0,255,0,255));
glBegin(GL_LINES);
glVertex(center);
glVertex(center-dir[1]*size);
glVertex(center+dir[1]*size);
glEnd();
/*glLineWidth(1);
@ -84,55 +84,15 @@ 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"));
// if (!hasSingular)return;
// typename MeshType::template PerVertexAttributeHandle<bool> Handle_Singular;
// typename MeshType::template PerVertexAttributeHandle<int> Handle_SingularDegree;
// Handle_Singular=vcg::tri::Allocator<MeshType>::template GetPerVertexAttribute<bool>(mesh,std::string("Singular"));
// Handle_SingularDegree=vcg::tri::Allocator<MeshType>::template GetPerVertexAttribute<int>(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<mesh.vert.size();i++)
// {
// if (mesh.vert[i].IsD())continue;
// if (!Handle_Singular[i])continue;
// int mmatch=3;
// if (hasSingularDegree)
// mmatch=Handle_SingularDegree[i];
// if (mmatch==1)vcg::glColor(vcg::Color4b(0,0,255,255));
// else
// if (mmatch==2)vcg::glColor(vcg::Color4b(255,0,0,255));
// else
// if (mmatch==3)vcg::glColor(vcg::Color4b(0,255,255,255));
// vcg::glVertex(mesh.vert[i].P());
// }
// glEnd();
// glPopAttrib();
// }
static void GLDrawFaceField(const MeshType &mesh)
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
glDepthRange(0.0,0.9999);
glEnable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
ScalarType size=mesh.bbox.Diag()/400.0;
for (unsigned int i=0;i<mesh.face.size();i++)
{
@ -146,9 +106,11 @@ public:
static void GLDrawVertField(const MeshType &mesh)
{
glPushAttrib(GL_ALL_ATTRIB_BITS);
glDepthRange(0.0,0.9999);
glEnable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
ScalarType size=mesh.bbox.Diag()/100.0;
glDisable(GL_BLEND);
ScalarType size=mesh.bbox.Diag()/400.0;
for (int i=0;i<mesh.vert.size();i++)
{
if (mesh.vert[i].IsD())continue;
@ -157,52 +119,6 @@ public:
}
glPopAttrib();
}
// 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"));
// typedef typename MeshType::template PerFaceAttributeHandle<vcg::Point3<bool> > SeamsHandleType;
// typedef typename MeshType::template PerFaceAttributeHandle<vcg::Point3i > SeamsIndexHandleType;
// typedef typename vcg::tri::Allocator<MeshType> SeamsAllocator;
// SeamsHandleType Handle_Seam;
// Handle_Seam=SeamsAllocator::template GetPerFaceAttribute<vcg::Point3<bool> >(mesh,std::string("Seams"));
// SeamsIndexHandleType Handle_SeamIndex;
// if (HasSeamIndex)
// Handle_SeamIndex=SeamsAllocator::template GetPerFaceAttribute<vcg::Point3i >(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<mesh.face.size();i++)
// {
// if (mesh.face[i].IsD())continue;
// vcg::Point3<bool> 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();
// }
};
}