1 #ifndef INCLUDE_UNITTESTS_DECIMATER_HH
2 #define INCLUDE_UNITTESTS_DECIMATER_HH
4 #include <gtest/gtest.h>
5 #include <Unittests/unittests_common.hh>
15 virtual void SetUp() {
21 virtual void TearDown() {
44 typedef OpenMesh::Decimater::DecimaterT< Mesh > Decimater;
45 typedef OpenMesh::Decimater::ModQuadricT< Decimater >::Handle HModQuadric;
46 typedef OpenMesh::Decimater::ModNormalFlippingT< Decimater >::Handle HModNormal;
48 Decimater decimaterDBG(mesh_);
49 HModQuadric hModQuadricDBG;
50 decimaterDBG.add( hModQuadricDBG );
51 decimaterDBG.initialize();
52 int removedVertices = 0;
53 removedVertices = decimaterDBG.decimate_to(5000);
54 decimaterDBG.mesh().garbage_collection();
56 EXPECT_EQ(2526, removedVertices) <<
"The number of remove vertices is not correct!";
57 EXPECT_EQ(5000, mesh_.n_vertices()) <<
"The number of vertices after decimation is not correct!";
58 EXPECT_EQ(14994, mesh_.n_edges()) <<
"The number of edges after decimation is not correct!";
59 EXPECT_EQ(9996, mesh_.n_faces()) <<
"The number of faces after decimation is not correct!";
62 #endif // INCLUDE GUARD