2 #include <gtest/gtest.h> 3 #include <Unittests/unittests_common.hh> 8 class OpenMeshSplitCopyTriangleMesh :
public OpenMeshBase {
13 virtual void SetUp() {
19 virtual void TearDown() {
33 virtual void SetUp() {
39 virtual void TearDown() {
57 TEST_F(OpenMeshSplitCopyTriangleMesh, SplitCopyTriangleMesh) {
60 mesh_.request_face_status();
61 mesh_.request_edge_status();
73 std::vector<Mesh::VertexHandle> face_vhandles;
75 face_vhandles.push_back(vhandle[2]);
76 face_vhandles.push_back(vhandle[1]);
77 face_vhandles.push_back(vhandle[0]);
79 Mesh::FaceHandle fh = mesh_.add_face(face_vhandles);
80 Mesh::EdgeHandle eh = *mesh_.edges_begin();
91 mesh_.add_property(fprop_int);
92 mesh_.property(fprop_int, fh) = 999;
94 mesh_.status(fh).set_tagged(
true);
100 Mesh::FaceIter f_it = mesh_.faces_begin();
101 Mesh::FaceIter f_end = mesh_.faces_end();
102 for (; f_it != f_end; ++f_it)
104 EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) <<
"Different Property value";
105 EXPECT_TRUE(mesh_.status(*f_it).tagged()) <<
"Different internal property value";
110 mesh_.add_property(eprop_int);
111 mesh_.property(eprop_int, eh) = 999;
113 mesh_.status(eh).set_feature(
true);
117 Mesh::EdgeHandle eh0 = mesh_.edge_handle( mesh_.next_halfedge_handle( mesh_.halfedge_handle(eh, 1) ) );
118 EXPECT_EQ(999, mesh_.property(eprop_int, eh0)) <<
"Different Property value";
119 EXPECT_TRUE(mesh_.status(eh0).feature()) <<
"Different internal property value";
125 TEST_F(OpenMeshSplitCopyPolyMesh, SplitCopyPolymesh) {
128 mesh_.request_face_status();
140 std::vector<Mesh::VertexHandle> face_vhandles;
142 face_vhandles.push_back(vhandle[0]);
143 face_vhandles.push_back(vhandle[1]);
144 face_vhandles.push_back(vhandle[2]);
145 face_vhandles.push_back(vhandle[3]);
147 PolyMesh::FaceHandle fh = mesh_.add_face(face_vhandles);
158 mesh_.add_property(fprop_int);
159 mesh_.property(fprop_int, fh) = 999;
161 mesh_.status(fh).set_tagged(
true);
167 PolyMesh::FaceIter f_it = mesh_.faces_begin();
168 PolyMesh::FaceIter f_end = mesh_.faces_end();
169 for (; f_it != f_end; ++f_it)
171 EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) <<
"Different Property value";
172 EXPECT_TRUE(mesh_.status(*f_it).tagged()) <<
"Different internal property value";
SmartVertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Kernel::Point Point
Coordinate type.
SmartVertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.