From f45e0cec3ae360cc08b9e4f960d2119e16c795e0 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 20 Jan 2012 07:44:55 +0000 Subject: [PATCH] Changed all the MeshType::HasSomething() into the now standard tri::HasSomething(MeshType &m) --- wrap/io_tetramesh/export_ply.h | 6 +++--- wrap/io_trimesh/import_obj.h | 10 +++++----- wrap/io_trimesh/import_ply.h | 6 +++--- wrap/io_trimesh/import_raw.h | 4 ++-- wrap/io_trimesh/io_mask.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wrap/io_tetramesh/export_ply.h b/wrap/io_tetramesh/export_ply.h index 8ee81de3..f41e9b51 100644 --- a/wrap/io_tetramesh/export_ply.h +++ b/wrap/io_tetramesh/export_ply.h @@ -173,7 +173,7 @@ static bool Save(SaveMeshType &m, const char * filename, bool binary, PlyInfo & ); } - if( m.HasPerVertexColor() && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) + if( HasPerVertexColor(m) && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) { fprintf(fpout, "property uchar red\n" @@ -333,7 +333,7 @@ static bool Save(SaveMeshType &m, const char * filename, bool binary, PlyInfo & if( pi.mask & ply::PLYMask::PM_VERTFLAGS ) fwrite(&(vp->UberFlags()),sizeof(int),1,fpout); - if( m.HasPerVertexColor() && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) + if( HasPerVertexColor(m) && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) fwrite(&( vp->C() ),sizeof(char),4,fpout); if( m.HasPerVertexQuality() && (pi.mask & ply::PLYMask::PM_VERTQUALITY) ) @@ -362,7 +362,7 @@ static bool Save(SaveMeshType &m, const char * filename, bool binary, PlyInfo & if( pi.mask & ply::PLYMask::PM_VERTFLAGS ) fprintf(fpout,"%d ",vp->UberFlags()); - if( m.HasPerVertexColor() && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) + if( HasPerVertexColor(m) && (pi.mask & ply::PLYMask::PM_VERTCOLOR) ) fprintf(fpout,"%d %d %d %d ",vp->C()[0],vp->C()[1],vp->C()[2],vp->C()[3] ); if( m.HasPerVertexQuality() && (pi.mask & ply::PLYMask::PM_VERTQUALITY) ) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 26cfbbaa..28d3d1ff 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -294,7 +294,7 @@ public: // assigning vertex color // ---------------------- - if (((oi.mask & vcg::tri::io::Mask::IOM_VERTCOLOR) != 0) && (m.HasPerVertexColor())) + if (((oi.mask & vcg::tri::io::Mask::IOM_VERTCOLOR) != 0) && (HasPerVertexColor(m))) { if(numTokens>=7) { @@ -544,7 +544,7 @@ public: { m.face[i].V(j) = &(m.vert[indexedFaces[i].v[j]]); - if (((oi.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD) != 0) && (m.HasPerWedgeTexCoord())) + if (((oi.mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD) != 0) && (HasPerWedgeTexCoord(m))) { ObjTexCoord t = texCoords[indexedFaces[i].t[j]]; m.face[i].WT(j).u() = t.u; @@ -568,12 +568,12 @@ public: else m.face[i].ClearF(j); } - if (((oi.mask & vcg::tri::io::Mask::IOM_FACECOLOR) != 0) && (m.HasPerFaceColor())) + if (((oi.mask & vcg::tri::io::Mask::IOM_FACECOLOR) != 0) && (HasPerFaceColor(m))) { m.face[i].C() = indexedFaces[i].c; } - if (((oi.mask & vcg::tri::io::Mask::IOM_WEDGNORMAL) != 0) && (m.HasPerWedgeNormal())) + if (((oi.mask & vcg::tri::io::Mask::IOM_WEDGNORMAL) != 0) && (HasPerWedgeNormal(m))) { // face normal is computed as an average of wedge normals m.face[i].N().Import(m.face[i].WN(0)+m.face[i].WN(1)+m.face[i].WN(2)); @@ -581,7 +581,7 @@ public: else { // computing face normal from position of face vertices - if (m.HasPerFaceNormal()) + if (HasPerFaceNormal(m)) { face::ComputeNormalizedNormal(m.face[i]); } diff --git a/wrap/io_trimesh/import_ply.h b/wrap/io_trimesh/import_ply.h index ff7edbc0..1306d8ff 100644 --- a/wrap/io_trimesh/import_ply.h +++ b/wrap/io_trimesh/import_ply.h @@ -651,7 +651,7 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi ) (*vi).P()[1] = va.p[1]; (*vi).P()[2] = va.p[2]; - if( m.HasPerVertexFlags() && (pi.mask & Mask::IOM_VERTFLAGS) ) + if( HasPerVertexFlags(m) && (pi.mask & Mask::IOM_VERTFLAGS) ) (*vi).UberFlags() = va.flags; if( pi.mask & Mask::IOM_VERTQUALITY ) @@ -746,9 +746,9 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi ) } } - if(m.HasPolyInfo()) (*fi).Alloc(3); + if(HasPolyInfo(m)) (*fi).Alloc(3); - if(m.HasPerFaceFlags() &&( pi.mask & Mask::IOM_FACEFLAGS) ) + if(HasPerFaceFlags(m) &&( pi.mask & Mask::IOM_FACEFLAGS) ) { (*fi).UberFlags() = fa.flags; } diff --git a/wrap/io_trimesh/import_raw.h b/wrap/io_trimesh/import_raw.h index 5dc17cf0..f1e7d9f1 100644 --- a/wrap/io_trimesh/import_raw.h +++ b/wrap/io_trimesh/import_raw.h @@ -377,7 +377,7 @@ static int Open( MESH_TYPE &m, const char * filename, bool triangulate=false, in nv.P()[2] = linebuffer[2]; // store the normal - if(m.HasPerVertexNormal()) + if(HasPerVertexNormal(m)) { nv.N()[0] = linebuffer[3]; nv.N()[1] = linebuffer[4]; @@ -385,7 +385,7 @@ static int Open( MESH_TYPE &m, const char * filename, bool triangulate=false, in } // store the color - if(m.HasPerVertexColor()) + if(HasPerVertexColor(m)) { nv.C()[0] = linebuffer[6]; nv.C()[1] = linebuffer[7]; diff --git a/wrap/io_trimesh/io_mask.h b/wrap/io_trimesh/io_mask.h index 381f920b..1c5575f8 100644 --- a/wrap/io_trimesh/io_mask.h +++ b/wrap/io_trimesh/io_mask.h @@ -126,8 +126,8 @@ static void ClampMask(MeshType &m, int &mask) { if( (mask & IOM_FACECOLOR) && !HasPerFaceColor(m) ) mask = mask & (~IOM_FACECOLOR); if( (mask & IOM_WEDGTEXCOORD) && !HasPerWedgeTexCoord(m) ) mask = mask & (~IOM_WEDGTEXCOORD); - if( (mask & IOM_WEDGNORMAL) && !m.HasPerWedgeNormal() ) mask = mask & (~IOM_WEDGNORMAL); - if( (mask & IOM_VERTCOLOR) && !m.HasPerVertexColor() ) mask = mask & (~IOM_VERTCOLOR); + if( (mask & IOM_WEDGNORMAL) && !HasPerWedgeNormal(m) ) mask = mask & (~IOM_WEDGNORMAL); + if( (mask & IOM_VERTCOLOR) && !HasPerVertexColor(m) ) mask = mask & (~IOM_VERTCOLOR); } }; // end class