From 068fb979413799cc57d009f1c73fc8055418bfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Mar 2025 10:40:55 +0100 Subject: [PATCH 01/19] Fix tparam + add some details --- .../CGAL/extrude_skeleton.h | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/extrude_skeleton.h b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/extrude_skeleton.h index 6fcb059ae2d..7f91ca805d5 100644 --- a/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/extrude_skeleton.h +++ b/Straight_skeleton_2/doc/Straight_skeleton_2/CGAL/extrude_skeleton.h @@ -5,18 +5,21 @@ namespace CGAL { * * \brief constructs the straight skeleton-based extrusion of a polygon with holes. * -* Given a polygon with holes and a set of weights, the skeleton extrusion is a volume constructed -* from the weighted straight skeleton by associating a height to the vertices of the skeleton, -* which corresponds to the time at the vertex. The input polygon is placed at `z = 0`. -* -* This function allows cropping the extruded skeleton at a maximum height, using the optional -* `maximum_height()` named parameter. +* Given a polygon with holes and a set of weights (or angles) associated to its edges, +* the skeleton extrusion is a volume constructed from the weighted straight skeleton +* by associating a height to the vertices of the skeleton, which corresponds to the time +* at the vertex. The input polygon is placed at `z = 0`. * * The result is a closed, 2-manifold surface triangle mesh. Note that this mesh can have non-local * self-intersections if a maximal height is provided due to possible (geometric) non-manifold occurences. * -* @tparam PolygonWithHoles must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) - or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). +* It is possible to crop the extruded skeleton at a maximum height using the optional +* `maximum_height()` named parameter. A maximum height must be specified if the weights (or angles) +* associated to the edges of the input polygon correspond an outward extrusion, i.e. if no weight +* is greater than zero (or no angle is smaller than `90` degrees). +* +* @tparam Polygon must be a model of `SequenceContainer` with value type `InK::Point_2` (e.g. `Polygon_2`) + or a model of `GeneralPolygonWithHoles_2` (e.g. `Polygon_with_holes_2`). * @tparam PolygonMesh a model of `MutableFaceGraph` * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" * @@ -42,7 +45,7 @@ namespace CGAL { * \cgalParamType{a model of `Range` whose value type is a model of `Range` whose value type is `FT`} * \cgalParamDefault{an empty range (uniform weights are used)} * \cgalParamExtra{Angles are measured in degrees and should be strictly within `0` and `180` degrees -* and should be eitger all acute (inward extrusion) or all obtuse (outward extrusion).} +* and should be either all acute (inward extrusion) or all obtuse (outward extrusion).} * \cgalParamExtra{This parameter is ignored if the `weights` parameter is provided.} * \cgalParamExtra{The conversion to weights involves trigonometry and will be inexact, * even when using a number type with exact square roots.} From bb81d8581e00ab0400e4a6e33ef9eaf77023cc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Mar 2025 16:26:34 +0100 Subject: [PATCH 02/19] Fix compilation of SLS extrusion without snapping --- Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h b/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h index 38e178d7222..bbde62446be 100644 --- a/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h +++ b/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h @@ -691,7 +691,7 @@ public: #ifdef CGAL_SLS_SNAP_TO_VERTICAL_SLABS Visitor visitor(*ss_ptr, offset_points, vertical_weight, snapped_positions); #else - Visitor visitor(*ss_ptr, vertical_weight, offset_points); + Visitor visitor(*ss_ptr, offset_points); #endif Offset_builder ob(*ss_ptr, Offset_builder_traits(), visitor); Offset_polygons raw_output; From c61639cfd782c284e853b87dfc48b4bef34ab6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 7 Mar 2025 16:27:56 +0100 Subject: [PATCH 03/19] Fix extrusion without snapping not registering some offset points --- .../include/CGAL/extrude_skeleton.h | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h b/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h index bbde62446be..1baf7ec1bad 100644 --- a/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h +++ b/Straight_skeleton_extrusion_2/include/CGAL/extrude_skeleton.h @@ -86,8 +86,8 @@ inline constexpr FT default_extrusion_height() } // @todo Maybe this postprocessing is not really necessary? Do users really care if the point -// is not perfectly above the input contour edge (it generally cannot be anyway if the kernel is not exact except for some -// specific cases)? +// is not perfectly above the input contour edge (it generally cannot be anyway if the kernel +// is not exact except for some specific cases)? #define CGAL_SLS_SNAP_TO_VERTICAL_SLABS #ifdef CGAL_SLS_SNAP_TO_VERTICAL_SLABS @@ -205,17 +205,19 @@ public: } // can't modify the position yet because we need arrange_polygons() to still work properly + // + // @fixme on paper one could create a polygon thin-enough w.r.t. the max weight value + // such thatthere is a skeleton vertex that wants to be snapped to two different sides... void on_offset_point(const Point_2& op, SS_Halfedge_const_handle hook) const { - CGAL_assertion(hook->is_bisector()); - -#ifdef CGAL_SLS_SNAP_TO_VERTICAL_SLABS - // @fixme on paper one could create a polygon thin-enough w.r.t. the max weight value such that - // there is a skeleton vertex that wants to be snapped to two different sides... - CGAL_assertion(m_snapped_positions.count(op) == 0); + CGAL_precondition(hook->is_bisector()); HDS_Halfedge_const_handle canonical_hook = (hook < hook->opposite()) ? hook : hook->opposite(); + m_offset_points[canonical_hook] = op; + +#ifdef CGAL_SLS_SNAP_TO_VERTICAL_SLABS + CGAL_precondition(m_snapped_positions.count(op) == 0); SS_Halfedge_const_handle contour_h1 = hook->defining_contour_edge(); CGAL_assertion(contour_h1->opposite()->is_border()); @@ -225,9 +227,6 @@ public: const bool is_h1_vertical = (contour_h1->weight() == m_vertical_weight); const bool is_h2_vertical = (contour_h2->weight() == m_vertical_weight); - // this can happen when the offset is passing through vertices - m_offset_points[canonical_hook] = op; - // if both are vertical, it's the common vertex (which has to exist) if(is_h1_vertical && is_h2_vertical) { From 639b513993d5ddee0f62bb6adfb95c2293011b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 10 Mar 2025 13:30:42 +0100 Subject: [PATCH 04/19] Fix CMakeLists.txt --- .../test/Straight_skeleton_2/CMakeLists.txt | 43 ++++++++++++------- .../CMakeLists.txt | 16 +++---- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index 893695a495c..2be2f087b35 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -5,25 +5,36 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt5 Core) +find_package(LEDA QUIET) include_directories(BEFORE "include") -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program("issue4533.cpp") +create_single_source_cgal_program("issue4684.cpp") +create_single_source_cgal_program("test_sls.cpp") +create_single_source_cgal_program("test_sls_previous_issues.cpp") +create_single_source_cgal_program("test_sls_traits.cpp") +create_single_source_cgal_program("test_straight_skeleton_copy.cpp") if(CGAL_Qt5_FOUND) - target_link_libraries(issue4684 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(issue7149 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(issue7284 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_previous_issues PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_offset PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_weighted_offset PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_weighted_polygons PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_weighted_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(issue4684 PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_previous_issues PRIVATE CGAL::CGAL_Basic_viewer) endif() + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("issue7149.cpp") + create_single_source_cgal_program("issue7284.cpp") + create_single_source_cgal_program("test_sls_offset.cpp") + create_single_source_cgal_program("test_sls_weighted_offset.cpp") + create_single_source_cgal_program("test_sls_simple.cpp") + create_single_source_cgal_program("test_sls_weighted_polygons.cpp") + create_single_source_cgal_program("test_sls_weighted_polygons_with_holes.cpp") + if(CGAL_Qt5_FOUND) + target_link_libraries(issue7149 PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(issue7284 PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_offset PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_offset PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_polygons PRIVATE CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_polygons_with_holes PRIVATE CGAL::CGAL_Basic_viewer) + endif() +endif() \ No newline at end of file diff --git a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt index f29dcb4e929..fbdf8e26116 100644 --- a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt +++ b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt @@ -5,18 +5,14 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_extrusion_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt5 Core) +find_package(LEDA QUIET) include_directories(BEFORE "include") -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("test_sls_extrude.cpp") -if(CGAL_Qt5_FOUND) - target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) + if(CGAL_Qt5_FOUND) + target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) + endif() endif() From 6ce3d6140a47a8e08b18711afd9d4f08c43e65c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 10 Mar 2025 13:31:01 +0100 Subject: [PATCH 05/19] Fix using C++17 static asserts --- Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h index 2a2a481dab0..8f1e868f16d 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_2.h @@ -141,7 +141,7 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& , Tag_false ) { - static_assert(!(std::is_same::value)); + static_assert(!(std::is_same::value), ""); typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; @@ -167,7 +167,7 @@ template std::vector< boost::shared_ptr > create_offset_polygons_2 ( FT const& aOffset, Skeleton const& aSs, K const& /*k*/, Tag_true ) { - static_assert(!(std::is_same::value)); + static_assert(!(std::is_same::value), ""); typedef boost::shared_ptr OutPolygonPtr ; typedef std::vector OutPolygonPtrVector ; From 69df3ae5a51645d8d7b84b0e1d20dd0f33ecc154 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 24 Feb 2025 07:31:43 +0000 Subject: [PATCH 06/19] T2: avoid maybe uninitialized warning --- .../include/CGAL/Constrained_triangulation_plus_2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 63e07c51dcf..3bc408087eb 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -738,9 +738,9 @@ public: ++it){ if(! is_subconstraint(*it, *succ)){ // this checks whether other constraints pass Face_handle fh; - int i; - bool b = Triangulation::is_edge(*it, *succ, fh, i); - CGAL_assume(b); + int i = -1; + Triangulation::is_edge(*it, *succ, fh, i); + CGAL_assertion(i != -1); Triangulation::remove_constrained_edge(fh,i, out); // this does also flipping if necessary. } } From ee8646543843f034746685db0e545f4b2c5a5e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 21:58:40 +0100 Subject: [PATCH 07/19] Fix conversion warning --- .../collapse_small_edges_in_parallel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/collapse_small_edges_in_parallel.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/collapse_small_edges_in_parallel.cpp index 17eebbe0314..a93094e71ea 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/collapse_small_edges_in_parallel.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/collapse_small_edges_in_parallel.cpp @@ -123,7 +123,7 @@ int main(int argc, char** argv) // reassemble the mesh Triangle_mesh final_mesh; - std::size_t nv=0, nf=0, ne=0; + Triangle_mesh::size_type nv = 0, nf = 0, ne = 0; for (int i=0; i< number_of_parts; ++i) { meshes[i].collect_garbage(); From 114a4b8ff8030e0e5b49b08b4cfd5b08a8e37618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 22:14:44 +0100 Subject: [PATCH 08/19] Add default constructors for test data structures we don't actually ever run SLS2 with these polygon types, it's just to test the API... --- .../test/Straight_skeleton_2/test_sls_offset.cpp | 6 ++++-- .../test/Straight_skeleton_2/test_sls_weighted_offset.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index bc024d9c8d3..a2252389f50 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -37,16 +37,18 @@ typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqr namespace CGAL { template -class Test_polygon_2 : public CGAL::Polygon_2 { +struct Test_polygon_2 : public CGAL::Polygon_2 { typedef CGAL::Polygon_2 Base; + Test_polygon_2() { } Test_polygon_2(const Base&); public: using Base::Base; }; template -class Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { +struct Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { typedef CGAL::Polygon_with_holes_2 Base; + Test_polygon_with_holes_2() { } Test_polygon_with_holes_2(const Base&); public: using Base::Base; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp index 40fd4aede6f..e6098cab69b 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_weighted_offset.cpp @@ -28,16 +28,18 @@ typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK_w_sqr namespace CGAL { template -class Test_polygon_2 : public CGAL::Polygon_2 { +struct Test_polygon_2 : public CGAL::Polygon_2 { typedef CGAL::Polygon_2 Base; + Test_polygon_2() { } Test_polygon_2(const Base&); public: using Base::Base; }; template -class Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { +struct Test_polygon_with_holes_2 : public CGAL::Polygon_with_holes_2 { typedef CGAL::Polygon_with_holes_2 Base; + Test_polygon_with_holes_2() { } Test_polygon_with_holes_2(const Base&); public: using Base::Base; From ec9b5fa21cbece372c9201ebedb993e12d845902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 22:19:46 +0100 Subject: [PATCH 09/19] Avoid pointless const& --- SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp index 737bfcacb33..8cd67e4f3b7 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_with_features.cpp @@ -334,7 +334,7 @@ struct Tester // Test vertex iterators //------------------------------------------------------- std::cout << "Test vertex iterators\n"; - const Vertex_handle& vertex_to_modify = c3t3.vertices_in_complex_begin(); + Vertex_handle vertex_to_modify = c3t3.vertices_in_complex_begin(); c3t3.remove_from_complex(vertex_to_modify); c3t3.add_to_complex(vertex_to_modify,corner_index_bis); From be7de12acbcb321722e0f55ed6fcd8dc274e6fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 22:22:33 +0100 Subject: [PATCH 10/19] Fix used uninitialized warning --- .../test/STL_Extension/test_Concurrent_compact_container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index a42676f8f7f..df37dd54f69 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -45,7 +45,7 @@ struct Node_1 void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; } - std::size_t time_stamp_; + std::size_t time_stamp_ = std::size_t(-2); }; class Node_2 From 75941ed2fb29adcd084ca6e6777a544a21259523 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 4 Jan 2024 09:17:40 +0000 Subject: [PATCH 11/19] Image_IO: sprintf -> snprintf --- .../include/CGAL/ImageIO/analyze_impl.h | 91 +++++++++++-------- CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h | 24 ++--- CGAL_ImageIO/include/CGAL/ImageIO/inr_impl.h | 16 ++-- .../include/CGAL/ImageIO/mincio_impl.h | 2 +- CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h | 25 +++-- 5 files changed, 87 insertions(+), 71 deletions(-) diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h index 1c326b6fa1f..c68ee7c3298 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h @@ -463,60 +463,79 @@ int _readAnalyzeHeader( _image* im, const char* name, for ( i=0; inuser; i++ ) im->user[i] = nullptr; i = 0 ; - im->user[i] = (char *) ImageIO_alloc((strlen("Data lost in the Analyze -> ImageIO conversion:") + 1)); - sprintf( im->user[i++], "Data lost in the Analyze -> ImageIO conversion:" ); + size_t buffer_size; + buffer_size = strlen("Data lost in the Analyze -> ImageIO conversion:") + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, "Data lost in the Analyze -> ImageIO conversion:" ); - im->user[i] = (char *) ImageIO_alloc((strlen(" descrip: ") + 1 + strlen(analyzeHeader->hist.descrip) )); - sprintf( im->user[i++], " descrip: %s", analyzeHeader->hist.descrip ); + buffer_size = strlen(" descrip: ") + 1 + strlen(analyzeHeader->hist.descrip); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " descrip: %s", analyzeHeader->hist.descrip ); - im->user[i] = (char *) ImageIO_alloc((strlen(" aux_file: ") + 1 + strlen(analyzeHeader->hist.descrip) )); - sprintf( im->user[i++], " aux_file: %s", analyzeHeader->hist.descrip ); + buffer_size = strlen(" aux_file: ") + 1 + strlen(analyzeHeader->hist.descrip); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " aux_file: %s", analyzeHeader->hist.descrip ); - im->user[i] = (char *) ImageIO_alloc((strlen(" orient: ") + 1+ 2)); - sprintf( im->user[i++], " orient: %d", analyzeHeader->hist.orient ); + buffer_size = strlen(" orient: ") + 1+ 2; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " orient: %d", analyzeHeader->hist.orient ); - im->user[i] = (char *) ImageIO_alloc((strlen(" originator: ") + 1 + strlen(analyzeHeader->hist.originator) )); - sprintf( im->user[i++], " originator: %s", analyzeHeader->hist.originator ); + buffer_size = strlen(" originator: ") + 1 + strlen(analyzeHeader->hist.originator); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " originator: %s", analyzeHeader->hist.originator ); - im->user[i] = (char *) ImageIO_alloc((strlen(" generated: ") + 1 + strlen(analyzeHeader->hist.generated) )); - sprintf( im->user[i++], " generated: %s", analyzeHeader->hist.generated ); + buffer_size = strlen(" generated: ") + 1 + strlen(analyzeHeader->hist.generated); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " generated: %s", analyzeHeader->hist.generated ); - im->user[i] = (char *) ImageIO_alloc((strlen(" scannum: ") + 1 + strlen(analyzeHeader->hist.scannum) )); - sprintf( im->user[i++], " scannum: %s", analyzeHeader->hist.scannum ); + buffer_size = strlen(" scannum: ") + 1 + strlen(analyzeHeader->hist.scannum); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " scannum: %s", analyzeHeader->hist.scannum ); - im->user[i] = (char *) ImageIO_alloc((strlen(" patient_id: ") + 1 + strlen(analyzeHeader->hist.patient_id) )); - sprintf( im->user[i++], " patient_id: %s", analyzeHeader->hist.patient_id ); + buffer_size = strlen(" patient_id: ") + 1 + strlen(analyzeHeader->hist.patient_id); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " patient_id: %s", analyzeHeader->hist.patient_id ); - im->user[i] = (char *) ImageIO_alloc((strlen(" exp_date: ") + 1 + strlen(analyzeHeader->hist.exp_date) )); - sprintf( im->user[i++], " exp_date: %s", analyzeHeader->hist.exp_date ); + buffer_size = strlen(" exp_date: ") + 1 + strlen(analyzeHeader->hist.exp_date); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " exp_date: %s", analyzeHeader->hist.exp_date ); - im->user[i] = (char *) ImageIO_alloc((strlen(" exp_time: ") + 1 + strlen(analyzeHeader->hist.exp_time) )); - sprintf( im->user[i++], " exp_time: %s", analyzeHeader->hist.exp_time ); + buffer_size = strlen(" exp_time: ") + 1 + strlen(analyzeHeader->hist.exp_time); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " exp_time: %s", analyzeHeader->hist.exp_time ); + buffer_size = strlen(" views: ") + 11 + 1; /* A 32 bit int doesn't print on more than 11 chars */ - im->user[i] = (char *) ImageIO_alloc((strlen(" views: ") + 11 + 1)); - sprintf( im->user[i++], " views: %d", analyzeHeader->hist.views ); + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " views: %d", analyzeHeader->hist.views ); - im->user[i] = (char *) ImageIO_alloc((strlen(" vols_added: ") + 11 + 1)); - sprintf( im->user[i++], " vols_added: %d", analyzeHeader->hist.vols_added ); + buffer_size = strlen(" vols_added: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " vols_added: %d", analyzeHeader->hist.vols_added ); - im->user[i] = (char *) ImageIO_alloc((strlen(" start_field: ") + 11 + 1)); - sprintf( im->user[i++], " start_field: %d", analyzeHeader->hist.start_field ); + buffer_size = strlen(" start_field: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " start_field: %d", analyzeHeader->hist.start_field ); - im->user[i] = (char *) ImageIO_alloc((strlen(" field_skip: ") + 11 + 1)); - sprintf( im->user[i++], " field_skip: %d", analyzeHeader->hist.field_skip ); + buffer_size = strlen(" field_skip: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " field_skip: %d", analyzeHeader->hist.field_skip ); - im->user[i] = (char *) ImageIO_alloc((strlen(" omax: ") + 11 + 1)); - sprintf( im->user[i++], " omax: %d", analyzeHeader->hist.omax ); + buffer_size = strlen(" omax: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " omax: %d", analyzeHeader->hist.omax ); - im->user[i] = (char *) ImageIO_alloc((strlen(" omin: ") + 11 + 1)); - sprintf( im->user[i++], " omin: %d", analyzeHeader->hist.omin ); + buffer_size = strlen(" omin: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " omin: %d", analyzeHeader->hist.omin ); - im->user[i] = (char *) ImageIO_alloc((strlen(" smax: ") + 11 + 1)); - sprintf( im->user[i++], " smax: %d", analyzeHeader->hist.smax ); + buffer_size = strlen(" smax: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " smax: %d", analyzeHeader->hist.smax ); - im->user[i] = (char *) ImageIO_alloc((strlen(" smin: ") + 11 + 1)); - sprintf( im->user[i++], " smin: %d", analyzeHeader->hist.smin ); + buffer_size = strlen(" smin: ") + 11 + 1; + im->user[i] = (char *) ImageIO_alloc(buffer_size); + snprintf( im->user[i++], buffer_size, " smin: %d", analyzeHeader->hist.smin ); /* header is read. close header file and open data file. */ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h index e2d9b5b2818..f9c590dd5a7 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h @@ -130,10 +130,10 @@ int writeGis( char *name, _image* im) { do { memset( str, 0, _LGTH_STRING_ ); for ( j=0; jwordKind) { case WK_FLOAT: - sprintf(type, "float"); + snprintf(type, 30, "float"); scale[0] = '\0'; break; case WK_FIXED: switch(im->sign) { case SGN_SIGNED: - sprintf(type, "signed fixed"); + snprintf(type, 30, "signed fixed"); break; case SGN_UNSIGNED: - sprintf(type, "unsigned fixed"); + snprintf(type, 30, "unsigned fixed"); break; default: return -1; } - sprintf(scale, "SCALE=2**0\n"); + snprintf(scale, 20, "SCALE=2**0\n"); break; default: @@ -101,17 +101,17 @@ int _writeInrimageHeader(const _image *im, ENDIANNESS end) { switch(end) { case END_LITTLE: - sprintf(endianness, "decm"); + snprintf(endianness, 5, "decm"); break; case END_BIG: - sprintf(endianness, "sun"); + snprintf(endianness, 5, "sun"); break; default: /* fix architecture endianness */ if( _getEndianness() == END_LITTLE) - sprintf(endianness, "decm"); + snprintf(endianness, 5, "decm"); else - sprintf(endianness, "sun"); + snprintf(endianness, 5, "sun"); break; } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h index cd701bb2e89..5addca29f1e 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h @@ -357,7 +357,7 @@ int writeMincFile( const _image* im, const char *filename, strcat(newname, filename + i + 1); } else - sprintf(newname, "#TMP#%s", filename); + snprintf(newname,strlen(filename) + 10, "#TMP#%s", filename); } } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h index 1298dd4e84a..ceb9d7ff68a 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h @@ -524,14 +524,14 @@ int writePgmImage(char *name,_image *im ) } if ( im->dataMode == DM_ASCII ) - sprintf( string, "%s\n", PGM_ASCII_MAGIC ); + snprintf( string, 256, "%s\n", PGM_ASCII_MAGIC ); else - sprintf( string, "%s\n", PGM_MAGIC ); + snprintf( string, 256, "%s\n", PGM_MAGIC ); ImageIO_write( im, string, strlen( string ) ); - sprintf( string, "# CREATOR: pnm.c $Revision$ $Date$\n" ); + snprintf( string, 256, "# CREATOR: pnm.c $Revision$ $Date$\n" ); ImageIO_write( im, string, strlen( string ) ); - sprintf( string, "%zu %zu\n", im->xdim, im->ydim ); + snprintf( string, 256, "%zu %zu\n", im->xdim, im->ydim ); ImageIO_write( im, string, strlen( string ) ); max = 0; switch ( im->wdim ) { @@ -552,7 +552,7 @@ int writePgmImage(char *name,_image *im ) } /* max == 0 causes problems for xv */ if ( max == 0 ) max = 1; - sprintf( string, "%d\n", max ); + snprintf( string, 256, "%d\n", max ); ImageIO_write( im, string, strlen( string ) ); if ( im->dataMode == DM_ASCII ) { @@ -574,10 +574,10 @@ int writePgmImage(char *name,_image *im ) do { memset( str, 0, _LGTH_STRING_ ); for ( j=0; jopenMode = OM_CLOSE; return 1; } - - - From ea07b8c772df04c82feac400070c47406185f53e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 8 Jan 2024 12:13:22 +0000 Subject: [PATCH 12/19] Compute strlen using snprintf --- .../include/CGAL/ImageIO/analyze_impl.h | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h index c68ee7c3298..86bb69221a0 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h @@ -468,72 +468,72 @@ int _readAnalyzeHeader( _image* im, const char* name, im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, "Data lost in the Analyze -> ImageIO conversion:" ); - buffer_size = strlen(" descrip: ") + 1 + strlen(analyzeHeader->hist.descrip); + buffer_size = snprintf(nullptr, 0, " descrip: %s", analyzeHeader->hist.descrip) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " descrip: %s", analyzeHeader->hist.descrip ); - buffer_size = strlen(" aux_file: ") + 1 + strlen(analyzeHeader->hist.descrip); + buffer_size = snprintf(nullptr, 0, " aux_file: %s", analyzeHeader->hist.descrip ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " aux_file: %s", analyzeHeader->hist.descrip ); - buffer_size = strlen(" orient: ") + 1+ 2; + buffer_size = snprintf(nullptr, 0, " orient: %d", analyzeHeader->hist.orient ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " orient: %d", analyzeHeader->hist.orient ); - buffer_size = strlen(" originator: ") + 1 + strlen(analyzeHeader->hist.originator); + buffer_size = snprintf(nullptr, 0, " originator: %s", analyzeHeader->hist.originator ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " originator: %s", analyzeHeader->hist.originator ); - buffer_size = strlen(" generated: ") + 1 + strlen(analyzeHeader->hist.generated); + buffer_size = snprintf(nullptr, 0, " generated: %s", analyzeHeader->hist.generated ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " generated: %s", analyzeHeader->hist.generated ); - buffer_size = strlen(" scannum: ") + 1 + strlen(analyzeHeader->hist.scannum); + buffer_size = snprintf(nullptr, 0, " scannum: %s", analyzeHeader->hist.scannum ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " scannum: %s", analyzeHeader->hist.scannum ); - buffer_size = strlen(" patient_id: ") + 1 + strlen(analyzeHeader->hist.patient_id); + buffer_size = snprintf(nullptr, 0, " patient_id: %s", analyzeHeader->hist.patient_id ) +1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " patient_id: %s", analyzeHeader->hist.patient_id ); - buffer_size = strlen(" exp_date: ") + 1 + strlen(analyzeHeader->hist.exp_date); + buffer_size = snprintf(nullptr, 0, " exp_date: %s", analyzeHeader->hist.exp_date ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " exp_date: %s", analyzeHeader->hist.exp_date ); - buffer_size = strlen(" exp_time: ") + 1 + strlen(analyzeHeader->hist.exp_time); + buffer_size = snprintf(nullptr, 0, " exp_time: %s", analyzeHeader->hist.exp_time ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " exp_time: %s", analyzeHeader->hist.exp_time ); - buffer_size = strlen(" views: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " views: %d", analyzeHeader->hist.views ) + 1; /* A 32 bit int doesn't print on more than 11 chars */ im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " views: %d", analyzeHeader->hist.views ); - buffer_size = strlen(" vols_added: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " vols_added: %d", analyzeHeader->hist.vols_added ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " vols_added: %d", analyzeHeader->hist.vols_added ); - buffer_size = strlen(" start_field: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " start_field: %d", analyzeHeader->hist.start_field ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " start_field: %d", analyzeHeader->hist.start_field ); - buffer_size = strlen(" field_skip: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " field_skip: %d", analyzeHeader->hist.field_skip ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " field_skip: %d", analyzeHeader->hist.field_skip ); - buffer_size = strlen(" omax: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " omax: %d", analyzeHeader->hist.omax ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " omax: %d", analyzeHeader->hist.omax ); - buffer_size = strlen(" omin: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " omin: %d", analyzeHeader->hist.omin ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " omin: %d", analyzeHeader->hist.omin ); - buffer_size = strlen(" smax: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " smax: %d", analyzeHeader->hist.smax ) + 1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " smax: %d", analyzeHeader->hist.smax ); - buffer_size = strlen(" smin: ") + 11 + 1; + buffer_size = snprintf(nullptr, 0, " smin: %d", analyzeHeader->hist.smin ) +1; im->user[i] = (char *) ImageIO_alloc(buffer_size); snprintf( im->user[i++], buffer_size, " smin: %d", analyzeHeader->hist.smin ); From b58a93c7c7db157a6ea312d16df7c522aa16c5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 22:51:57 +0100 Subject: [PATCH 13/19] Fix mark type --- .../include/CGAL/Combinatorial_map_iterators_base.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index 0b2c39bc720..dadf9165b56 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -163,7 +163,7 @@ namespace CGAL { /// test if adart->beta(ai)->beta(aj) exists and is not marked for amark bool is_unmarked2(Dart_descriptor adart, unsigned int ai, unsigned int aj, - typename Map::size_type amark) const + size_type amark) const { return !mmap->is_marked(mmap->beta(adart, ai, aj), amark); } @@ -209,6 +209,8 @@ namespace CGAL { /// true iff this iterator is basic typedef Tag_true Basic_iterator; + typedef typename Map::size_type size_type; + public: /// Main constructor. CMap_dart_iterator(Map& amap, Dart_descriptor adart): @@ -263,7 +265,7 @@ namespace CGAL { protected: /// test if adart->beta(ai) exists and is not marked for amark - bool is_unmarked(Dart_descriptor adart, unsigned int ai, unsigned amark) const + bool is_unmarked(Dart_descriptor adart, unsigned int ai, size_type amark) const { return !mmap->is_marked(mmap->beta(adart,ai), amark); } /// test if adart->beta(ai)->beta(aj) exists @@ -272,7 +274,7 @@ namespace CGAL { /// test if adart->beta(ai)->beta(aj) exists and is not marked for amark bool is_unmarked2(Dart_descriptor adart, unsigned int ai, unsigned int aj, - unsigned amark) const + size_type amark) const { return !mmap->is_marked(mmap->beta(adart, ai, aj), amark); } protected: From 0e6abc499fb9953a6da3cd4b35c80fcdd133684c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 22:58:40 +0100 Subject: [PATCH 14/19] boost > std array --- .../include/CGAL/Periodic_3_regular_triangulation_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index 3e806a7ba50..7eed15886cd 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -909,7 +909,7 @@ public: std::cout << "four offsets: " << std::endl; #endif - boost::array offsets; + std::array offsets; for(int i=0; i<4; ++i) { #ifdef CGAL_PERIODIC_SET_POINT_VERBOSE From ce7cb41d5bb8eeb3cfbbe02449f4537aa7ed1e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:14:47 +0100 Subject: [PATCH 15/19] encode LEDA/Core dependency --- .../Hyperbolic_triangulation_2/CMakeLists.txt | 9 +++++++-- .../Hyperbolic_triangulation_2/CMakeLists.txt | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt index e5a66d69733..15433a72b16 100644 --- a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt @@ -5,6 +5,11 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Hyperbolic_triangulation_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -create_single_source_cgal_program("ht2_example.cpp") -create_single_source_cgal_program("ht2_example_color.cpp") +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("ht2_example.cpp") + create_single_source_cgal_program("ht2_example_color.cpp") +else() + message("NOTICE: Examples require CGAL_Core (or LEDA), and will not be compiled.") +endif() diff --git a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt index 451ccac8d32..b61314c788b 100644 --- a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt @@ -5,11 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Hyperbolic_triangulation_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -create_single_source_cgal_program("ht2_test_clear.cpp") -create_single_source_cgal_program("ht2_test_locate.cpp") -create_single_source_cgal_program("ht2_test_remove.cpp") -create_single_source_cgal_program("ht2_test_swap.cpp") -create_single_source_cgal_program("ht2_test_copy.cpp") -create_single_source_cgal_program("ht2_test_hyperbolic_circulator.cpp") -create_single_source_cgal_program("ht2_test_insert_degenerate.cpp") +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("ht2_test_clear.cpp") + create_single_source_cgal_program("ht2_test_locate.cpp") + create_single_source_cgal_program("ht2_test_remove.cpp") + create_single_source_cgal_program("ht2_test_swap.cpp") + create_single_source_cgal_program("ht2_test_copy.cpp") + create_single_source_cgal_program("ht2_test_hyperbolic_circulator.cpp") + create_single_source_cgal_program("ht2_test_insert_degenerate.cpp") +else() + message("NOTICE: Tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() From 9ba631d07cfaba0955763c059fc9ee8fff0555ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 23:18:49 +0100 Subject: [PATCH 16/19] Fix using c++17 static asserts --- .../include/CGAL/create_weighted_offset_polygons_2.h | 2 +- .../include/CGAL/create_weighted_straight_skeleton_2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h index 96783aaa244..612e1f1858e 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h @@ -127,7 +127,7 @@ create_partial_exterior_weighted_straight_skeleton_2(const FT& aMaxOffset, typedef typename Kernel_traits::Kernel IK; typedef typename IK::FT IFT; - static_assert((std::is_same::value_type, IFT>::value)); + static_assert((std::is_same::value_type, IFT>::value), "Vertices and weights should have the same FT"); boost::shared_ptr > rSkeleton; diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h index 5dfe7354467..33f13a015b2 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h @@ -148,7 +148,7 @@ create_exterior_weighted_straight_skeleton_2(const FT& max_offset, using IK = typename Kernel_traits::Kernel; using IFT = typename IK::FT; - static_assert((std::is_same::value_type, IFT>::value)); + static_assert((std::is_same::value_type, IFT>::value), "Vertices and weights should have the same FT"); boost::shared_ptr > skeleton; From dd99f3d526a4357dcf96e592d38056f75e7beedd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 8 Nov 2024 10:13:26 +0000 Subject: [PATCH 17/19] PMP: Initialize to avoid warning --- Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index c8a311a37ae..8ba6b462322 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -714,7 +714,7 @@ private: { Vector_3 bmin, bmax; - Orientation ori; + Orientation ori = ON_ORIENTED_BOUNDARY; // to avoid maybe uninitialzed warning for (unsigned int i = 0; i < prismindex.size(); i++){ if (prismindex[i] == jump){ From 009a7963a867c74971cfc224484776abf3e706d4 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 14 Nov 2024 10:22:43 +0100 Subject: [PATCH 18/19] Spelling correction Spelling correction --- Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index 8ba6b462322..566e64d3a1e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -714,7 +714,7 @@ private: { Vector_3 bmin, bmax; - Orientation ori = ON_ORIENTED_BOUNDARY; // to avoid maybe uninitialzed warning + Orientation ori = ON_ORIENTED_BOUNDARY; // to avoid maybe uninitialized warning for (unsigned int i = 0; i < prismindex.size(); i++){ if (prismindex[i] == jump){ From ad7f8d30416987d3094428d3999fea803a9bfef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Sun, 23 Mar 2025 23:54:35 +0100 Subject: [PATCH 19/19] Remove unused variables --- Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index 566e64d3a1e..a18cfe24621 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -712,8 +712,6 @@ private: bool point_out_prism_return_local_id(const Point_3 &point, const ePoint_3 &epoint, const std::vector &prismindex, const unsigned int jump, int &id) const { - Vector_3 bmin, bmax; - Orientation ori = ON_ORIENTED_BOUNDARY; // to avoid maybe uninitialized warning for (unsigned int i = 0; i < prismindex.size(); i++){