diff --git a/vcg/complex/base.h b/vcg/complex/base.h index c2f17442..828bdcae 100644 --- a/vcg/complex/base.h +++ b/vcg/complex/base.h @@ -522,17 +522,17 @@ template inline int & IMark(MeshType & m){return m.imark;} /** \brief Check if the vertex incremental mark matches the one of the mesh. @param m the mesh containing the element @param v Vertex pointer */ -template inline bool IsMarked(MeshType & m, typename MeshType::ConstVertexPointer v ) { return v->cIMark() == m.imark; } +template inline bool IsMarked(const MeshType & m, typename MeshType::ConstVertexPointer v ) { return v->cIMark() == m.imark; } /** \brief Check if the edge incremental mark matches the one of the mesh. @param m the mesh containing the element @param e edge pointer */ -template inline bool IsMarked(MeshType & m, typename MeshType::ConstEdgePointer e ) { return e->cIMark() == m.imark; } +template inline bool IsMarked(const MeshType & m, typename MeshType::ConstEdgePointer e ) { return e->cIMark() == m.imark; } /** \brief Check if the face incremental mark matches the one of the mesh. @param m the mesh containing the element @param f Face pointer */ -template inline bool IsMarked( MeshType & m,typename MeshType::ConstFacePointer f ) { return f->cIMark() == m.imark; } +template inline bool IsMarked(const MeshType & m,typename MeshType::ConstFacePointer f ) { return f->cIMark() == m.imark; } /** \brief Check if the tetra incremental mark matches the one of the mesh. @param m the mesh containing the element @@ -771,21 +771,21 @@ bool HasPerMeshAttribute(const MeshType &m, std::string name){ return (ai!= m.mesh_attr.end() ) ; } -template void RequireVertexCompactness (MeshType &m) { +template void RequireVertexCompactness (const MeshType &m) { if(m.vert.size()!=size_t(m.vn)) throw vcg::MissingCompactnessException("Vertex Vector Contains deleted elements"); } -template void RequireFaceCompactness (MeshType &m) { +template void RequireFaceCompactness (const MeshType &m) { if(m.face.size()!=size_t(m.fn)) throw vcg::MissingCompactnessException("Face Vector Contains deleted elements"); } -template void RequireEdgeCompactness (MeshType &m) { +template void RequireEdgeCompactness (const MeshType &m) { if(m.edge.size()!=size_t(m.en)) throw vcg::MissingCompactnessException("Edge Vector Contains deleted elements"); } -template void RequireTetraCompactness(MeshType &m) { +template void RequireTetraCompactness(const MeshType &m) { if (m.tetra.size() != size_t(m.tn)) throw vcg::MissingCompactnessException("Tetra Vector Contains deleted elements"); } template -void RequireCompactness(MeshType &m) +void RequireCompactness(const MeshType &m) { RequireVertexCompactness(m); RequireFaceCompactness(m); @@ -794,55 +794,55 @@ void RequireCompactness(MeshType &m) } //todo require tetramesh -template void RequireTriangularMesh (MeshType &m ) { if( tri::HasPolyInfo( m ) ) throw vcg::MissingTriangularRequirementException("");} -template void RequirePolygonalMesh (MeshType &m ) { if(!tri::HasPolyInfo( m ) ) throw vcg::MissingPolygonalRequirementException("");} +template void RequireTriangularMesh (const MeshType &m ) { if( tri::HasPolyInfo( m ) ) throw vcg::MissingTriangularRequirementException("");} +template void RequirePolygonalMesh (const MeshType &m ) { if(!tri::HasPolyInfo( m ) ) throw vcg::MissingPolygonalRequirementException("");} -template void RequireVFAdjacency (MeshType &m) { if(!tri::HasVFAdjacency (m)) throw vcg::MissingComponentException("VFAdjacency"); } -template void RequireVEAdjacency (MeshType &m) { if(!tri::HasVEAdjacency (m)) throw vcg::MissingComponentException("VEAdjacency"); } -template void RequireFFAdjacency (MeshType &m) { if(!tri::HasFFAdjacency (m)) throw vcg::MissingComponentException("FFAdjacency"); } -template void RequireEEAdjacency (MeshType &m) { if(!tri::HasEEAdjacency (m)) throw vcg::MissingComponentException("EEAdjacency"); } -template void RequireFEAdjacency (MeshType &m) { if(!tri::HasFEAdjacency (m)) throw vcg::MissingComponentException("FEAdjacency"); } -template void RequireFHAdjacency (MeshType &m) { if(!tri::HasFHAdjacency (m)) throw vcg::MissingComponentException("FHAdjacency"); } -template void RequireVTAdjacency (MeshType &m) { if(!tri::HasVTAdjacency (m)) throw vcg::MissingComponentException("VTAdjacency"); } -template void RequireTTAdjacency (MeshType &m) { if(!tri::HasTTAdjacency (m)) throw vcg::MissingComponentException("TTAdjacency"); } +template void RequireVFAdjacency (const MeshType &m) { if(!tri::HasVFAdjacency (m)) throw vcg::MissingComponentException("VFAdjacency"); } +template void RequireVEAdjacency (const MeshType &m) { if(!tri::HasVEAdjacency (m)) throw vcg::MissingComponentException("VEAdjacency"); } +template void RequireFFAdjacency (const MeshType &m) { if(!tri::HasFFAdjacency (m)) throw vcg::MissingComponentException("FFAdjacency"); } +template void RequireEEAdjacency (const MeshType &m) { if(!tri::HasEEAdjacency (m)) throw vcg::MissingComponentException("EEAdjacency"); } +template void RequireFEAdjacency (const MeshType &m) { if(!tri::HasFEAdjacency (m)) throw vcg::MissingComponentException("FEAdjacency"); } +template void RequireFHAdjacency (const MeshType &m) { if(!tri::HasFHAdjacency (m)) throw vcg::MissingComponentException("FHAdjacency"); } +template void RequireVTAdjacency (const MeshType &m) { if(!tri::HasVTAdjacency (m)) throw vcg::MissingComponentException("VTAdjacency"); } +template void RequireTTAdjacency (const MeshType &m) { if(!tri::HasTTAdjacency (m)) throw vcg::MissingComponentException("TTAdjacency"); } -template void RequirePerVertexQuality (MeshType &m) { if(!tri::HasPerVertexQuality (m)) throw vcg::MissingComponentException("PerVertexQuality "); } -template void RequirePerVertexNormal (MeshType &m) { if(!tri::HasPerVertexNormal (m)) throw vcg::MissingComponentException("PerVertexNormal "); } -template void RequirePerVertexColor (MeshType &m) { if(!tri::HasPerVertexColor (m)) throw vcg::MissingComponentException("PerVertexColor "); } -template void RequirePerVertexMark (MeshType &m) { if(!tri::HasPerVertexMark (m)) throw vcg::MissingComponentException("PerVertexMark "); } -template void RequirePerVertexFlags (MeshType &m) { if(!tri::HasPerVertexFlags (m)) throw vcg::MissingComponentException("PerVertexFlags "); } -template void RequirePerVertexRadius (MeshType &m) { if(!tri::HasPerVertexRadius (m)) throw vcg::MissingComponentException("PerVertexRadius "); } -template void RequirePerVertexCurvature (MeshType &m) { if(!tri::HasPerVertexCurvature (m)) throw vcg::MissingComponentException("PerVertexCurvature "); } -template void RequirePerVertexCurvatureDir(MeshType &m) { if(!tri::HasPerVertexCurvatureDir(m)) throw vcg::MissingComponentException("PerVertexCurvatureDir"); } -template void RequirePerVertexTexCoord (MeshType &m) { if(!tri::HasPerVertexTexCoord (m)) throw vcg::MissingComponentException("PerVertexTexCoord "); } +template void RequirePerVertexQuality (const MeshType &m) { if(!tri::HasPerVertexQuality (m)) throw vcg::MissingComponentException("PerVertexQuality "); } +template void RequirePerVertexNormal (const MeshType &m) { if(!tri::HasPerVertexNormal (m)) throw vcg::MissingComponentException("PerVertexNormal "); } +template void RequirePerVertexColor (const MeshType &m) { if(!tri::HasPerVertexColor (m)) throw vcg::MissingComponentException("PerVertexColor "); } +template void RequirePerVertexMark (const MeshType &m) { if(!tri::HasPerVertexMark (m)) throw vcg::MissingComponentException("PerVertexMark "); } +template void RequirePerVertexFlags (const MeshType &m) { if(!tri::HasPerVertexFlags (m)) throw vcg::MissingComponentException("PerVertexFlags "); } +template void RequirePerVertexRadius (const MeshType &m) { if(!tri::HasPerVertexRadius (m)) throw vcg::MissingComponentException("PerVertexRadius "); } +template void RequirePerVertexCurvature (const MeshType &m) { if(!tri::HasPerVertexCurvature (m)) throw vcg::MissingComponentException("PerVertexCurvature "); } +template void RequirePerVertexCurvatureDir(const MeshType &m) { if(!tri::HasPerVertexCurvatureDir(m)) throw vcg::MissingComponentException("PerVertexCurvatureDir"); } +template void RequirePerVertexTexCoord (const MeshType &m) { if(!tri::HasPerVertexTexCoord (m)) throw vcg::MissingComponentException("PerVertexTexCoord "); } -template void RequirePerEdgeQuality (MeshType &m) { if(!tri::HasPerEdgeQuality (m)) throw vcg::MissingComponentException("PerEdgeQuality "); } -template void RequirePerEdgeNormal (MeshType &m) { if(!tri::HasPerEdgeNormal (m)) throw vcg::MissingComponentException("PerEdgeNormal "); } -template void RequirePerEdgeColor (MeshType &m) { if(!tri::HasPerEdgeColor (m)) throw vcg::MissingComponentException("PerEdgeColor "); } -template void RequirePerEdgeMark (MeshType &m) { if(!tri::HasPerEdgeMark (m)) throw vcg::MissingComponentException("PerEdgeMark "); } -template void RequirePerEdgeFlags (MeshType &m) { if(!tri::HasPerEdgeFlags (m)) throw vcg::MissingComponentException("PerEdgeFlags "); } +template void RequirePerEdgeQuality (const MeshType &m) { if(!tri::HasPerEdgeQuality (m)) throw vcg::MissingComponentException("PerEdgeQuality "); } +template void RequirePerEdgeNormal (const MeshType &m) { if(!tri::HasPerEdgeNormal (m)) throw vcg::MissingComponentException("PerEdgeNormal "); } +template void RequirePerEdgeColor (const MeshType &m) { if(!tri::HasPerEdgeColor (m)) throw vcg::MissingComponentException("PerEdgeColor "); } +template void RequirePerEdgeMark (const MeshType &m) { if(!tri::HasPerEdgeMark (m)) throw vcg::MissingComponentException("PerEdgeMark "); } +template void RequirePerEdgeFlags (const MeshType &m) { if(!tri::HasPerEdgeFlags (m)) throw vcg::MissingComponentException("PerEdgeFlags "); } -template void RequirePerFaceFlags (MeshType &m) { if(!tri::HasPerFaceFlags (m)) throw vcg::MissingComponentException("PerFaceFlags "); } -template void RequirePerFaceNormal (MeshType &m) { if(!tri::HasPerFaceNormal (m)) throw vcg::MissingComponentException("PerFaceNormal "); } -template void RequirePerFaceColor (MeshType &m) { if(!tri::HasPerFaceColor (m)) throw vcg::MissingComponentException("PerFaceColor "); } -template void RequirePerFaceMark (MeshType &m) { if(!tri::HasPerFaceMark (m)) throw vcg::MissingComponentException("PerFaceMark "); } -template void RequirePerFaceQuality (MeshType &m) { if(!tri::HasPerFaceQuality (m)) throw vcg::MissingComponentException("PerFaceQuality "); } -template void RequirePerFaceCurvatureDir(MeshType &m) { if(!tri::HasPerFaceCurvatureDir(m)) throw vcg::MissingComponentException("PerFaceCurvatureDir"); } +template void RequirePerFaceFlags (const MeshType &m) { if(!tri::HasPerFaceFlags (m)) throw vcg::MissingComponentException("PerFaceFlags "); } +template void RequirePerFaceNormal (const MeshType &m) { if(!tri::HasPerFaceNormal (m)) throw vcg::MissingComponentException("PerFaceNormal "); } +template void RequirePerFaceColor (const MeshType &m) { if(!tri::HasPerFaceColor (m)) throw vcg::MissingComponentException("PerFaceColor "); } +template void RequirePerFaceMark (const MeshType &m) { if(!tri::HasPerFaceMark (m)) throw vcg::MissingComponentException("PerFaceMark "); } +template void RequirePerFaceQuality (const MeshType &m) { if(!tri::HasPerFaceQuality (m)) throw vcg::MissingComponentException("PerFaceQuality "); } +template void RequirePerFaceCurvatureDir(const MeshType &m) { if(!tri::HasPerFaceCurvatureDir(m)) throw vcg::MissingComponentException("PerFaceCurvatureDir"); } -template void RequirePerFaceWedgeColor (MeshType &m) { if(!tri::HasPerWedgeColor (m)) throw vcg::MissingComponentException("PerFaceWedgeColor "); } -template void RequirePerFaceWedgeNormal (MeshType &m) { if(!tri::HasPerWedgeNormal (m)) throw vcg::MissingComponentException("PerFaceWedgeNormal "); } -template void RequirePerFaceWedgeTexCoord(MeshType &m) { if(!tri::HasPerWedgeTexCoord(m)) throw vcg::MissingComponentException("PerFaceWedgeTexCoord"); } +template void RequirePerFaceWedgeColor (const MeshType &m) { if(!tri::HasPerWedgeColor (m)) throw vcg::MissingComponentException("PerFaceWedgeColor "); } +template void RequirePerFaceWedgeNormal (const MeshType &m) { if(!tri::HasPerWedgeNormal (m)) throw vcg::MissingComponentException("PerFaceWedgeNormal "); } +template void RequirePerFaceWedgeTexCoord(const MeshType &m) { if(!tri::HasPerWedgeTexCoord(m)) throw vcg::MissingComponentException("PerFaceWedgeTexCoord"); } -template void RequirePerTetraFlags (MeshType &m) { if(!tri::HasPerTetraFlags (m)) throw vcg::MissingComponentException("PerTetraFlags "); } -template void RequirePerTetraColor (MeshType &m) { if(!tri::HasPerTetraColor (m)) throw vcg::MissingComponentException("PerTetraColor "); } -template void RequirePerTetraMark (MeshType &m) { if(!tri::HasPerTetraMark (m)) throw vcg::MissingComponentException("PerTetraMark "); } -template void RequirePerTetraQuality (MeshType &m) { if(!tri::HasPerTetraQuality (m)) throw vcg::MissingComponentException("PerTetraQuality "); } +template void RequirePerTetraFlags (const MeshType &m) { if(!tri::HasPerTetraFlags (m)) throw vcg::MissingComponentException("PerTetraFlags "); } +template void RequirePerTetraColor (const MeshType &m) { if(!tri::HasPerTetraColor (m)) throw vcg::MissingComponentException("PerTetraColor "); } +template void RequirePerTetraMark (const MeshType &m) { if(!tri::HasPerTetraMark (m)) throw vcg::MissingComponentException("PerTetraMark "); } +template void RequirePerTetraQuality (const MeshType &m) { if(!tri::HasPerTetraQuality (m)) throw vcg::MissingComponentException("PerTetraQuality "); } -template void RequirePerVertexAttribute(MeshType &m, const char *name) { if(!HasPerVertexAttribute(m,name)) throw vcg::MissingComponentException("PerVertex attribute"); } -template void RequirePerEdgeAttribute(MeshType &m, const char *name) { if(!HasPerEdgeAttribute(m,name)) throw vcg::MissingComponentException("PerEdge attribute"); } -template void RequirePerFaceAttribute(MeshType &m, const char *name) { if(!HasPerFaceAttribute(m,name)) throw vcg::MissingComponentException("PerFace attribute"); } -template void RequirePerTetraAttribute(MeshType &m, const char *name) { if(!HasPerTetraAttribute(m,name)) throw vcg::MissingComponentException("PerTetra attribute"); } -template void RequirePerMeshAttribute(MeshType &m, const char *name) { if(!HasPerMeshAttribute(m,name)) throw vcg::MissingComponentException("PerMesh attribute"); } +template void RequirePerVertexAttribute(const MeshType &m, const char *name) { if(!HasPerVertexAttribute(m,name)) throw vcg::MissingComponentException("PerVertex attribute"); } +template void RequirePerEdgeAttribute(const MeshType &m, const char *name) { if(!HasPerEdgeAttribute(m,name)) throw vcg::MissingComponentException("PerEdge attribute"); } +template void RequirePerFaceAttribute(const MeshType &m, const char *name) { if(!HasPerFaceAttribute(m,name)) throw vcg::MissingComponentException("PerFace attribute"); } +template void RequirePerTetraAttribute(const MeshType &m, const char *name) { if(!HasPerTetraAttribute(m,name)) throw vcg::MissingComponentException("PerTetra attribute"); } +template void RequirePerMeshAttribute(const MeshType &m, const char *name) { if(!HasPerMeshAttribute(m,name)) throw vcg::MissingComponentException("PerMesh attribute"); } /*@}*/ /*@}*/