added check for overloaded split_copy with edgehandle as first parameter
to unittest
This commit is contained in:
@@ -58,14 +58,16 @@ TEST_F(OpenMeshSplitCopyTriangleMesh, SplitCopyTriangleMesh) {
|
|||||||
|
|
||||||
mesh_.clear();
|
mesh_.clear();
|
||||||
mesh_.request_face_status();
|
mesh_.request_face_status();
|
||||||
|
mesh_.request_edge_status();
|
||||||
|
|
||||||
// Add some vertices
|
// Add some vertices
|
||||||
Mesh::VertexHandle vhandle[4];
|
Mesh::VertexHandle vhandle[5];
|
||||||
|
|
||||||
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 0, 0));
|
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 0, 0));
|
||||||
vhandle[1] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
|
vhandle[1] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
|
||||||
vhandle[2] = mesh_.add_vertex(Mesh::Point(1, 1, 0));
|
vhandle[2] = mesh_.add_vertex(Mesh::Point(1, 1, 0));
|
||||||
vhandle[3] = mesh_.add_vertex(Mesh::Point(0.25, 0.25, 0));
|
vhandle[3] = mesh_.add_vertex(Mesh::Point(0.25, 0.25, 0));
|
||||||
|
vhandle[4] = mesh_.add_vertex(Mesh::Point(0.5, 0.5, 0));
|
||||||
|
|
||||||
// Add one face
|
// Add one face
|
||||||
std::vector<Mesh::VertexHandle> face_vhandles;
|
std::vector<Mesh::VertexHandle> face_vhandles;
|
||||||
@@ -75,6 +77,7 @@ TEST_F(OpenMeshSplitCopyTriangleMesh, SplitCopyTriangleMesh) {
|
|||||||
face_vhandles.push_back(vhandle[0]);
|
face_vhandles.push_back(vhandle[0]);
|
||||||
|
|
||||||
Mesh::FaceHandle fh = mesh_.add_face(face_vhandles);
|
Mesh::FaceHandle fh = mesh_.add_face(face_vhandles);
|
||||||
|
Mesh::EdgeHandle eh = *mesh_.edges_begin();
|
||||||
|
|
||||||
// Test setup:
|
// Test setup:
|
||||||
// 1 === 2
|
// 1 === 2
|
||||||
@@ -101,6 +104,19 @@ TEST_F(OpenMeshSplitCopyTriangleMesh, SplitCopyTriangleMesh) {
|
|||||||
EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) << "Different Property value";
|
EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) << "Different Property value";
|
||||||
EXPECT_TRUE(mesh_.status(*f_it).tagged()) << "Different internal property value";
|
EXPECT_TRUE(mesh_.status(*f_it).tagged()) << "Different internal property value";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check the function overload for edgehandles
|
||||||
|
OpenMesh::EPropHandleT<int> eprop_int;
|
||||||
|
mesh_.add_property(eprop_int);
|
||||||
|
mesh_.property(eprop_int, eh) = 999;
|
||||||
|
//set internal property
|
||||||
|
mesh_.status(eh).set_feature(true);
|
||||||
|
//split edge with new vertex
|
||||||
|
mesh_.split_copy(eh, vhandle[4]);
|
||||||
|
// Check setup
|
||||||
|
Mesh::EdgeHandle eh0 = mesh_.edge_handle( mesh_.next_halfedge_handle( mesh_.halfedge_handle(eh, 1) ) );
|
||||||
|
EXPECT_EQ(999, mesh_.property(eprop_int, eh0)) << "Different Property value";
|
||||||
|
EXPECT_TRUE(mesh_.status(eh0).feature()) << "Different internal property value";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* splits a face that has a property in a poly mesh with split_copy
|
/* splits a face that has a property in a poly mesh with split_copy
|
||||||
|
|||||||
Reference in New Issue
Block a user