Go to the documentation of this file.00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_UTIL_POLYMESH_IS_MANIFOLD_H
00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_UTIL_POLYMESH_IS_MANIFOLD_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/core/containers/mesh/polymesh/util/polymesh_is_boundary.h>
00013
00014 namespace OpenTissue
00015 {
00016 namespace polymesh
00017 {
00018
00019 template< typename mesh_type >
00020 bool is_manifold( mesh_type const & mesh )
00021 {
00022 typename mesh_type::const_vertex_iterator vend = mesh.vertex_end();
00023 typename mesh_type::const_vertex_iterator v = mesh.vertex_begin();
00024 for(;v!=vend;++v)
00025 {
00026 if(is_boundary( *v ) )
00027 return false;
00028 }
00029 typename mesh_type::const_halfedge_iterator hend = mesh.halfedge_end();
00030 typename mesh_type::const_halfedge_iterator h = mesh.halfedge_begin();
00031 for(;h!=hend;++h)
00032 {
00033 if(is_boundary( *h ) )
00034 return false;
00035 }
00036 return true;
00037 }
00038
00039 }
00040 }
00041
00042
00043 #endif