From 0b55dc477daf62bdf3f682d8091ff84906fe9114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Mar 2025 20:37:08 +0100 Subject: [PATCH 01/29] look for a feature edge around the vertex --- .../CGAL/Polygon_mesh_processing/detect_features.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h index f8ade3bed27..040b7447ac2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/detect_features.h @@ -334,8 +334,17 @@ void detect_vertex_incident_patches(const PolygonMesh& pmesh, for(vertex_descriptor vit :vertices(pmesh)) { // Look only at feature vertices - if(!get(edge_is_feature_map, edge(halfedge(vit, pmesh), pmesh))) - continue; + bool skip=true; + for(halfedge_descriptor he : halfedges_around_target(vit, pmesh)) + { + if(get(edge_is_feature_map, edge(he, pmesh))) + { + skip=false; + break; + } + } + + if (skip) continue; // Loop on incident facets of vit typename VertexIncidentPatchesMap::value_type& id_set = vertex_incident_patches_map[vit]; From d4fa45f376461dfad835d84adedbbb6249eeeb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 3 Mar 2025 20:43:54 +0100 Subject: [PATCH 02/29] add test from the issue --- .../Polygon_mesh_processing/CMakeLists.txt | 1 + .../Polygon_mesh_processing/issue_8730.cpp | 145 ++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 5f95e3eb196..78fbd76a744 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -66,6 +66,7 @@ create_single_source_cgal_program("test_pmp_polyhedral_envelope.cpp") create_single_source_cgal_program("test_pmp_np_function.cpp") create_single_source_cgal_program("test_degenerate_pmp_clip_split_corefine.cpp") create_single_source_cgal_program("test_corefinement_cavities.cpp") +create_single_source_cgal_program("issue_8730.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp new file mode 100644 index 00000000000..5ec9cf0898c --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp @@ -0,0 +1,145 @@ +#include +#include +#include + +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Point_3 = Kernel::Point_3; + +using Surface_mesh = CGAL::Surface_mesh; + +using vertex_index = Surface_mesh::vertex_index; +using halfedge_index = Surface_mesh::halfedge_index; +using face_index = Surface_mesh::face_index; +using edge_index = Surface_mesh::edge_index; + + +std::vector points = { + {0,0,0}, + {0,0.5,0}, + {0,1,0}, + {0.5,0,0}, + {0.5,0.5,0}, + {0.5,1,0}, + {1,0,0}, + {1,0.5,0}, + {1,1,0}, + {0,0,0.5}, + {0,0.5,0.5}, + {0,1,0.5}, + {0.5,0,0.5}, + {0.5,1,0.5}, + {1,0,0.5}, + {1,0.5,0.5}, + {1,1,0.5}, + {0,0,1}, + {0,0.5,1}, + {0,1,1}, + {0.5,0,1}, + {0.5,0.5,1}, + {0.5,1,1}, + {1,0,1}, + {1,0.5,1}, + {1,1,1} +}; + +std::vector> faces = { + {7,4,5}, + {7,6,4}, + {7,5,8}, + {4,2,5}, + {2,4,1}, + {11,5,2}, + {11,13,5}, + {11,2,10}, + {2,1,10}, + {11,10,18}, + {11,18,19}, + {10,17,18}, + {10,9,17}, + {20,18,17}, + {20,21,18}, + {12,20,17}, + {12,14,20}, + {12,17,9}, + {3,12,9}, + {3,6,12}, + {3,9,0}, + {3,0,1}, + {9,1,0}, + {1,9,10}, + {3,1,4}, + {6,3,4}, + {12,6,14}, + {6,7,14}, + {15,14,7}, + {14,15,23}, + {15,7,8}, + {15,8,16}, + {24,15,16}, + {16,8,13}, + {22,16,13}, + {13,8,5}, + {22,25,16}, + {22,13,19}, + {13,11,19}, + {22,19,21}, + {21,24,22}, + {19,18,21}, + {21,23,24}, + {22,24,25}, + {24,16,25}, + {23,21,20}, + {24,23,15}, + {14,23,20} +}; + +int main() +{ + Surface_mesh mesh; + std::vector vertices(points.size()); + for (size_t i = 0; i < points.size(); ++i) + { + vertices[i] = mesh.add_vertex(points[i]); + } + + for (size_t i = 0; i < faces.size(); ++i) + { + vertex_index v0 = vertices[faces[i][0]]; + vertex_index v1 = vertices[faces[i][1]]; + vertex_index v2 = vertices[faces[i][2]]; + mesh.add_face(v0, v1, v2); + } + + auto vertexToPatches = mesh.add_property_map>("v:patches").first; + auto faceToPatch = mesh.add_property_map("f:patch", std::numeric_limits::max()).first; + auto edgeToIsFeature = mesh.add_property_map("e:is_feature", false).first; + + double angle_in_deg = 90; + + CGAL::Polygon_mesh_processing::detect_sharp_edges(mesh, angle_in_deg, edgeToIsFeature); + + auto number_of_patches = CGAL::Polygon_mesh_processing:: + connected_components(mesh, faceToPatch, + CGAL::parameters::edge_is_constrained_map(edgeToIsFeature)); + + assert(number_of_patches==6); + + CGAL::Polygon_mesh_processing::detect_vertex_incident_patches(mesh, + faceToPatch, vertexToPatches, edgeToIsFeature); + + std::array degrees = CGAL::make_array(0,0,0,0); + + for (auto v : mesh.vertices()) + { + auto d = vertexToPatches[v].size(); + assert(d<4); + degrees[d]+=1; + } + + assert(degrees[0]==6); + assert(degrees[1]==0); + assert(degrees[2]==12); + assert(degrees[3]==8); + + return 0; +} \ No newline at end of file From dbee57b896f1df19ace9dcc56fccfbe9972f7fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 4 Mar 2025 10:01:46 +0100 Subject: [PATCH 03/29] protect macro --- .../test/Polygon_mesh_processing/issue_8730.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp index 5ec9cf0898c..79dbcfc91a2 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp @@ -111,7 +111,7 @@ int main() } auto vertexToPatches = mesh.add_property_map>("v:patches").first; - auto faceToPatch = mesh.add_property_map("f:patch", std::numeric_limits::max()).first; + auto faceToPatch = mesh.add_property_map("f:patch", (std::numeric_limits::max)()).first; auto edgeToIsFeature = mesh.add_property_map("e:is_feature", false).first; double angle_in_deg = 90; 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 04/29] 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 05/29] 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 06/29] 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 07/29] 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 08/29] 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 09/29] 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 10/29] 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 11/29] 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 12/29] 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 13/29] 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 14/29] 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 15/29] 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 16/29] 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 17/29] 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 18/29] 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 19/29] 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 20/29] 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 21/29] 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 22/29] 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++){ From 8f0944a5ee9ed40bd0b62b94e112e417dc70d069 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 27 Mar 2025 10:34:25 +0100 Subject: [PATCH 23/29] inlining functions to prevent multiple definition --- .../include/CGAL/KSP/debug.h | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Kinetic_space_partition/include/CGAL/KSP/debug.h b/Kinetic_space_partition/include/CGAL/KSP/debug.h index 6177e94f929..2b750a0231a 100644 --- a/Kinetic_space_partition/include/CGAL/KSP/debug.h +++ b/Kinetic_space_partition/include/CGAL/KSP/debug.h @@ -40,7 +40,7 @@ namespace CGAL { namespace KSP_3 { namespace internal { -const std::tuple +inline const std::tuple get_idx_color(std::size_t idx) { CGAL::Random rand(static_cast(idx)); @@ -50,7 +50,7 @@ get_idx_color(std::size_t idx) { static_cast(rand.get_int(32, 192))); } -CGAL::IO::Color get_color(std::size_t idx) { +inline CGAL::IO::Color get_color(std::size_t idx) { CGAL::Random rand(static_cast(idx)); return CGAL::IO::Color(rand.get_int(32, 192), rand.get_int(32, 192), rand.get_int(32, 192)); } @@ -929,7 +929,7 @@ void dump_polygon(const std::vector& pts, const std::string saver.export_polygon_soup_3(pts2, filename); } -void dump_polygon(const std::vector& pts, const std::string& filename) { +inline void dump_polygon(const std::vector& pts, const std::string& filename) { Saver saver; std::vector > pts2; pts2.push_back(pts); @@ -937,7 +937,7 @@ void dump_polygon(const std::vector& pts, const std::strin saver.export_polygon_soup_3(pts2, filename); } -void dump_polygona(const std::vector& pts, const std::string& filename) { +inline void dump_polygona(const std::vector& pts, const std::string& filename) { Saver saver; std::vector > pts2; pts2.push_back(pts); @@ -945,30 +945,31 @@ void dump_polygona(const std::vector& pts, const std::stri saver.export_polygon_soup_3(pts2, filename); } -void dump_polygons(const std::vector >& pts, const std::string& filename) { - Saver saver; - - saver.export_polygon_soup_3(pts, filename); -} -void dump_polygons(const std::vector > >& pts, const std::string& filename) { +inline void dump_polygons(const std::vector >& pts, const std::string& filename) { Saver saver; saver.export_polygon_soup_3(pts, filename); } -void dump_indexed_triangles(const std::vector& pts, const std::vector& tris, const std::string& filename) { +inline void dump_polygons(const std::vector > >& pts, const std::string& filename) { + Saver saver; + + saver.export_polygon_soup_3(pts, filename); +} + +inline void dump_indexed_triangles(const std::vector& pts, const std::vector& tris, const std::string& filename) { Saver saver; saver.export_indexed_triangles_3(pts, tris, filename); } -void dump_indexed_polygons(const std::vector& pts, const std::vector >& polys, const std::string& filename) { +inline void dump_indexed_polygons(const std::vector& pts, const std::vector >& polys, const std::string& filename) { Saver saver; saver.export_indexed_polygons_3(pts, polys, filename); } - void dump_polygons(const std::vector >& pts, const std::vector& colors, const std::string& filename) { +inline void dump_polygons(const std::vector >& pts, const std::vector& colors, const std::string& filename) { Saver saver; saver.export_polygon_soup_3(pts, colors, filename); @@ -1013,7 +1014,7 @@ void dump_polygons( saver.export_polygon_soup_3(polygons, name); } -void dump_points(const std::vector& pts, const std::vector& normals, const std::vector& colors, const std::string& filename) { +inline void dump_points(const std::vector& pts, const std::vector& normals, const std::vector& colors, const std::string& filename) { Saver saver; saver.export_points_3(pts, normals, colors, filename); } From adc4caa0f2844cf26a38355579179873a5381e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 31 Mar 2025 08:58:47 +0200 Subject: [PATCH 24/29] add missing include directive --- Hash_map/include/CGAL/Hash_map/internal/chained_map.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h index 729e2a58092..de33fbc6c6b 100644 --- a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h +++ b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h @@ -17,6 +17,7 @@ #define CGAL_HASH_MAP_INTERNAL_CHAINED_MAP_H #include +#inclue #include #include From 9285e5c2302b2708c6da6168140b75fad4fd7f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 31 Mar 2025 09:01:38 +0200 Subject: [PATCH 25/29] add empty line --- .../test/Polygon_mesh_processing/issue_8730.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp index 79dbcfc91a2..ee9493ffff9 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/issue_8730.cpp @@ -142,4 +142,4 @@ int main() assert(degrees[3]==8); return 0; -} \ No newline at end of file +} From 0e34a2ef42d68453675d199980b94872535c3a99 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 21 Mar 2025 13:24:23 +0100 Subject: [PATCH 26/29] adapted solver interface to osqp api change --- Documentation/doc/Documentation/Third_party.txt | 2 +- .../include/CGAL/OSQP_quadratic_program_traits.h | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index a9cf57c8ed3..b794ff4911f 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -320,7 +320,7 @@ The \scip web site is `https://www.scipopt.or \osqp (Operator Splitting Quadratic Program) is currently one of the fastest open source solvers for convex Quadratic Programs (QP). In \cgal, \osqp provides an optional solver for the quadratic programming used in the \ref PkgShapeRegularization package. -In order to use \osqp in \cgal programs, the executables should be linked with the CMake imported target `CGAL::OSQP_support` provided in `CGAL_OSQP_support.cmake`. +In order to use \osqp in \cgal programs, the executables should be linked with the CMake imported target `CGAL::OSQP_support` provided in `CGAL_OSQP_support.cmake`. \cgal is compatible with the master branch of `https://github.com/osqp/osqp`. The \osqp web site is `https://osqp.org`. diff --git a/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h b/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h index 261c4c514b0..be1f6a6579d 100644 --- a/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h +++ b/Solver_interface/include/CGAL/OSQP_quadratic_program_traits.h @@ -216,15 +216,12 @@ public: set_qlu_data(q_x.get(), l_x.get(), u_x.get()); // Problem settings. - OSQPSettings *settings = (OSQPSettings *) malloc(sizeof(OSQPSettings)); + OSQPSettings *settings = OSQPSettings_new(); CGAL_assertion(settings); // Structures. - OSQPCscMatrix* P = static_cast(malloc(sizeof(OSQPCscMatrix))); - OSQPCscMatrix* A = static_cast(malloc(sizeof(OSQPCscMatrix))); - - csc_set_data(A, m, n, A_nnz, A_x.get(), A_i.get(), A_p.get()); - csc_set_data(P, n, n, P_nnz, P_x.get(), P_i.get(), P_p.get()); + OSQPCscMatrix* A = OSQPCscMatrix_new(m, n, A_nnz, A_x.get(), A_i.get(), A_p.get()); + OSQPCscMatrix* P = OSQPCscMatrix_new(n, n, P_nnz, P_x.get(), P_i.get(), P_p.get()); // Set solver settings. osqp_set_default_settings(settings); @@ -254,9 +251,9 @@ public: } osqp_cleanup(solver); - if (A) free(A); - if (P) free(P); - if (settings) free(settings); + if (A) OSQPCscMatrix_free(A); + if (P) OSQPCscMatrix_free(P); + if (settings) OSQPSettings_free(settings); return (exitflag == 0); } From 6819eae559c3aedd71f5c6678fe6de7a9bde2f36 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 26 Mar 2025 09:53:39 +0100 Subject: [PATCH 27/29] Updating doc for osqp --- Documentation/doc/Documentation/Third_party.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index b794ff4911f..df80fbf712f 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -320,7 +320,7 @@ The \scip web site is `https://www.scipopt.or \osqp (Operator Splitting Quadratic Program) is currently one of the fastest open source solvers for convex Quadratic Programs (QP). In \cgal, \osqp provides an optional solver for the quadratic programming used in the \ref PkgShapeRegularization package. -In order to use \osqp in \cgal programs, the executables should be linked with the CMake imported target `CGAL::OSQP_support` provided in `CGAL_OSQP_support.cmake`. \cgal is compatible with the master branch of `https://github.com/osqp/osqp`. +In order to use \osqp in \cgal programs, the executables should be linked with the CMake imported target `CGAL::OSQP_support` provided in `CGAL_OSQP_support.cmake`. \cgal is compatible with \osqp version 1.0.0. The \osqp web site is `https://osqp.org`. From f8a3facc686694f19f5f4a6c03da2eaba5679c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 31 Mar 2025 09:42:52 +0200 Subject: [PATCH 28/29] missing d --- Hash_map/include/CGAL/Hash_map/internal/chained_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h index de33fbc6c6b..b16aa037ef5 100644 --- a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h +++ b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h @@ -17,7 +17,7 @@ #define CGAL_HASH_MAP_INTERNAL_CHAINED_MAP_H #include -#inclue +#include #include #include From 108d8671abcd1a0daffef8041f12b41bf1ad7226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 31 Mar 2025 14:14:52 +0200 Subject: [PATCH 29/29] fix dependencies --- Hash_map/package_info/Hash_map/dependencies | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Hash_map/package_info/Hash_map/dependencies b/Hash_map/package_info/Hash_map/dependencies index 25b30f26b79..b611de33d8e 100644 --- a/Hash_map/package_info/Hash_map/dependencies +++ b/Hash_map/package_info/Hash_map/dependencies @@ -1,3 +1,5 @@ Hash_map Installation +Kernel_23 +Profiling_tools STL_Extension