1 #include <gtest/gtest.h> 2 #include <Unittests/unittests_common.hh> 7 class OpenMeshBoundaryTriangleMesh :
public OpenMeshBase {
12 virtual void SetUp() {
18 virtual void TearDown() {
35 TEST_F(OpenMeshBoundaryTriangleMesh, TestBoundaryVertex) {
53 std::vector<Mesh::VertexHandle> face_vhandles;
55 face_vhandles.push_back(vhandle[0]);
56 face_vhandles.push_back(vhandle[1]);
57 face_vhandles.push_back(vhandle[2]);
58 mesh_.add_face(face_vhandles);
60 face_vhandles.clear();
62 face_vhandles.push_back(vhandle[1]);
63 face_vhandles.push_back(vhandle[3]);
64 face_vhandles.push_back(vhandle[4]);
65 mesh_.add_face(face_vhandles);
67 face_vhandles.clear();
69 face_vhandles.push_back(vhandle[0]);
70 face_vhandles.push_back(vhandle[3]);
71 face_vhandles.push_back(vhandle[1]);
72 mesh_.add_face(face_vhandles);
74 face_vhandles.clear();
76 face_vhandles.push_back(vhandle[2]);
77 face_vhandles.push_back(vhandle[1]);
78 face_vhandles.push_back(vhandle[4]);
79 mesh_.add_face(face_vhandles);
81 face_vhandles.clear();
83 face_vhandles.push_back(vhandle[5]);
84 face_vhandles.push_back(vhandle[2]);
85 face_vhandles.push_back(vhandle[4]);
86 mesh_.add_face(face_vhandles);
102 EXPECT_TRUE ( mesh_.is_boundary( vhandle[0] ) ) <<
"Vertex 0 is not boundary!";
103 EXPECT_FALSE( mesh_.is_boundary( vhandle[1] ) ) <<
"Vertex 1 is boundary!";
104 EXPECT_TRUE ( mesh_.is_boundary( vhandle[2] ) ) <<
"Vertex 2 is not boundary!";
105 EXPECT_TRUE ( mesh_.is_boundary( vhandle[3] ) ) <<
"Vertex 3 is not boundary!";
106 EXPECT_TRUE ( mesh_.is_boundary( vhandle[4] ) ) <<
"Vertex 4 is not boundary!";
107 EXPECT_TRUE ( mesh_.is_boundary( vhandle[5] ) ) <<
"Vertex 5 is not boundary!";
109 EXPECT_TRUE ( mesh_.is_boundary( vhandle[6] ) ) <<
"Singular Vertex 6 is not boundary!";
116 TEST_F(OpenMeshBoundaryTriangleMesh, TestBoundaryFace) {
134 std::vector<Mesh::VertexHandle> face_vhandles;
135 std::vector<Mesh::FaceHandle> face_handles;
137 face_vhandles.push_back(vhandle[0]);
138 face_vhandles.push_back(vhandle[1]);
139 face_vhandles.push_back(vhandle[2]);
140 face_handles.push_back(mesh_.add_face(face_vhandles));
142 face_vhandles.clear();
144 face_vhandles.push_back(vhandle[1]);
145 face_vhandles.push_back(vhandle[3]);
146 face_vhandles.push_back(vhandle[4]);
147 face_handles.push_back(mesh_.add_face(face_vhandles));
149 face_vhandles.clear();
151 face_vhandles.push_back(vhandle[0]);
152 face_vhandles.push_back(vhandle[3]);
153 face_vhandles.push_back(vhandle[1]);
154 face_handles.push_back(mesh_.add_face(face_vhandles));
156 face_vhandles.clear();
158 face_vhandles.push_back(vhandle[2]);
159 face_vhandles.push_back(vhandle[1]);
160 face_vhandles.push_back(vhandle[4]);
161 face_handles.push_back(mesh_.add_face(face_vhandles));
163 face_vhandles.clear();
165 face_vhandles.push_back(vhandle[5]);
166 face_vhandles.push_back(vhandle[2]);
167 face_vhandles.push_back(vhandle[4]);
168 face_handles.push_back(mesh_.add_face(face_vhandles));
184 EXPECT_TRUE ( mesh_.is_boundary( face_handles[0] ) ) <<
"Face 0 is not boundary!";
185 EXPECT_TRUE ( mesh_.is_boundary( face_handles[1] ) ) <<
"Face 1 is not boundary!";
186 EXPECT_TRUE ( mesh_.is_boundary( face_handles[2] ) ) <<
"Face 2 is not boundary!";
187 EXPECT_FALSE( mesh_.is_boundary( face_handles[3] ) ) <<
"Face 3 is boundary!";
188 EXPECT_TRUE ( mesh_.is_boundary( face_handles[4] ) ) <<
"Face 4 is not boundary!";
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Kernel::Point Point
Coordinate type.