From 0417bb88d77c652fd301787eb0b110ea062dd6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 25 Jul 2018 10:51:53 +0200 Subject: [PATCH] Hide "remove_degenerate_faces" --- .../PackageDescription.txt | 1 - .../Polygon_mesh_processing.txt | 6 +- .../doc/Polygon_mesh_processing/examples.txt | 2 - .../Polygon_mesh_processing/CMakeLists.txt | 6 +- .../remove_degeneracies_example.cpp | 34 --------- .../remove_degeneracies_example_OM.cpp | 38 ---------- .../CGAL/Polygon_mesh_processing/repair.h | 69 +++++++++---------- .../shape_predicates.h | 1 - .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 2 +- 9 files changed, 42 insertions(+), 117 deletions(-) delete mode 100644 Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp delete mode 100644 Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example_OM.cpp diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 181eb3ddcd7..d937e76949b 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -134,7 +134,6 @@ and provides a list of the parameters that are used in this package. - `CGAL::Polygon_mesh_processing::remove_isolated_vertices()` - `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()` - `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` -- `CGAL::Polygon_mesh_processing::remove_degenerate_faces()` - `CGAL::Polygon_mesh_processing::merge_vertices_in_range()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()` diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index b7ca98e8808..514d3b55397 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -463,8 +463,6 @@ This package offers a toolkit of functions to detect such undesirable elements. - `CGAL::Polygon_mesh_processing::is_cap_triangle_face()` - `CGAL::Polygon_mesh_processing::is_needle_triangle_face()` -This package offers functions to remove such undesirable elements, see Section \ref PMPRepairing. - **************************************** \section PMPOrientation Orientation @@ -555,6 +553,8 @@ with duplicated border edges. \cgalExample{Polygon_mesh_processing/stitch_borders_example.cpp} +\cond + \subsection DegenerateFaces Removing Degenerate Faces Some degenerate faces may be part of a given triangle mesh. @@ -573,6 +573,8 @@ is output. \cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp} +\endcond + \subsection PMPManifoldness Polygon Mesh Manifoldness Non-manifold vertices can be detected using the function `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`. diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt index 03ee471a773..cb09da7d83f 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt @@ -21,7 +21,5 @@ \example Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp \example Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp \example Polygon_mesh_processing/detect_features_example.cpp -\example Polygon_mesh_processing/remove_degeneracies_example.cpp -\example Polygon_mesh_processing/remove_degeneracies_example_OM.cpp \example Polygon_mesh_processing/manifoldness_repair_example.cpp */ diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 15092e7a30f..2a3bc719826 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -89,7 +89,7 @@ create_single_source_cgal_program( "face_filtered_graph_example.cpp") create_single_source_cgal_program( "orient_polygon_soup_example.cpp") create_single_source_cgal_program( "triangulate_polyline_example.cpp") create_single_source_cgal_program( "mesh_slicer_example.cpp") -create_single_source_cgal_program( "remove_degeneracies_example.cpp") +#create_single_source_cgal_program( "remove_degeneracies_example.cpp") create_single_source_cgal_program( "isotropic_remeshing_example.cpp") create_single_source_cgal_program( "isotropic_remeshing_of_patch_example.cpp") create_single_source_cgal_program( "surface_mesh_intersection.cpp") @@ -119,8 +119,8 @@ target_link_libraries( point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) create_single_source_cgal_program( "stitch_borders_example_OM.cpp" ) target_link_libraries( stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) -create_single_source_cgal_program( "remove_degeneracies_example_OM.cpp") -target_link_libraries( remove_degeneracies_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) +#create_single_source_cgal_program( "remove_degeneracies_example_OM.cpp") +#target_link_libraries( remove_degeneracies_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) create_single_source_cgal_program( "triangulate_faces_example_OM.cpp") target_link_libraries( triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp deleted file mode 100644 index c79f9a5337f..00000000000 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; - -typedef CGAL::Surface_mesh Surface_mesh; - -int main(int argc, char* argv[]) -{ - const char* filename = (argc > 1) ? argv[1] : "data/degtri_sliding.off"; - std::ifstream input(filename); - - Surface_mesh mesh; - if (!input || !(input >> mesh) || mesh.is_empty()) { - std::cerr << "Not a valid .off file." << std::endl; - return EXIT_FAILURE; - } - - std::size_t nb = CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh); - - std::cout << "There were " << nb << " degenerate faces in this mesh" << std::endl; - - mesh.collect_garbage(); - std::ofstream out("repaired.off"); - out << mesh; - - return EXIT_SUCCESS; -} diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example_OM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example_OM.cpp deleted file mode 100644 index 46763164848..00000000000 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/remove_degeneracies_example_OM.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include - -#include -#include - -#include -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; - -typedef OpenMesh::PolyMesh_ArrayKernelT< > Mesh; - -namespace PMP = CGAL::Polygon_mesh_processing; - -int main(int argc, char* argv[]) -{ - const char* filename = (argc > 1) ? argv[1] : "data/degtri_sliding.off"; - - Mesh mesh; - if (!OpenMesh::IO::read_mesh(mesh, filename) || num_vertices(mesh)) { - std::cerr << "Not a valid .off file." << std::endl; - return EXIT_FAILURE; - } - - std::size_t nb = PMP::remove_degenerate_faces(mesh, - CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh)) - .geom_traits(K())); - - std::cout << "There were " << nb << " degenerate faces in this mesh" << std::endl; - - mesh.garbage_collection(); - OpenMesh::IO::write_mesh(mesh, "repaired.off"); - - return EXIT_SUCCESS; -} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 88a12acec66..a5af3737c07 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -271,7 +271,6 @@ degenerate_edges(const TriangleMesh& tm, OutputIterator out) /// \cgalParamEnd /// \cgalNamedParamsEnd /// -/// \sa remove_degenerate_faces() template OutputIterator degenerate_faces(const FaceRange& faces, const TriangleMesh& tm, @@ -792,40 +791,40 @@ std::size_t remove_degenerate_edges(const EdgeRange& edge_range, return remove_degenerate_edges(edge_range, tmesh, parameters::all_default()); } -/// \ingroup PMP_repairing_grp -/// removes the degenerate faces from a triangulated surface mesh. -/// A face is considered degenerate if two of its vertices share the same location, -/// or more generally if all its vertices are collinear. -/// -/// @pre `CGAL::is_triangle_mesh(tmesh)` -/// -/// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph` -/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" -/// -/// @param tmesh the triangulated surface mesh to be repaired -/// @param np optional \ref pmp_namedparameters "Named Parameters" described below -/// -/// \cgalNamedParamsBegin -/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. -/// The type of this map is model of `ReadWritePropertyMap`. -/// If this parameter is omitted, an internal property map for -/// `CGAL::vertex_point_t` must be available in `TriangleMesh` -/// \cgalParamEnd -/// \cgalParamBegin{geom_traits} a geometric traits class instance. -/// The traits class must provide the nested type `Point_3`, -/// and the nested functors : -/// - `Compare_distance_3` to compute the distance between 2 points -/// - `Collinear_3` to check whether 3 points are collinear -/// - `Less_xyz_3` to compare lexicographically two points -/// - `Equal_3` to check whether 2 points are identical -/// For each functor `Foo`, a function `Foo foo_object()` -/// \cgalParamEnd -/// \cgalNamedParamsEnd -/// -/// \todo the function might not be able to remove all degenerate faces. -/// We should probably do something with the return type. -/// -/// \return number of removed degenerate faces +// \ingroup PMP_repairing_grp +// removes the degenerate faces from a triangulated surface mesh. +// A face is considered degenerate if two of its vertices share the same location, +// or more generally if all its vertices are collinear. +// +// @pre `CGAL::is_triangle_mesh(tmesh)` +// +// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph` +// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +// +// @param tmesh the triangulated surface mesh to be repaired +// @param np optional \ref pmp_namedparameters "Named Parameters" described below +// +// \cgalNamedParamsBegin +// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. +// The type of this map is model of `ReadWritePropertyMap`. +// If this parameter is omitted, an internal property map for +// `CGAL::vertex_point_t` must be available in `TriangleMesh` +// \cgalParamEnd +// \cgalParamBegin{geom_traits} a geometric traits class instance. +// The traits class must provide the nested type `Point_3`, +// and the nested functors : +// - `Compare_distance_3` to compute the distance between 2 points +// - `Collinear_3` to check whether 3 points are collinear +// - `Less_xyz_3` to compare lexicographically two points +// - `Equal_3` to check whether 2 points are identical +// For each functor `Foo`, a function `Foo foo_object()` +// \cgalParamEnd +// \cgalNamedParamsEnd +// +// \todo the function might not be able to remove all degenerate faces. +// We should probably do something with the return type. +// +// \return number of removed degenerate faces template std::size_t remove_degenerate_faces(TriangleMesh& tmesh, const NamedParameters& np) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h index 4cc98184b7f..35e2a7a0920 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h @@ -117,7 +117,6 @@ bool is_degenerate_edge(typename boost::graph_traits::edge_descript /// \cgalNamedParamsEnd /// /// \sa `degenerate_faces()` -/// \sa `remove_degenerate_faces()` /// /// \return `true` if the face `f` is degenerate, `false` otherwise. template diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index c8b2349fe1c..d286ef3f50f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -54,7 +54,7 @@ public: actionAutorefine->setObjectName("actionAutorefine"); actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections"); - actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); + actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionRemoveSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionRemoveIsolatedVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair");