54#define OPENMESH_DECIMATER_MODQUADRIC_CC
70template<
class DecimaterType>
77 if (!quadrics_.is_valid())
78 Base::mesh().add_property( quadrics_ );
82 v_end = Base::mesh().vertices_end();
84 for (; v_it != v_end; ++v_it)
85 Base::mesh().property(quadrics_, *v_it).
clear();
89 f_end = Base::mesh().faces_end();
95 for (; f_it != f_end; ++f_it)
97 fv_it = Base::mesh().fv_iter(*f_it);
98 vh0 = *fv_it; ++fv_it;
99 vh1 = *fv_it; ++fv_it;
111 Vec3 n = (v1-v0) % (v2-v0);
112 double area = n.norm();
119 const double a = n[0];
120 const double b = n[1];
121 const double c = n[2];
124 Quadricd q(a, b, c, d);
127 Base::mesh().property(quadrics_, vh0) += q;
128 Base::mesh().property(quadrics_, vh1) += q;
129 Base::mesh().property(quadrics_, vh2) += q;
137 if (this->is_binary()) {
138 if (_factor >= 0.0 && _factor <= 1.0) {
142 double new_max_err = max_err_ * _factor / this->error_tolerance_factor_;
143 set_max_err(new_max_err);
144 this->error_tolerance_factor_ = _factor;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
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
/class QuadricT Geometry/QuadricT.hh
Definition QuadricT.hh:83
void clear()
set all entries to zero
Definition QuadricT.hh:166
Definition Vector11T.hh:83
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition PolyMeshT.hh:136
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition PolyMeshT.hh:167
Kernel::FaceIter FaceIter
Scalar type.
Definition PolyMeshT.hh:146
Kernel::VertexIter VertexIter
Scalar type.
Definition PolyMeshT.hh:143
void set_error_tolerance_factor(double _factor) override
set the percentage of maximum quadric error
Definition ModQuadricT_impl.hh:136
virtual void initialize(void) override
Initalize the module and prepare the mesh for decimation.
Definition ModQuadricT_impl.hh:73