Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
unittests_mesh_dual.cc
1 
2 #include <gtest/gtest.h>
3 #include <Unittests/unittests_common.hh>
4 #include <OpenMesh/Tools/Dualizer/meshDualT.hh>
5 
6 namespace {
7 
8 class OpenMeshMeshDual : public OpenMeshBasePoly {
9 
10  protected:
11 
12  // This function is called before each test is run
13  virtual void SetUp() {
14 
15  // Do some initial stuff with the member data here...
16  }
17 
18  // This function is called after all tests are through
19  virtual void TearDown() {
20 
21  // Do some final stuff with the member data here...
22  }
23 
24  // Member already defined in OpenMeshBase
25  //Mesh mesh_;
26 };
27 
28 /*
29  * ====================================================================
30  * Define tests below
31  * ====================================================================
32  */
33 
34 /*
35  */
36 TEST_F(OpenMeshMeshDual, Dualize) {
37 
38  bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off");
39 
40  ASSERT_TRUE(ok);
41 
42  PolyMesh* dualMesh;
43 
44  dualMesh = OpenMesh::Util::MeshDual(mesh_);
45 
46  EXPECT_EQ(15048u, dualMesh->n_vertices()) << "The number of vertices after dual computation is not correct!";
47  EXPECT_EQ(22572u, dualMesh->n_edges()) << "The number of edges after dual computation is not correct!";
48  EXPECT_EQ(7526u, dualMesh->n_faces()) << "The number of faces after dual computation is not correct!";
49 
50  delete(dualMesh);
51 }
52 }
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Definition: MeshIO.hh:104