diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index ae7bc1ae994..61976557d42 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -645,10 +645,10 @@ Release date: July 2023 [`Face_count_ratio_stop_predicate`](https://doc.cgal.org/5.6/Surface_mesh_simplification/classCGAL_1_1Surface__mesh__simplification_1_1Face__count__ratio__stop__predicate.html), which can be used to stop the simplification algorithm based on a desired number of faces in the output, or a ratio between input and output face numbers. -- Added the class `CGAL::Surface_mesh_simplification::GarlandHeckbert_plane_and_line_policies`, which provides improved output for `CGAL::Surface_mesh_simplification::edge_collapse`. +- Added the class `CGAL::Surface_mesh_simplification::GarlandHeckbert_plane_and_line_policies`, which provides improved output for `CGAL::Surface_mesh_simplification::edge_collapse()`. That class works the same as previous `GarlandHeckbert_policies`. - Its constructor accepts a `Mesh` and optional NamedParameters to set the weight of the line policy relative to the plane policy, set the boundary cost multiplier or provide vertex normals. -- `CGAL::Surface_mesh_simplification::GarlandHeckbert_policies.h` is now an alias of `CGAL::Surface_mesh_simplification::GarlandHeckbert_plane_and_line_policies.h` and is no longer deprecated. + Its constructor accepts a `Mesh` and optional named parameters to set the weight of the line policy relative to the plane policy, set the boundary cost multiplier or provide vertex normals. +- **Breaking change**: `CGAL::Surface_mesh_simplification::GarlandHeckbert_policies.h` is now an alias of `CGAL::Surface_mesh_simplification::GarlandHeckbert_plane_and_line_policies.h` and is no longer deprecated. ### [2D Regularized Boolean Set Operations](https://doc.cgal.org/5.6/Manual/packages.html#PkgBooleanSetOperations2) - Exposed all required member functions of the diff --git a/Surface_mesh_simplification/benchmark/Surface_mesh_simplification/bench_garland_heckbert.cpp b/Surface_mesh_simplification/benchmark/Surface_mesh_simplification/bench_garland_heckbert.cpp index 89f840b63ac..08b2cf3aeb2 100644 --- a/Surface_mesh_simplification/benchmark/Surface_mesh_simplification/bench_garland_heckbert.cpp +++ b/Surface_mesh_simplification/benchmark/Surface_mesh_simplification/bench_garland_heckbert.cpp @@ -28,8 +28,6 @@ typedef Kernel::Point_3 Point_3; typedef CGAL::Surface_mesh Surface_mesh; namespace SMS = CGAL::Surface_mesh_simplification; - - namespace PMP = CGAL::Polygon_mesh_processing; typedef SMS::GarlandHeckbert_plane_policies Classic_plane; @@ -72,7 +70,6 @@ double collapse_gh(Surface_mesh& mesh, typedef typename GHPolicies::Get_placement GH_placement; typedef SMS::Bounded_normal_change_filter<> Filter; - // GHPolicies gh_policies(mesh); const GH_cost& gh_cost = gh_policies.get_cost(); const GH_placement& gh_placement = gh_policies.get_placement(); @@ -83,9 +80,10 @@ double collapse_gh(Surface_mesh& mesh, return (std::chrono::duration_cast(end_time - start_time).count()) / 1000.; } -std::string getFileNameWithoutExtension(const std::string& filePath) { - std::filesystem::path path(filePath); - return path.stem().string(); // 'stem' gets the filename without extension +std::string getFileNameWithoutExtension(const std::string& filePath) +{ + std::filesystem::path path(filePath); + return path.stem().string(); // 'stem' gets the filename without extension } int main(int argc, char** argv) diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h index f0f062a68be..0325f5093ff 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h @@ -5,12 +5,12 @@ namespace Surface_mesh_simplification { \ingroup PkgSurfaceMeshSimplificationRef The class `GarlandHeckbert_plane_and_line_policies` regroups the cost and placement policies -based on the Garland-Heckbert "Plane and line" strategy of Liu and colleagues \cgalCite{liu2025linequadrics} +based on the Garland-Heckbert "Plane and line" strategy of Liu and colleagues \cgalCite{liu2025linequadrics}. -This policy enhances the original Garland-Heckbert quadric error metrics, +This policy enhances the original Garland-Heckbert quadric error metrics by adding to the cost the distance to the line passing through the input vertices and aligned with their normals. -Compared to the "classic" plane strategy, this strategy improves the speed and the quality of the result. -(Section \ref SurfaceMeshSimplificationGarlandHeckbertStrategy). +Compared to the "classic" plane strategy, this strategy improves the speed and the quality of the result +(see Section \ref SurfaceMeshSimplificationGarlandHeckbertStrategy). \note Both the cost and the placement policies must be used together as they internally use and share information associating quadrics to vertices. @@ -50,6 +50,7 @@ public: \param tmesh the triangle mesh \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + \cgalNamedParamsBegin \cgalParamNBegin{vertex_normal_map} \cgalParamDescription{a property map associating to each vertex of `tmesh` a normal direction for that vertex} @@ -57,20 +58,17 @@ public: as key type and `Vector_3` as value type} \cgalParamDefault{an internal map filled using `CGAL::Polygon_mesh_processing::compute_vertex_normals`} \cgalParamNEnd - \cgalParamNBegin{discontinuity_multiplier} \cgalParamDescription{a multiplier of the error value for boundary edges to preserve the boundaries} \cgalParamType{double} \cgalParamDefault{100} \cgalParamNEnd - \cgalParamNBegin{line_policies_weight} - \cgalParamDescription{a value that define the weight of the line policies compare to the plane policies} + \cgalParamDescription{a value that defines the weight of the line policies compared to the plane policies} \cgalParamType{double} \cgalParamDefault{0.01} \cgalParamNEnd \cgalNamedParamsEnd - */ template GarlandHeckbert_plane_and_line_policies(TriangleMesh& tmesh, const NamedParameters &np = parameters::default_values()); @@ -88,7 +86,7 @@ public: }; /*! -Creates a Garland-Heckbert plane and line policies object +creates a Garland-Heckbert plane and line policies object. */ template GarlandHeckbert_plane_and_line_policies make_GarlandHeckbert_plane_and_line_policies(TriangleMesh& tmesh, diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h index 168bdee13d6..f5c464d524f 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h @@ -5,7 +5,7 @@ namespace Surface_mesh_simplification { \ingroup PkgSurfaceMeshSimplificationRef This class is an alias for the current state-of-the-art Garland-Heckbert policies -(Section \ref SurfaceMeshSimplificationGarlandHeckbertStrategy). +(see Section \ref SurfaceMeshSimplificationGarlandHeckbertStrategy). It is currently an alias of `GarlandHeckbert_plane_and_line_policies`. \sa `GarlandHeckbert_plane_policies` diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Doxyfile.in b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Doxyfile.in index aa0861376b5..64e5fa4ddf3 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Doxyfile.in +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Doxyfile.in @@ -2,5 +2,5 @@ PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - Triangulated Surface Mesh Simplification" -HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/sappho.png -HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/octocat.png +HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/sappho.png \ + ${CGAL_PACKAGE_DOC_DIR}/fig/octocat.png diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h index 890e21bfcfb..ae415434165 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_plane_and_line_policies.h @@ -43,7 +43,7 @@ struct GH_helper{ NamedParameters, Vertex_normal_dmap>::type Vertex_normal_map; - const NamedParameters &np; + NamedParameters np; GH_helper(const NamedParameters &np_):np(np_){ } Vertex_normal_map vnm(TriangleMesh& tmesh) const{ diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_composed_policies.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_composed_policies.h index 943901ab321..dba5e665f87 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_composed_policies.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_composed_policies.h @@ -25,9 +25,7 @@ namespace internal { This policy was created to combine the line policy with the existing ones. The composition of some quadrics is always invertible, but this is not necessarily true for all composed quadrics. `invertible` boolean parameter reflects this distinction. - */ - template class Composed_quadric_calculator { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_line_policies.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_line_policies.h index c444fb1eb8a..03eed8a4235 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_line_policies.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/GarlandHeckbert_line_policies.h @@ -31,7 +31,6 @@ namespace internal { This policy is not useful on its own; it is designed to be combined with another policy using a small weight. Therefore, it is kept internal. */ - template class Line_quadric_calculator {