1 #ifndef INCLUDE_UNITTESTS_OpenMeshSplitCopy_HH
2 #define INCLUDE_UNITTESTS_OpenMeshSplitCopy_HH
4 #include <gtest/gtest.h>
5 #include <Unittests/unittests_common.hh>
13 virtual void SetUp() {
19 virtual void TearDown() {
33 virtual void SetUp() {
39 virtual void TearDown() {
62 Mesh::VertexHandle vhandle[4];
64 vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 0, 0));
65 vhandle[1] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
66 vhandle[2] = mesh_.add_vertex(Mesh::Point(1, 1, 0));
67 vhandle[3] = mesh_.add_vertex(Mesh::Point(0.25, 0.25, 0));
70 std::vector<Mesh::VertexHandle> face_vhandles;
72 face_vhandles.push_back(vhandle[2]);
73 face_vhandles.push_back(vhandle[1]);
74 face_vhandles.push_back(vhandle[0]);
76 Mesh::FaceHandle fh = mesh_.add_face(face_vhandles);
87 mesh_.add_property(fprop_int);
88 mesh_.property(fprop_int, fh) = 999;
91 mesh_.split_copy(fh, vhandle[3]);
94 Mesh::FaceIter f_it = mesh_.faces_begin();
95 Mesh::FaceIter f_end = mesh_.faces_end();
96 for (; f_it != f_end; ++f_it)
97 EXPECT_EQ(999, mesh_.property(fprop_int, f_it)) <<
"Different Property value";
108 Mesh::VertexHandle vhandle[5];
117 std::vector<Mesh::VertexHandle> face_vhandles;
119 face_vhandles.push_back(vhandle[0]);
120 face_vhandles.push_back(vhandle[1]);
121 face_vhandles.push_back(vhandle[2]);
122 face_vhandles.push_back(vhandle[3]);
124 PolyMesh::FaceHandle fh = mesh_.add_face(face_vhandles);
135 mesh_.add_property(fprop_int);
136 mesh_.property(fprop_int, fh) = 999;
139 mesh_.split_copy(fh, vhandle[4]);
142 PolyMesh::FaceIter f_it = mesh_.faces_begin();
143 PolyMesh::FaceIter f_end = mesh_.faces_end();
144 for (; f_it != f_end; ++f_it)
145 EXPECT_EQ(999, mesh_.property(fprop_int, f_it)) <<
"Different Property value";
149 #endif // INCLUDE GUARD