This implementation does a halfedge collapse, hence simply collapsing one vertex into another connected by a halfedge.
This framework allows to use more than one decimation module with some restrictions. Since the error value is always normalized and sometimes very difficult to compare to other metrics, the framework allows only one non-binary module, i.e. a module computing a float value. Every further module must be a binary module, i.e. collapse_prioerity() returns OpenMesh::Decimater::ModBaseT::LEGAL_COLLAPSE or OpenMesh::Decimater::ModBaseT::ILLEGAL_COLLAPSE. In the algorithm the binary modules are evaluated first. If the evaluated collapse passes the test, then the non-binary module contributes to the decision step.
In some cases the module does not contribute anything to the decision engine of the decimater, but instead, e.g. simply collects information, while the decimater does it's work. For instance the module OpenMesh::Decimater::ModProgMeshT collects information from all collapses that have been done. This information can be used to generate progressive meshes as described in "Progressive meshes", Hoppe, 1996.
Provided decimation modules:
See Basic Setup.
// using namespace OpenMesh // ---------------------------------------- necessary types // Mesh type typedef TriMesh_ArrayKernelT<> Mesh; // Decimater type typedef Decimater::DecimaterT< Mesh > Decimater; // Decimation Module Handle type typedef Decimater::ModQuadricT< decimater >::Handle HModQuadric; // ---------------------------------------- decimater setup Mesh mesh; // a mesh object Decimater decimater(mesh); // a decimater object, connected to a mesh HModQuadric hModQuadric; // use a quadric module decimater.add( hModQuadric ); // register module at the decimater std::cout << decimater.module( hModQuadric ).name() << std::endl; // the way to access the module decimater.initialize(); // let the decimater initialize the mesh and the // modules decimater.decimate(); // do decimation