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)
61 mesh_.property(cog_, vh) =
typename Mesh::Point(0.0, 0.0, 0.0);
63 for (vv_it=mesh_.vv_iter(vh); vv_it; ++vv_it)
65 mesh_.property(cog_, vh) += mesh_.point( vv_it );
69 mesh_.property(cog_, mesh_.handle(_v) ) /= valence;
81 SetCOG(
Mesh& _mesh, Property_cog& _cog)
82 : mesh_(_mesh), cog_(_cog)
89 if (!mesh_.is_boundary(vh))
90 mesh_.set_point( vh, mesh_.property(cog_, vh) );
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Kernel::Vertex Vertex
Vertex type.
Kernel::Point Point
Coordinate type.
Kernel::Scalar Scalar
Scalar type.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.