2 #include <OpenMesh/Core/Utils/Property.hh> 4 #ifndef DOXY_IGNORE_THIS 6 template <
class Mesh>
class SmootherT
16 SmootherT(
Mesh& _mesh)
19 mesh_.add_property( cog_ );
24 mesh_.remove_property( cog_ );
28 void smooth(
unsigned int _iterations)
30 for (
unsigned int i=0; i < _iterations; ++i)
32 std::for_each(mesh_.vertices_begin(),
34 ComputeCOG(mesh_, cog_));
36 std::for_each(mesh_.vertices_begin(),
51 ComputeCOG(
Mesh& _mesh, Property_cog& _cog)
52 : mesh_(_mesh), cog_(_cog)
60 mesh_.property(cog_, _vh) =
typename Mesh::Point(0.0, 0.0, 0.0);
62 for (vv_it=mesh_.vv_iter(_vh); vv_it.is_valid(); ++vv_it)
64 mesh_.property(cog_, _vh) += mesh_.point( *vv_it );
68 mesh_.property(cog_, _vh ) /= valence;
80 SetCOG(
Mesh& _mesh, Property_cog& _cog)
81 : mesh_(_mesh), cog_(_cog)
87 if (!mesh_.is_boundary(_vh))
88 mesh_.set_point( _vh, mesh_.property(cog_, _vh) );
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Kernel::Point Point
Coordinate type.
Kernel::Scalar Scalar
Scalar type.