Commit 47fcf4ed authored by Jan Möbius's avatar Jan Möbius

Split test into two blocks

parent b303f73f
Pipeline #4857 failed with stage
in 77 minutes and 1 second
......@@ -34,7 +34,7 @@ class OpenMeshSplitTriangleMesh : public OpenMeshBase {
/* splits a face that has a property in a triangle mesh with split_copy
* the property should be copied to the new faces
*/
TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4) {
TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4_center) {
mesh_.clear();
......@@ -107,18 +107,87 @@ TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4) {
EXPECT_EQ(10u, mesh_.n_faces());
Mesh::FaceHandle boundary_split = mesh_.face_handle(0);
}
// split face at boundary
mesh_.split(boundary_split);
/* splits a face that has a property in a triangle mesh with split_copy
* the property should be copied to the new faces
*/
TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4_boundary) {
mesh_.garbage_collection();
mesh_.clear();
EXPECT_EQ(15u, mesh_.n_faces());
mesh_.request_vertex_status();
mesh_.request_edge_status();
mesh_.request_face_status();
// Add some vertices
Mesh::VertexHandle vhandle[6];
vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
vhandle[1] = mesh_.add_vertex(Mesh::Point(1, 0, 0));
vhandle[2] = mesh_.add_vertex(Mesh::Point(2, 1, 0));
vhandle[3] = mesh_.add_vertex(Mesh::Point(3, 0, 0));
vhandle[4] = mesh_.add_vertex(Mesh::Point(4, 1, 0));
vhandle[5] = mesh_.add_vertex(Mesh::Point(2,-1, 0));
// Add three faces
std::vector<Mesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
Mesh::FaceHandle to_split = mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[3]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[4]);
mesh_.add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[5]);
face_vhandles.push_back(vhandle[3]);
mesh_.add_face(face_vhandles);
/* Test setup:
*
* edge x => halfedge x/x+1
* i.e. edge 0 => halfedge 0/1
*
* 0 --4--- 2 ------ 4
* \ / \ /
* 0 0 2 6 2 /
* \ / 1 \ /
* 1 ---8--- 3
* \ /
* \ 3 /
* \ /
* \ /
* 5
*/
EXPECT_EQ(4u, mesh_.n_faces());
// split face at boundary
mesh_.split(to_split);
mesh_.garbage_collection();
EXPECT_EQ(8u, mesh_.n_faces());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment