59 #define OPENMESH_JACOBI_LAPLACE_SMOOTHERT_C
81 if (Base::continuity() > Base::C0)
83 Base::mesh_.add_property(umbrellas_);
84 if (Base::continuity() > Base::C1)
85 Base::mesh_.add_property(squared_umbrellas_);
90 if (Base::continuity() > Base::C0)
92 Base::mesh_.remove_property(umbrellas_);
93 if (Base::continuity() > Base::C1)
94 Base::mesh_.remove_property(squared_umbrellas_);
102 template <
class Mesh>
107 typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
112 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
114 if (this->is_active(*v_it))
118 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
119 w = this->weight(Base::mesh_.edge_handle(*voh_it));
122 u *= this->weight(*v_it);
131 this->set_new_position(*v_it, p);
140 template <
class Mesh>
142 JacobiLaplaceSmootherT<Mesh>::
143 compute_new_positions_C1()
145 typename Mesh::VertexIter v_it, v_end(Base::mesh_.vertices_end());
152 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
155 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
156 w = this->weight(Base::mesh_.edge_handle(*voh_it));
159 u *= this->weight(*v_it);
162 Base::mesh_.property(umbrellas_, *v_it) = u;
167 for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
169 if (this->is_active(*v_it))
173 for (voh_it = Base::mesh_.cvoh_iter(*v_it); voh_it.is_valid(); ++voh_it) {
174 w = this->weight(Base::mesh_.edge_handle(*voh_it));
175 uu -= Base::mesh_.property(umbrellas_, Base::mesh_.to_vertex_handle(*voh_it));
176 diag += (w * this->weight(Base::mesh_.to_vertex_handle(*voh_it)) +
static_cast<typename
Mesh::Scalar>(1.0) ) * w;
178 uu *= this->weight(*v_it);
179 diag *= this->weight(*v_it);
180 uu += Base::mesh_.property(umbrellas_, *v_it);
181 if (diag) uu *=
static_cast<typename
Mesh::Scalar>(1.0) / diag;
189 this->set_new_position(*v_it, p);
void smooth(unsigned int _n)
Do _n smoothing iterations.
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
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.
virtual void smooth(unsigned int _n)
Do _n smoothing iterations.
Kernel::Scalar Scalar
Scalar type.
Kernel::Normal Normal
Normal type.