1 #ifndef INCLUDE_UNITTESTS_TRIMESH_OTHERS_HH
2 #define INCLUDE_UNITTESTS_TRIMESH_OTHERS_HH
4 #include <gtest/gtest.h>
5 #include <Unittests/unittests_common.hh>
14 virtual void SetUp() {
18 virtual void TearDown() {
41 Mesh::VertexHandle vhandle[4];
43 vhandle[0] = mesh_.add_vertex(Mesh::Point(0, 0, 0));
44 vhandle[1] = mesh_.add_vertex(Mesh::Point(0, 1, 0));
45 vhandle[2] = mesh_.add_vertex(Mesh::Point(1, 1, 0));
46 vhandle[3] = mesh_.add_vertex(Mesh::Point(0, 0, 1));
49 std::vector<Mesh::VertexHandle> face_vhandles;
51 face_vhandles.push_back(vhandle[0]);
52 face_vhandles.push_back(vhandle[1]);
53 face_vhandles.push_back(vhandle[2]);
54 mesh_.add_face(face_vhandles);
56 face_vhandles.clear();
58 face_vhandles.push_back(vhandle[0]);
59 face_vhandles.push_back(vhandle[2]);
60 face_vhandles.push_back(vhandle[3]);
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_.add_face(face_vhandles);
70 face_vhandles.clear();
72 face_vhandles.push_back(vhandle[3]);
73 face_vhandles.push_back(vhandle[1]);
74 face_vhandles.push_back(vhandle[0]);
75 mesh_.add_face(face_vhandles);
86 mesh_.request_vertex_normals();
87 mesh_.request_halfedge_normals();
88 mesh_.request_face_normals();
92 mesh_.update_normals();
94 Mesh::HalfedgeIter he_it = mesh_.halfedges_begin();
96 EXPECT_TRUE(mesh_.is_estimated_feature_edge(he_it,0.0)) <<
"Wrong feature edge detection 0.0";
98 EXPECT_TRUE(mesh_.is_estimated_feature_edge(he_it,0.125 * M_PI)) <<
"Wrong feature edge detection 0.125";
100 EXPECT_TRUE(mesh_.is_estimated_feature_edge(he_it,0.25 * M_PI)) <<
"Wrong feature edge detection 0.25";
102 EXPECT_TRUE(mesh_.is_estimated_feature_edge(he_it,0.375 * M_PI)) <<
"Wrong feature edge detection 0.375";
104 EXPECT_TRUE(mesh_.is_estimated_feature_edge(he_it,0.5 * M_PI)) <<
"Wrong feature edge detection 0.5";
106 EXPECT_FALSE(mesh_.is_estimated_feature_edge(he_it,0.625 * M_PI))<<
"Wrong feature edge detection 0.625";
108 EXPECT_FALSE(mesh_.is_estimated_feature_edge(he_it,0.75 * M_PI)) <<
"Wrong feature edge detection 0.75";
110 EXPECT_FALSE(mesh_.is_estimated_feature_edge(he_it,0.875 * M_PI))<<
"Wrong feature edge detection 0.875";
112 EXPECT_FALSE(mesh_.is_estimated_feature_edge(he_it,1.0 * M_PI)) <<
"Wrong feature edge detection 1.0";
116 #endif // INCLUDE GUARD