2 #include <gtest/gtest.h> 3 #include <Unittests/unittests_common.hh> 13 virtual void SetUp() {
19 virtual void TearDown() {
37 TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4_center) {
41 mesh_.request_vertex_status();
42 mesh_.request_edge_status();
43 mesh_.request_face_status();
56 std::vector<Mesh::VertexHandle> face_vhandles;
58 face_vhandles.push_back(vhandle[0]);
59 face_vhandles.push_back(vhandle[1]);
60 face_vhandles.push_back(vhandle[2]);
61 mesh_.add_face(face_vhandles);
63 face_vhandles.clear();
65 face_vhandles.push_back(vhandle[2]);
66 face_vhandles.push_back(vhandle[1]);
67 face_vhandles.push_back(vhandle[3]);
68 Mesh::FaceHandle to_split = mesh_.add_face(face_vhandles);
70 face_vhandles.clear();
72 face_vhandles.push_back(vhandle[2]);
73 face_vhandles.push_back(vhandle[3]);
74 face_vhandles.push_back(vhandle[4]);
75 mesh_.add_face(face_vhandles);
77 face_vhandles.clear();
79 face_vhandles.push_back(vhandle[1]);
80 face_vhandles.push_back(vhandle[5]);
81 face_vhandles.push_back(vhandle[3]);
82 mesh_.add_face(face_vhandles);
101 EXPECT_EQ(4u, mesh_.n_faces());
104 mesh_.
split(to_split);
106 mesh_.garbage_collection();
108 EXPECT_EQ(10u, mesh_.n_faces());
115 TEST_F(OpenMeshSplitTriangleMesh, Split_Triangle_Mesh_1_4_boundary) {
119 mesh_.request_vertex_status();
120 mesh_.request_edge_status();
121 mesh_.request_face_status();
134 std::vector<Mesh::VertexHandle> face_vhandles;
136 face_vhandles.push_back(vhandle[0]);
137 face_vhandles.push_back(vhandle[1]);
138 face_vhandles.push_back(vhandle[2]);
139 Mesh::FaceHandle to_split = mesh_.add_face(face_vhandles);
141 face_vhandles.clear();
143 face_vhandles.push_back(vhandle[2]);
144 face_vhandles.push_back(vhandle[1]);
145 face_vhandles.push_back(vhandle[3]);
146 mesh_.add_face(face_vhandles);
148 face_vhandles.clear();
150 face_vhandles.push_back(vhandle[2]);
151 face_vhandles.push_back(vhandle[3]);
152 face_vhandles.push_back(vhandle[4]);
153 mesh_.add_face(face_vhandles);
155 face_vhandles.clear();
157 face_vhandles.push_back(vhandle[1]);
158 face_vhandles.push_back(vhandle[5]);
159 face_vhandles.push_back(vhandle[3]);
160 mesh_.add_face(face_vhandles);
179 EXPECT_EQ(4u, mesh_.n_faces());
182 mesh_.
split(to_split);
184 mesh_.garbage_collection();
186 EXPECT_EQ(8u, mesh_.n_faces());
Kernel::Point Point
Coordinate type.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
VertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)