From b1f151e598425dd178f554304bb1b2f8b5e50b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Aug 2025 18:19:02 +0200 Subject: [PATCH 1/3] use only one specialization using FT cannot get the specialization as an object inherits from Lazy --- Filtered_kernel/include/CGAL/Lazy.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 5d7b22ec37b..9b4041793c1 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -112,23 +112,19 @@ templateinline std::enable_if_t::value, int> depth(T){ namespace internal{ - template - struct Evaluate> +template +struct Evaluate> +{ + template + void operator()(const Lazy& l) { - void operator()(const Lazy& l) - { - exact(l); - } + exact(l); + } + void operator()(const Lazy_exact_nt& l) + { + exact(l); + } }; - - template - struct Evaluate> - { - void operator()(const Lazy_exact_nt& l) - { - exact(l); - } - }; } // internal namespace // For an iterator, exact/approx applies to the objects it points to From fdd7c17ec1217ec9d14ec1189d5a509176ef548e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Aug 2025 18:20:20 +0200 Subject: [PATCH 2/3] avoid large dag in centroid --- .../include/CGAL/Polygon_mesh_processing/measure.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h index 42492891ef0..43ee6eb534f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -893,6 +893,8 @@ centroid(const TriangleMesh& tmesh, Scale scale = k.construct_scaled_vector_3_object(); Sum sum = k.construct_sum_of_vectors_3_object(); + ::CGAL::internal::Evaluate evaluate; + for(face_descriptor fd : faces(tmesh)) { const Point_3_ref p = get(vpm, target(halfedge(fd, tmesh), tmesh)); @@ -903,6 +905,7 @@ centroid(const TriangleMesh& tmesh, vr = vector(ORIGIN, r); Vector_3 n = normal(p, q, r); volume += (scalar_product(n,vp))/FT(6); + evaluate(volume); n = scale(n, FT(1)/FT(24)); Vector_3 v2 = sum(vp, vq); @@ -913,6 +916,7 @@ centroid(const TriangleMesh& tmesh, v3 = sum(v3, Vector_3(square(v2.x()), square(v2.y()), square(v2.z()))); centroid = sum(centroid, Vector_3(n.x() * v3.x(), n.y() * v3.y(), n.z() * v3.z())); + evaluate(centroid); } centroid = scale(centroid, FT(1)/(FT(2)*volume)); From 29e6836e9c9e6df9796b77e3672743f3f5a1f561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Aug 2025 18:44:34 +0200 Subject: [PATCH 3/3] we need to support all types of objects --- Number_types/include/CGAL/utils_classes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/utils_classes.h b/Number_types/include/CGAL/utils_classes.h index 1b4eb95ce89..f7052a8c59a 100644 --- a/Number_types/include/CGAL/utils_classes.h +++ b/Number_types/include/CGAL/utils_classes.h @@ -272,7 +272,8 @@ namespace internal template struct Evaluate { - void operator()(const NT&) + template + void operator()(const T&) {} }; } // internal namespace