Commit 5a2f426d authored by Christian Mattes's avatar Christian Mattes

Unittests now use the Point/Normal types related to the mesh type, instead of...

Unittests now use the Point/Normal types related to the mesh type, instead of relying on them being OpenMesh vectors.
parent 377562d1
......@@ -247,7 +247,7 @@ TEST_F(OpenMeshNormals, NormalCalculations_calc_vertex_normal_fast) {
mesh_.request_face_normals();
OpenMesh::Vec3f normal;
Mesh::Normal normal;
mesh_.calc_vertex_normal_fast(vhandle[2],normal);
......@@ -304,7 +304,7 @@ TEST_F(OpenMeshNormals, NormalCalculations_calc_vertex_normal_correct) {
mesh_.request_halfedge_normals();
mesh_.request_face_normals();
OpenMesh::Vec3f normal;
Mesh::Normal normal;
mesh_.calc_vertex_normal_correct(vhandle[2],normal);
......@@ -361,7 +361,7 @@ TEST_F(OpenMeshNormals, NormalCalculations_calc_vertex_normal_loop) {
mesh_.request_halfedge_normals();
mesh_.request_face_normals();
OpenMesh::Vec3f normal;
Mesh::Normal normal;
mesh_.calc_vertex_normal_loop(vhandle[2],normal);
......
......@@ -164,7 +164,8 @@ TEST_F(OpenMeshOthers, CalcDihedralAngre ) {
EXPECT_EQ( 0.0 , mesh_.calc_dihedral_angle(eh) ) << "Wrong Dihedral angle!" << std::endl;
// Modify point
Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) ) * static_cast<Mesh::Point::value_type>(0.5);
Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) )
* static_cast<typename OpenMesh::vector_traits<typename Mesh::Point>::value_type>(0.5);
mesh_.point(vhandle[2]) = tmp;
double difference = fabs( 1.36944 - mesh_.calc_dihedral_angle(eh) );
......
......@@ -622,14 +622,14 @@ TEST_F(OpenMeshTutorials, deleting_geometry_elements) {
MyMeshWithStatus::VertexHandle vhandle[8];
MyMeshWithStatus::FaceHandle fhandle[6];
vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, -1, 1));
vhandle[1] = mesh.add_vertex(MyMesh::Point( 1, -1, 1));
vhandle[2] = mesh.add_vertex(MyMesh::Point( 1, 1, 1));
vhandle[3] = mesh.add_vertex(MyMesh::Point(-1, 1, 1));
vhandle[4] = mesh.add_vertex(MyMesh::Point(-1, -1, -1));
vhandle[5] = mesh.add_vertex(MyMesh::Point( 1, -1, -1));
vhandle[6] = mesh.add_vertex(MyMesh::Point( 1, 1, -1));
vhandle[7] = mesh.add_vertex(MyMesh::Point(-1, 1, -1));
vhandle[0] = mesh.add_vertex(Mesh::Point(-1, -1, 1));
vhandle[1] = mesh.add_vertex(Mesh::Point( 1, -1, 1));
vhandle[2] = mesh.add_vertex(Mesh::Point( 1, 1, 1));
vhandle[3] = mesh.add_vertex(Mesh::Point(-1, 1, 1));
vhandle[4] = mesh.add_vertex(Mesh::Point(-1, -1, -1));
vhandle[5] = mesh.add_vertex(Mesh::Point( 1, -1, -1));
vhandle[6] = mesh.add_vertex(Mesh::Point( 1, 1, -1));
vhandle[7] = mesh.add_vertex(Mesh::Point(-1, 1, -1));
// generate (quadrilateral) faces
std::vector<MyMesh::VertexHandle> tmp_face_vhandles;
......@@ -807,10 +807,10 @@ TEST_F(OpenMeshTutorials, flipping_edges) {
Mesh mesh;
// Add some vertices
Mesh::VertexHandle vhandle[4];
vhandle[0] = mesh.add_vertex(MyMesh::Point(0, 0, 0));
vhandle[1] = mesh.add_vertex(MyMesh::Point(0, 1, 0));
vhandle[2] = mesh.add_vertex(MyMesh::Point(1, 1, 0));
vhandle[3] = mesh.add_vertex(MyMesh::Point(1, 0, 0));
vhandle[0] = mesh.add_vertex(Mesh::Point(0, 0, 0));
vhandle[1] = mesh.add_vertex(Mesh::Point(0, 1, 0));
vhandle[2] = mesh.add_vertex(Mesh::Point(1, 1, 0));
vhandle[3] = mesh.add_vertex(Mesh::Point(1, 0, 0));
// Add two faces
std::vector<Mesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[2]);
......@@ -846,13 +846,13 @@ TEST_F(OpenMeshTutorials, collapsing_edges) {
mesh.request_edge_status();
// Add some vertices as in the illustration above
PolyMesh::VertexHandle vhandle[7];
vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, 1, 0));
vhandle[1] = mesh.add_vertex(MyMesh::Point(-1, 3, 0));
vhandle[2] = mesh.add_vertex(MyMesh::Point(0, 0, 0));
vhandle[3] = mesh.add_vertex(MyMesh::Point(0, 2, 0));
vhandle[4] = mesh.add_vertex(MyMesh::Point(0, 4, 0));
vhandle[5] = mesh.add_vertex(MyMesh::Point(1, 1, 0));
vhandle[6] = mesh.add_vertex(MyMesh::Point(1, 3, 0));
vhandle[0] = mesh.add_vertex(PolyMesh::Point(-1, 1, 0));
vhandle[1] = mesh.add_vertex(PolyMesh::Point(-1, 3, 0));
vhandle[2] = mesh.add_vertex(PolyMesh::Point(0, 0, 0));
vhandle[3] = mesh.add_vertex(PolyMesh::Point(0, 2, 0));
vhandle[4] = mesh.add_vertex(PolyMesh::Point(0, 4, 0));
vhandle[5] = mesh.add_vertex(PolyMesh::Point(1, 1, 0));
vhandle[6] = mesh.add_vertex(PolyMesh::Point(1, 3, 0));
// Add three quad faces
std::vector<PolyMesh::VertexHandle> face_vhandles;
face_vhandles.push_back(vhandle[1]);
......
......@@ -185,7 +185,7 @@ LoadInfo open_progresult_mesh(const std::string& _filename)
OpenMesh::IO::restore(ifs, vr, swap);
PMInfo pminfo;
pminfo.p0 = p;
pminfo.p0 = OpenMesh::vector_cast<Mesh::Point>(p);
pminfo.v0 = result.mesh.add_vertex(p);
pminfo.v1 = Mesh::VertexHandle(v1);
pminfo.vl = Mesh::VertexHandle(vl);
......
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