48 #ifndef OSG_MODQUADRIC_HH 49 #define OSG_MODQUADRIC_HH 56 #include <OpenMesh/Core/Utils/Property.hh> 57 #include <OpenMesh/Core/Utils/vector_cast.hh> 74 template <
class MeshT>
92 Base::mesh().add_property( quadrics_ );
99 Base::mesh().remove_property(quadrics_);
119 Q q = Base::mesh().property(quadrics_, _ci.
v0);
120 q += Base::mesh().property(quadrics_, _ci.
v1);
122 double err = q(_ci.
p1);
129 return float( (err < max_err_) ? err :
float( Base::ILLEGAL_COLLAPSE ) );
136 Base::mesh().property(quadrics_, _ci.
v1) +=
137 Base::mesh().property(quadrics_, _ci.
v0);
156 Base::set_binary(_binary);
164 Base::set_binary(
false);
184 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_DECIMATER_MODQUADRIC_CC) 185 #define OSG_MODQUADRIC_TEMPLATES 189 #endif // OSG_MODQUADRIC_HH defined Handle representing a vertex property.
Definition: Property.hh:484
Mesh::VertexHandle v1
Remaining vertex.
Definition: CollapseInfoT.hh:92
virtual ~ModQuadricT()
Destructor.
Definition: ModQuadricT.hh:97
ModQuadricT(MeshT &_mesh)
Constructor.
Definition: ModQuadricT.hh:88
/class QuadricT Geometry/QuadricT.hh
Definition: QuadricT.hh:82
Mesh decimation module computing collapse priority based on error quadrics.
Definition: ModQuadricT.hh:75
void set_error_tolerance_factor(double _factor) override
set the percentage of maximum quadric error
Definition: ModQuadricT_impl.hh:136
void set_max_err(double _err, bool _binary=true)
Set maximum quadric error constraint and enable binary mode.
Definition: ModQuadricT.hh:153
void unset_max_err(void)
Unset maximum quadric error constraint and restore non-binary mode.
Definition: ModQuadricT.hh:161
Base class for all decimation modules.
virtual void postprocess_collapse(const CollapseInfo &_ci) override
Post-process halfedge collapse (accumulate quadrics)
Definition: ModQuadricT.hh:134
virtual float collapse_priority(const CollapseInfo &_ci) override
Compute collapse priority based on error quadrics.
Definition: ModQuadricT.hh:113
#define DECIMATING_MODULE(Classname, MeshT, Name)
Convenience macro, to be used in derived modules The macro defines the types.
Definition: ModBaseT.hh:149
Base class for all decimation modules.
Definition: ModBaseT.hh:192
virtual void initialize(void) override
Initalize the module and prepare the mesh for decimation.
Definition: ModQuadricT_impl.hh:73
Mesh::Point p1
Positions of remaining vertex.
Definition: CollapseInfoT.hh:94
Bodies of template member function.
double max_err() const
Return value of max. allowed error.
Definition: ModQuadricT.hh:168
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Stores information about a halfedge collapse.
Definition: CollapseInfoT.hh:74
Mesh::VertexHandle v0
Vertex to be removed.
Definition: CollapseInfoT.hh:91