Apply suggestions from code review

This commit is contained in:
Mael 2025-10-09 14:36:15 +02:00 committed by GitHub
parent 0417a52217
commit 3a350bf354
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 17 additions and 24 deletions

View File

@ -647,8 +647,8 @@ Release date: July 2023
- 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

View File

@ -28,8 +28,6 @@ typedef Kernel::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
namespace SMS = CGAL::Surface_mesh_simplification;
namespace PMP = CGAL::Polygon_mesh_processing;
typedef SMS::GarlandHeckbert_plane_policies<Surface_mesh, Kernel> Classic_plane;
@ -72,7 +70,6 @@ double collapse_gh(Surface_mesh& mesh,
typedef typename GHPolicies::Get_placement GH_placement;
typedef SMS::Bounded_normal_change_placement<GH_placement> Bounded_GH_placement;
// GHPolicies gh_policies(mesh);
const GH_cost& gh_cost = gh_policies.get_cost();
const GH_placement& gh_placement = gh_policies.get_placement();
Bounded_GH_placement placement(gh_placement);
@ -84,9 +81,10 @@ double collapse_gh(Surface_mesh& mesh,
return (std::chrono::duration_cast<std::chrono::milliseconds>(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)

View File

@ -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<typename NamedParameters = parameters::Default_named_parameters>
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<typename TriangleMesh, typename NamedParameters = parameters::Default_named_parameters>
GarlandHeckbert_plane_and_line_policies make_GarlandHeckbert_plane_and_line_policies(TriangleMesh& tmesh,

View File

@ -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`

View File

@ -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

View File

@ -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{

View File

@ -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 <typename TriangleMesh, typename GeomTraits, typename Quadric_calculator_1, typename Quadric_calculator_2, bool invertible=false>
class Composed_quadric_calculator
{

View File

@ -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 <typename TriangleMesh, typename GeomTraits>
class Line_quadric_calculator
{