Added RequirePolygonalMesh invariant to the list of the exception throwing utility
This commit is contained in:
parent
d2131fd436
commit
1baf0f3727
|
@ -611,6 +611,7 @@ template <class MeshType> void RequireCompactness (MeshType &m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MeshType> void RequireTriangularMesh (MeshType &m ) { if( tri::HasPolyInfo( m ) ) throw vcg::MissingTriangularRequirementException("");}
|
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("");}
|
||||||
|
|
||||||
template <class MeshType> void RequireVFAdjacency (MeshType &m) { if(!tri::HasVFAdjacency (m)) throw vcg::MissingComponentException("VFAdjacency"); }
|
template <class MeshType> void RequireVFAdjacency (MeshType &m) { if(!tri::HasVFAdjacency (m)) throw vcg::MissingComponentException("VFAdjacency"); }
|
||||||
template <class MeshType> void RequireVEAdjacency (MeshType &m) { if(!tri::HasVEAdjacency (m)) throw vcg::MissingComponentException("VEAdjacency"); }
|
template <class MeshType> void RequireVEAdjacency (MeshType &m) { if(!tri::HasVEAdjacency (m)) throw vcg::MissingComponentException("VEAdjacency"); }
|
||||||
|
|
|
@ -67,6 +67,21 @@ public:
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MissingPolygonalRequirementException : public std::runtime_error
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MissingPolygonalRequirementException(const std::string &err):std::runtime_error(err)
|
||||||
|
{
|
||||||
|
std::cout << "Mesh has to be composed by polygonal faces (not plain triangles) -" << err << "- \n";
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual const char *what() const throw ()
|
||||||
|
{
|
||||||
|
static char buf[128]="Mesh has to be composed by polygonal faces (not plain triangles) ";
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EXCEPTION_H
|
#endif // EXCEPTION_H
|
||||||
|
|
Loading…
Reference in New Issue