Changed all the MeshType::HasSomething() into the now standard tri::HasSomething(MeshType &m)

This commit is contained in:
Paolo Cignoni 2012-01-20 07:44:55 +00:00
parent c6d261e5c8
commit f45e0cec3a
5 changed files with 15 additions and 15 deletions

View File

@ -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, fprintf(fpout,
"property uchar red\n" "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 ) if( pi.mask & ply::PLYMask::PM_VERTFLAGS )
fwrite(&(vp->UberFlags()),sizeof(int),1,fpout); 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); fwrite(&( vp->C() ),sizeof(char),4,fpout);
if( m.HasPerVertexQuality() && (pi.mask & ply::PLYMask::PM_VERTQUALITY) ) 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 ) if( pi.mask & ply::PLYMask::PM_VERTFLAGS )
fprintf(fpout,"%d ",vp->UberFlags()); 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] ); 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) ) if( m.HasPerVertexQuality() && (pi.mask & ply::PLYMask::PM_VERTQUALITY) )

View File

@ -294,7 +294,7 @@ public:
// assigning vertex color // 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) if(numTokens>=7)
{ {
@ -544,7 +544,7 @@ public:
{ {
m.face[i].V(j) = &(m.vert[indexedFaces[i].v[j]]); 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]]; ObjTexCoord t = texCoords[indexedFaces[i].t[j]];
m.face[i].WT(j).u() = t.u; m.face[i].WT(j).u() = t.u;
@ -568,12 +568,12 @@ public:
else m.face[i].ClearF(j); 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; 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 // 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)); 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 else
{ {
// computing face normal from position of face vertices // computing face normal from position of face vertices
if (m.HasPerFaceNormal()) if (HasPerFaceNormal(m))
{ {
face::ComputeNormalizedNormal(m.face[i]); face::ComputeNormalizedNormal(m.face[i]);
} }

View File

@ -651,7 +651,7 @@ static int Open( OpenMeshType &m, const char * filename, PlyInfo &pi )
(*vi).P()[1] = va.p[1]; (*vi).P()[1] = va.p[1];
(*vi).P()[2] = va.p[2]; (*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; (*vi).UberFlags() = va.flags;
if( pi.mask & Mask::IOM_VERTQUALITY ) 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; (*fi).UberFlags() = fa.flags;
} }

View File

@ -377,7 +377,7 @@ static int Open( MESH_TYPE &m, const char * filename, bool triangulate=false, in
nv.P()[2] = linebuffer[2]; nv.P()[2] = linebuffer[2];
// store the normal // store the normal
if(m.HasPerVertexNormal()) if(HasPerVertexNormal(m))
{ {
nv.N()[0] = linebuffer[3]; nv.N()[0] = linebuffer[3];
nv.N()[1] = linebuffer[4]; 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 // store the color
if(m.HasPerVertexColor()) if(HasPerVertexColor(m))
{ {
nv.C()[0] = linebuffer[6]; nv.C()[0] = linebuffer[6];
nv.C()[1] = linebuffer[7]; nv.C()[1] = linebuffer[7];

View File

@ -126,8 +126,8 @@ static void ClampMask(MeshType &m, int &mask)
{ {
if( (mask & IOM_FACECOLOR) && !HasPerFaceColor(m) ) mask = mask & (~IOM_FACECOLOR); if( (mask & IOM_FACECOLOR) && !HasPerFaceColor(m) ) mask = mask & (~IOM_FACECOLOR);
if( (mask & IOM_WEDGTEXCOORD) && !HasPerWedgeTexCoord(m) ) mask = mask & (~IOM_WEDGTEXCOORD); if( (mask & IOM_WEDGTEXCOORD) && !HasPerWedgeTexCoord(m) ) mask = mask & (~IOM_WEDGTEXCOORD);
if( (mask & IOM_WEDGNORMAL) && !m.HasPerWedgeNormal() ) mask = mask & (~IOM_WEDGNORMAL); if( (mask & IOM_WEDGNORMAL) && !HasPerWedgeNormal(m) ) mask = mask & (~IOM_WEDGNORMAL);
if( (mask & IOM_VERTCOLOR) && !m.HasPerVertexColor() ) mask = mask & (~IOM_VERTCOLOR); if( (mask & IOM_VERTCOLOR) && !HasPerVertexColor(m) ) mask = mask & (~IOM_VERTCOLOR);
} }
}; // end class }; // end class