Commit b025acaa authored by Jan Möbius's avatar Jan Möbius

Make delete_face function work without edge status

Added unittests for delete_face



git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@782 fdac6126-5c0c-442c-9429-916003d36597
parent 5b46d7ff
......@@ -532,13 +532,14 @@ void PolyConnectivity::delete_face(FaceHandle _fh, bool _delete_isolated_vertice
set_next_halfedge_handle(prev0, next1);
set_next_halfedge_handle(prev1, next0);
// mark edge deleted
status(*del_it).set_deleted(true);
// mark edge deleted if the mesh has a edge status
if ( has_edge_status() )
status(*del_it).set_deleted(true);
// mark corresponding halfedges as deleted
// As the deleted edge is boundary,
// all corresponding halfedges will also e deleted.
// all corresponding halfedges will also be deleted.
if ( has_halfedge_status() ) {
status(h0).set_deleted(true);
status(h1).set_deleted(true);
......
......@@ -253,7 +253,7 @@ public:
void delete_edge(EdgeHandle _eh, bool _delete_isolated_vertices=true);
/** Delete face _fh and resulting degenerated empty halfedges as
well. Resultling isolated vertices will be deleted if
well. Resulting isolated vertices will be deleted if
_delete_isolated_vertices is true.
\attention All item will only be marked to be deleted. They will
......
......@@ -14,6 +14,7 @@
#include "unittests_trimesh_normal_calculations.hh"
#include "unittests_trimesh_others.hh"
#include "unittests_add_face.hh"
#include "unittests_delete_face.hh"
#include "unittests_faceless_mesh.hh"
#include "unittests_trimesh_garbage_collection.hh"
#include "unittests_randomNumberGenerator.hh"
......
......@@ -250,8 +250,11 @@ TEST_F(OpenMeshAddFaceTriangleMesh, CreateTriangleMeshCube) {
//
// Check setup
EXPECT_EQ(8u, mesh_.n_vertices() ) << "Wrong number of vertices";
EXPECT_EQ(12u, mesh_.n_faces() ) << "Wrong number of faces";
EXPECT_EQ(18u, mesh_.n_edges() ) << "Wrong number of Edges";
EXPECT_EQ(36u, mesh_.n_halfedges() ) << "Wrong number of HalfEdges";
EXPECT_EQ(8u, mesh_.n_vertices() ) << "Wrong number of vertices";
EXPECT_EQ(12u, mesh_.n_faces() ) << "Wrong number of faces";
}
......@@ -419,8 +422,10 @@ TEST_F(OpenMeshAddFacePolyMesh, CreatePolyMeshCube) {
//
// Check setup
EXPECT_EQ(8u, mesh_.n_vertices() ) << "Wrong number of vertices";
EXPECT_EQ(6u, mesh_.n_faces() ) << "Wrong number of faces";
EXPECT_EQ(12u, mesh_.n_edges() ) << "Wrong number of Edges";
EXPECT_EQ(24u, mesh_.n_halfedges() ) << "Wrong number of HalfEdges";
EXPECT_EQ(8u, mesh_.n_vertices() ) << "Wrong number of vertices";
EXPECT_EQ(6u, mesh_.n_faces() ) << "Wrong number of faces";
}
......
This diff is collapsed.
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