Go to the documentation of this file.00001 #ifndef OPENTISSUE_CORE_CONTAINERS_T4MESH_UTIL_T4MESH_COMPUTE_QUALITY_MESH_H
00002 #define OPENTISSUE_CORE_CONTAINERS_T4MESH_UTIL_T4MESH_COMPUTE_QUALITY_MESH_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 namespace OpenTissue
00013 {
00014 namespace t4mesh
00015 {
00016
00025 template<typename point_container,typename t4mesh_type, typename vector_type, typename quality_functor>
00026 inline void compute_mesh_quality(t4mesh_type const & mesh, point_container & points, vector_type & Q, quality_functor const & F)
00027 {
00028 typedef typename t4mesh_type::node_iterator node_iterator;
00029 typedef typename t4mesh_type::node_iterator const_node_iterator;
00030 typedef typename t4mesh_type::tetrahedron_iterator tetrahedron_iterator;
00031 typedef typename t4mesh_type::tetrahedron_iterator const_tetrahedron_iterator;
00032
00033 Q.clear();
00034 Q.resize( mesh.size_tetrahedra() );
00035
00036 size_t i=0;
00037 for(const_tetrahedron_iterator tetrahedron=mesh.tetrahedron_begin();tetrahedron!=mesh.tetrahedron_end();++tetrahedron)
00038 {
00039 Q[i++] = F(
00040 points[tetrahedron->i()->idx()]
00041 , points[tetrahedron->j()->idx()]
00042 , points[tetrahedron->k()->idx()]
00043 , points[tetrahedron->m()->idx()]
00044 );
00045 }
00046 }
00047
00055 template<typename t4mesh_type, typename vector_type, typename quality_functor>
00056 inline void compute_mesh_quality(t4mesh_type const & mesh, vector_type & Q, quality_functor const & F)
00057 {
00058 default_point_container<t4mesh_type> points(const_cast<t4mesh_type*>(&mesh));
00059 return compute_mesh_quality(mesh,points,Q,F);
00060 }
00061
00062 }
00063
00064 }
00065
00066
00067 #endif