Go to the documentation of this file.00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_UTIL_POLYMESH_VALENCY_H
00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_UTIL_POLYMESH_VALENCY_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/core/containers/mesh/polymesh/polymesh_vertex.h>
00013 #include <OpenTissue/core/containers/mesh/polymesh/polymesh_face.h>
00014
00015 namespace OpenTissue
00016 {
00017 namespace polymesh
00018 {
00019
00020 template<typename mesh_type>
00021 unsigned int valency(PolyMeshVertex<mesh_type> const & v)
00022 {
00023 typedef typename mesh_type::vertex_halfedge_circulator vertex_halfedge_circulator;
00024 unsigned int valency = 0;
00025 vertex_halfedge_circulator h(v), end;
00026 for(;h!=end;++h,++valency);
00027 return valency;
00028 }
00029
00030 template<typename mesh_type>
00031 unsigned int valency(PolyMeshFace<mesh_type> const & f)
00032 {
00033 typedef typename mesh_type::face_halfedge_circulator face_halfedge_circulator;
00034 unsigned int valency = 0;
00035 face_halfedge_circulator h(f),end;
00036 for(;h!=end;++h,++valency);
00037 return valency;
00038 }
00039
00040 }
00041 }
00042
00043
00044 #endif