Developer Documentation

decimater.cc
1 using namespace OpenMesh;
2
3 typedef TriMesh_ArrayKernelT<> Mesh;
4 typedef Decimater::DecimaterT<Mesh> Decimater;
5 typedef Decimater::ModQuadricT<Mesh>::Handle HModQuadric;
6
7 Mesh mesh; // a mesh object
8 Decimater decimater(mesh); // a decimater object, connected to a mesh
9 HModQuadric hModQuadric; // use a quadric module
10
11 decimater.add(hModQuadric); // register module at the decimater
12 std::cout << decimater.module(hModQuadric).name() << std::endl; // module access
13
14 /*
15 * since we need exactly one priority module (non-binary)
16 * we have to call set_binary(false) for our priority module
17 * in the case of HModQuadric, unset_max_err() calls set_binary(false) internally
18 */
19 decimater.module(hModQuadric).unset_max_err();
20
21 decimater.initialize();
22 decimater.decimate();
23
24 // after decimation: remove decimated elements from the mesh
25 mesh.garbage_collection();
OpenMesh::TriMesh_ArrayKernelT
Definition: PolyMesh_ArrayKernelT.hh:73
OpenMesh
Definition: MeshItems.hh:59