splitted compactness requirements

This commit is contained in:
Luigi Malomo 2017-03-07 14:32:28 +01:00
parent a597aea988
commit 155806f53e
1 changed files with 13 additions and 3 deletions

View File

@ -637,11 +637,21 @@ bool HasPerMeshAttribute(const MeshType &m, std::string name){
return (ai!= m.mesh_attr.end() ) ;
}
template <class MeshType> void RequireCompactness (MeshType &m) {
template <class MeshType> void RequireVertexCompactness (MeshType &m) {
if(m.vert.size()!=size_t(m.vn)) throw vcg::MissingCompactnessException("Vertex Vector Contains deleted elements");
if(m.edge.size()!=size_t(m.en)) throw vcg::MissingCompactnessException("Edge Vector Contains deleted elements");
}
template <class MeshType> void RequireFaceCompactness (MeshType &m) {
if(m.face.size()!=size_t(m.fn)) throw vcg::MissingCompactnessException("Face Vector Contains deleted elements");
}
template <class MeshType> void RequireEdgeCompactness (MeshType &m) {
if(m.edge.size()!=size_t(m.en)) throw vcg::MissingCompactnessException("Edge Vector Contains deleted elements");
}
template <class MeshType> void RequireCompactness (MeshType &m) {
RequireVertexCompactness<MeshType>(m);
RequireFaceCompactness<MeshType> (m);
RequireEdgeCompactness<MeshType> (m);
}
template <class MeshType> void RequireTriangularMesh (MeshType &m ) { if( tri::HasPolyInfo( m ) ) throw vcg::MissingTriangularRequirementException("");}
template <class MeshType> void RequirePolygonalMesh (MeshType &m ) { if(!tri::HasPolyInfo( m ) ) throw vcg::MissingPolygonalRequirementException("");}