Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
decimater.cc
1 //
2 using namespace OpenMesh
3 
4 // ---------------------------------------- necessary types
5 
6 // Mesh type
8 
9 // Decimater type
10 typedef Decimater::DecimaterT< Mesh > Decimater;
11 
12 // Decimation Module Handle type
13 typedef Decimater::ModQuadricT< Mesh >::Handle HModQuadric;
14 
15 // ---------------------------------------- decimater setup
16 
17 Mesh mesh; // a mesh object
18 Decimater decimater(mesh); // a decimater object, connected to a mesh
19 HModQuadric hModQuadric; // use a quadric module
20 
21 decimater.add( hModQuadric ); // register module at the decimater
22 
23 std::cout << decimater.module( hModQuadric ).name() << std::endl;
24  // the way to access the module
25 
26 /*
27  * since we need exactly one priority module (non-binary)
28  * we have to call set_binary(false) for our priority module
29  * in the case of HModQuadric, unset_max_err() calls set_binary(false) internally
30  */
31 decimater.module( hModQuadric ).unset_max_err();
32 
33 decimater.initialize(); // let the decimater initialize the mesh and the
34  // modules
35 
36 decimater.decimate(); // do decimation
37