Go to the documentation of this file.00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_COMMON_UTIL_MESH_COMPUTE_MESH_MINIMUM_COORD_H
00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_COMMON_UTIL_MESH_COMPUTE_MESH_MINIMUM_COORD_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 namespace OpenTissue
00013 {
00014 namespace mesh
00015 {
00016 template<typename mesh_type, typename vector3_type>
00017 void compute_mesh_minimum_coord(mesh_type const & mesh, vector3_type & min_coord)
00018 {
00019 assert(mesh.size_vertices()>0 || !"mesh did not have any vertices");
00020
00021 typename mesh_type::const_vertex_iterator end = mesh.vertex_end();
00022 typename mesh_type::const_vertex_iterator v = mesh.vertex_begin();
00023 min_coord = v->m_coord;
00024 for(;v!=end;++v)
00025 min_coord = min(min_coord, v->m_coord);
00026 }
00027
00028 }
00029 }
00030
00031
00032 #endif