54 #define OPENMESH_JACOBI_LAPLACE_SMOOTHERT_C 76 if (Base::continuity() > Base::C0)
78 Base::mesh_.add_property(umbrellas_);
79 if (Base::continuity() > Base::C1)
80 Base::mesh_.add_property(squared_umbrellas_);
85 if (Base::continuity() > Base::C0)
87 Base::mesh_.remove_property(umbrellas_);
88 if (Base::continuity() > Base::C1)
89 Base::mesh_.remove_property(squared_umbrellas_);
102 typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
107 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
109 if (this->is_active(*v_it))
113 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
114 w = this->weight(Base::mesh_.edge_handle(*voh_it));
117 u *= this->weight(*v_it);
126 this->set_new_position(*v_it, p);
135 template <
class Mesh>
140 typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
147 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
150 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
151 w = this->weight(Base::mesh_.edge_handle(*voh_it));
154 u *= this->weight(*v_it);
157 Base::mesh_.property(umbrellas_, *v_it) = u;
162 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
164 if (this->is_active(*v_it))
168 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
169 w = this->weight(Base::mesh_.edge_handle(*voh_it));
170 uu -= Base::mesh_.property(umbrellas_, Base::mesh_.to_vertex_handle(*voh_it));
171 diag += (w * this->weight(Base::mesh_.to_vertex_handle(*voh_it)) +
static_cast<typename
Mesh::Scalar>(1.0) ) * w;
173 uu *= this->weight(*v_it);
174 diag *= this->weight(*v_it);
175 uu += Base::mesh_.property(umbrellas_, *v_it);
176 if (diag) uu *=
static_cast<typename
Mesh::Scalar>(1.0) / diag;
184 this->set_new_position(*v_it, p);
void vector_cast(const src_t &_src, dst_t &_dst, GenProg::Int2Type< n >)
Cast vector type to another vector type by copying the vector elements.
Definition: vector_cast.hh:81
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:110
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:173
virtual void smooth(unsigned int _n)
Do _n smoothing iterations.
Definition: SmootherT_impl.hh:302
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:114
T::value_type value_type
Type of the scalar value.
Definition: vector_traits.hh:94
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Laplacian Smoothing.
Definition: JacobiLaplaceSmootherT.hh:75
void smooth(unsigned int _n)
Do _n smoothing iterations.
Definition: JacobiLaplaceSmootherT_impl.hh:74