From 566149c0cca8a70bd3153a620e8eac64dfdbc7ec Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 29 Nov 2023 08:22:24 +0100 Subject: [PATCH 01/95] FacetTriangulator: removing ghost edges from cdt and using mark_domain_in_triangulation --- .../Polyhedron/Plugins/IO/PLY_io_plugin.cpp | 2 +- .../Polyhedron/Scene_polygon_soup_item.cpp | 3 +- .../Polyhedron/Scene_surface_mesh_item.cpp | 1 + .../demo/Polyhedron/triangulate_primitive.h | 65 +++++++++++++++++-- .../include/CGAL/IO/PLY/PLY_reader.h | 6 ++ 5 files changed, 70 insertions(+), 7 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index fe4120c5919..e7d371e0891 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -132,7 +132,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { std::vector fcolors; std::vector vcolors; - if (!(CGAL::IO::read_PLY (in, points, polygons, fcolors, vcolors))) + if (!(CGAL::IO::read_PLY (in, points, polygons, fcolors, vcolors, true))) { QApplication::restoreOverrideCursor(); ok = false; diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index 8ba8813f349..a7e32dc0d26 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -150,6 +150,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol pointIds.push_back(pointId); } while( ++it != it_end ); //detect degenerated faces +/* std::vector pid_stack = pointIds; for(std::size_t i = 0; i< pointIds.size(); ++i) { @@ -162,7 +163,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol return; } } - } + }*/ FT triangulation(pointIds,normal); //iterates on the internal faces to add the vertices to the positions //and the normals to the appropriate vectors diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 49e2da75e65..3dce2285c44 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -1040,6 +1040,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, } } + void delete_aabb_tree(Scene_surface_mesh_item* item) { QVariant aabb_tree_property = item->property(aabb_property_name); diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index cf7aa8a457b..fd154ad0514 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -45,7 +46,7 @@ public: using Fbb = CGAL::Triangulation_face_base_with_info_2; using Fb = CGAL::Constrained_triangulation_face_base_2; using TDS = CGAL::Triangulation_data_structure_2; - using Itag = CGAL::Exact_predicates_tag; + using Itag = CGAL::Exact_predicates_tag;//Exact_intersections_tag using CDT = CGAL::Constrained_Delaunay_triangulation_2; using Vertex_handle = typename CDT::Vertex_handle; @@ -121,13 +122,40 @@ private: P_traits cdt_traits(normal); cdt = new CDT(cdt_traits); + std::map, std::size_t> edge_map; + std::vector skip(idPoints.size(), false); + bool has_ghost_edges = false; + +/* + for (std::size_t i = 0; i < idPoints.size(); i++) { + int prev = (i - 1 + idPoints.size()) % idPoints.size(); + if (idPoints[i].point < idPoints[prev].point) { + auto it = edge_map.emplace(std::make_pair(idPoints[i].point, idPoints[prev].point), i); + if (!it.second) { + skip[i] = true; + skip[it.first->second] = true; + has_ghost_edges = true; + } + } + else { + auto it = edge_map.emplace(std::make_pair(idPoints[prev].point, idPoints[i].point), i); + if (!it.second) { + skip[i] = true; + skip[it.first->second] = true; + has_ghost_edges = true; + } + } + }*/ + Vertex_handle previous, first, last_inserted; + std::size_t previd, firstid, lastid; // Iterate the points of the facet and decide if they must be inserted in the CDT typename Kernel::FT x(0), y(0), z(0); - for(const PointAndId& idPoint : idPoints) + for(std::size_t i = 0;iinsert(idPoint.point); v2v[vh] = idPoint.id; - if(first == Vertex_handle()) + if (first == Vertex_handle()) { first = vh; + firstid = idPoint.id; + } if(previous != nullptr && previous != vh) { - cdt->insert_constraint(previous, vh); + if (!skip[i]) + cdt->insert_constraint(previous, vh); last_inserted = previous; + lastid = previd; } previous = vh; + previd = idPoint.id; } } if(last_inserted == Vertex_handle()) return false; - if(previous != first) + if(previous != first && !skip[0]) cdt->insert_constraint(previous, first); +/* + std::vector pts; + std::ofstream vout("test.polylines.txt"); + for (auto& e : cdt->constrained_edges()) { + // edge is a pair of Face_handle and index + auto v1 = e.first->vertex((e.second + 1) % 3); + auto v2 = e.first->vertex((e.second + 2) % 3); + pts.push_back(v1->point()); + pts.push_back(v2->point()); + vout << "2 " << v1->point() << " " << v2->point() << std::endl; + } + vout.close();*/ + // sets mark is_external for(Face_handle f2 : cdt->all_face_handles()) f2->info().is_external = false; + std::unordered_map in_domain_map; + boost::associative_property_map< std::unordered_map > in_domain(in_domain_map); + CGAL::mark_domain_in_triangulation(*cdt, in_domain); + // check if the facet is external or internal +/* std::queue face_queue; face_queue.push(cdt->infinite_vertex()->face()); while(! face_queue.empty()) @@ -176,6 +227,10 @@ private: if(!cdt->is_constrained(std::make_pair(fh, i))) face_queue.push(fh->neighbor(i)); } + }*/ + + for (const Face_handle& fh : cdt->all_face_handles()) { + fh->info().is_external = !get(in_domain, fh); } return true; diff --git a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h index ee8b18ef59c..c1a0ab4e580 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h @@ -726,6 +726,9 @@ bool read_PLY_faces(std::istream& in, for(std::size_t j = 0; j < element.number_of_items(); ++ j) { + if (j == 228) + std::cout << std::endl; + for(std::size_t k = 0; k < element.number_of_properties(); ++ k) { PLY_read_number* property = element.property(k); @@ -758,6 +761,9 @@ bool read_PLY_faces(std::istream& in, PLY_property >(vertex_indices_tag))); } + if (get<0>(new_face).size() == 0) + std::cout << "empty face encountered" << std::endl; + polygons.emplace_back(); ::CGAL::internal::resize(polygons.back(), get<0>(new_face).size()); for(std::size_t i = 0; i < get<0>(new_face).size(); ++ i) From 9115847ed4c7f95b9cf727cd1af896cc74759747 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 30 Nov 2023 16:03:28 +0100 Subject: [PATCH 02/95] added handling for rendering of non-triangular faces with ghost edges ghost edges are not added to cdt in FacetTriangulator mark_domain_in_triangulation is used to mark holes as external --- .../Plugins/PMP/Distance_plugin.cpp | 57 +++--- .../Polyhedron/Scene_polygon_soup_item.cpp | 106 +++++------ .../Scene_polyhedron_selection_item.cpp | 39 ++-- .../Polyhedron/Scene_surface_mesh_item.cpp | 123 +++++++------ .../demo/Polyhedron/triangulate_primitive.h | 169 ++++++++---------- 5 files changed, 238 insertions(+), 256 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp index d6d3c6a1a45..72e1475f82f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp @@ -190,13 +190,10 @@ private: for(boost::graph_traits::face_descriptor f : faces(*poly)) { Vector nf = get(nf_pmap, f); - typedef FacetTriangulator::vertex_descriptor> FT; - //compute distance with other polyhedron //sample facet std::vector sampled_points; - std::size_t nb_points = (std::max)((int)std::ceil(nb_pts_per_face * PMP::face_area(f,*poly,CGAL::parameters::geom_traits(Kernel()))), - 1); + std::size_t nb_points = (std::max)((int)std::ceil(nb_pts_per_face * PMP::face_area(f,*poly,CGAL::parameters::geom_traits(Kernel()))), 1); Kernel::Point_3 &p = get(vpmap,target(halfedge(f,*poly),*poly)); Kernel::Point_3 &q = get(vpmap,target(next(halfedge(f,*poly),*poly),*poly)); Kernel::Point_3 &r = get(vpmap,target(next(next(halfedge(f,*poly),*poly),*poly),*poly)); @@ -207,36 +204,42 @@ private: sampled_points.push_back(r); //triangle facets with sample points for color display - FT triangulation(f,sampled_points,nf,poly); + auto func = [&](auto& ffit, auto& v2v) { + if (ffit.info().is_external) + return; - if(triangulation.cdt->dimension() != 2 ) - { - qDebug()<<"Error : cdt not right (dimension != 2). Facet not displayed"; - continue; - } - - //iterates on the internal faces to add the vertices to the positions - //and the normals to the appropriate vectors - - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; - - for (int i = 0; i<3; ++i) + for (int i = 0; i < 3; ++i) { - total_points.push_back(ffit->vertex(i)->point()); - m_vertices.push_back(ffit->vertex(i)->point().x()); - m_vertices.push_back(ffit->vertex(i)->point().y()); - m_vertices.push_back(ffit->vertex(i)->point().z()); + total_points.push_back(ffit.vertex(i)->point()); + m_vertices.push_back(ffit.vertex(i)->point().x()); + m_vertices.push_back(ffit.vertex(i)->point().y()); + m_vertices.push_back(ffit.vertex(i)->point().z()); normals.push_back(nf.x()); normals.push_back(nf.y()); normals.push_back(nf.z()); } + }; + + try { + FacetTriangulator::vertex_descriptor> triangulation(f, sampled_points, nf, poly); + + if (triangulation.cdt->dimension() != 2) + { + qDebug() << "Error : cdt not right (dimension != 2). Facet not displayed"; + continue; + } + triangulation.per_face(func); + } + catch (...) { + FacetTriangulator::vertex_descriptor, CGAL::Exact_intersections_tag> triangulation(f, sampled_points, nf, poly); + + if (triangulation.cdt->dimension() != 2) + { + qDebug() << "Error : cdt not right (dimension != 2). Facet not displayed"; + continue; + } + triangulation.per_face(func); } } //compute the distances diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index a7e32dc0d26..7bdc0f69a0c 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -137,81 +137,71 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol if (normal == CGAL::NULL_VECTOR) // No normal could be computed, return return; - typedef FacetTriangulator FT; + typedef std::pair PointAndId; std::size_t it = 0; std::size_t it_end =pit->size(); - std::vector pointIds; + std::vector pointIds; do { - FT::PointAndId pointId; + PointAndId pointId; - pointId.point = soup->points[pit->at(it)]+offset; - pointId.id = pit->at(it); + pointId.first = soup->points[pit->at(it)]+offset; + pointId.second = pit->at(it); pointIds.push_back(pointId); } while( ++it != it_end ); - //detect degenerated faces -/* - std::vector pid_stack = pointIds; - for(std::size_t i = 0; i< pointIds.size(); ++i) - { - FT::PointAndId pid = pid_stack.back(); - pid_stack.pop_back(); - for(FT::PointAndId poai : pid_stack) - { - if (pid.point== poai.point) - { - return; - } - } - }*/ - FT triangulation(pointIds,normal); + //iterates on the internal faces to add the vertices to the positions //and the normals to the appropriate vectors - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; + auto f = [&](auto& ffit, auto& v2v) { + if (ffit.info().is_external) + return; - positions_poly.push_back(ffit->vertex(0)->point().x()); - positions_poly.push_back(ffit->vertex(0)->point().y()); - positions_poly.push_back(ffit->vertex(0)->point().z()); + positions_poly.push_back(ffit.vertex(0)->point().x()); + positions_poly.push_back(ffit.vertex(0)->point().y()); + positions_poly.push_back(ffit.vertex(0)->point().z()); + positions_poly.push_back(ffit.vertex(1)->point().x()); + positions_poly.push_back(ffit.vertex(1)->point().y()); + positions_poly.push_back(ffit.vertex(1)->point().z()); - positions_poly.push_back(ffit->vertex(1)->point().x()); - positions_poly.push_back(ffit->vertex(1)->point().y()); - positions_poly.push_back(ffit->vertex(1)->point().z()); + positions_poly.push_back(ffit.vertex(2)->point().x()); + positions_poly.push_back(ffit.vertex(2)->point().y()); + positions_poly.push_back(ffit.vertex(2)->point().z()); - positions_poly.push_back(ffit->vertex(2)->point().x()); - positions_poly.push_back(ffit->vertex(2)->point().y()); - positions_poly.push_back(ffit->vertex(2)->point().z()); - - CGAL::IO::Color color; - if(!soup->fcolors.empty()) - color = soup->fcolors[polygon_id]; - for(int i=0; i<3; i++) + CGAL::IO::Color color; + if (!soup->fcolors.empty()) + color = soup->fcolors[polygon_id]; + for (int i = 0; i < 3; i++) + { + normals.push_back(normal.x()); + normals.push_back(normal.y()); + normals.push_back(normal.z()); + if (!soup->fcolors.empty()) { - normals.push_back(normal.x()); - normals.push_back(normal.y()); - normals.push_back(normal.z()); - if(!soup->fcolors.empty()) - { - f_colors.push_back(static_cast(color.red())/255); - f_colors.push_back(static_cast(color.green())/255); - f_colors.push_back(static_cast(color.blue())/255); - } - if(!soup->vcolors.empty()) - { - CGAL::IO::Color vcolor = soup->vcolors[triangulation.v2v[ffit->vertex(i)]]; - v_colors.push_back(static_cast(vcolor.red())/255); - v_colors.push_back(static_cast(vcolor.green())/255); - v_colors.push_back(static_cast(vcolor.blue())/255); - } + f_colors.push_back(static_cast(color.red()) / 255); + f_colors.push_back(static_cast(color.green()) / 255); + f_colors.push_back(static_cast(color.blue()) / 255); } + if (!soup->vcolors.empty()) + { + CGAL::IO::Color vcolor = soup->vcolors[v2v[ffit.vertex(i)]]; + v_colors.push_back(static_cast(vcolor.red()) / 255); + v_colors.push_back(static_cast(vcolor.green()) / 255); + v_colors.push_back(static_cast(vcolor.blue()) / 255); + } + } + }; + + try { + FacetTriangulator triangulation(pointIds, normal); + triangulation.per_face(f); + } + catch (...) { + FacetTriangulator triangulation(pointIds, normal); + triangulation.per_face(f); } } + void Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{ diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 893b6bac719..70cda242d01 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -282,26 +282,29 @@ Scene_polyhedron_selection_item_priv::triangulate_facet(fg_face_descriptor fit,c const CGAL::qglviewer::Vec off = Three::mainViewer()->offset(); EPICK::Vector_3 offset(off.x,off.y,off.z); - typedef FacetTriangulator FT; - FT triangulation(fit,normal,poly, offset); - //iterates on the internal faces to add the vertices to the positions - //and the normals to the appropriate vectors - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; + //iterates on the internal faces to add the vertices to the positions + //and the normals to the appropriate vectors + auto f = [&](auto& ffit, auto& v2v) { + if (ffit.info().is_external) + return; - push_back_xyz(ffit->vertex(0)->point(), p_facets); - push_back_xyz(ffit->vertex(1)->point(), p_facets); - push_back_xyz(ffit->vertex(2)->point(), p_facets); + push_back_xyz(ffit.vertex(0)->point(), p_facets); + push_back_xyz(ffit.vertex(1)->point(), p_facets); + push_back_xyz(ffit.vertex(2)->point(), p_facets); - push_back_xyz(normal, p_normals); - push_back_xyz(normal, p_normals); - push_back_xyz(normal, p_normals); - } + push_back_xyz(normal, p_normals); + push_back_xyz(normal, p_normals); + push_back_xyz(normal, p_normals); + }; + + try { + FacetTriangulator triangulation(fit, normal, poly, offset); + triangulation.per_face(f); + } + catch (...) { + FacetTriangulator triangulation(fit, normal, poly, offset); + triangulation.per_face(f); + } } diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 3dce2285c44..688cf858745 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -984,60 +984,63 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, return; } - typedef FacetTriangulator::vertex_descriptor> FT; const CGAL::qglviewer::Vec off = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); EPICK::Vector_3 offset(off.x,off.y,off.z); - FT triangulation(fd,normal,smesh_, offset); + //iterates on the internal faces - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; + auto f = [&](auto& ffit, auto& v2v) { + if (ffit.info().is_external) + return; //add the vertices to the positions //adds the vertices, normals and colors to the appropriate vectors - if(!index) + if (!index) { CGAL::IO::Color* color; - if(has_fpatch_id) + if (has_fpatch_id) { - QColor c= item->color_vector()[fpatch_id_map[fd] - min_patch_id]; - color = new CGAL::IO::Color(c.red(),c.green(),c.blue()); + QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; + color = new CGAL::IO::Color(c.red(), c.green(), c.blue()); } - else if(has_fcolors) + else if (has_fcolors) color = &(*fcolors)[fd]; else color = nullptr; - addFlatData(ffit->vertex(0)->point()-offset, - (*fnormals)[fd], - color, - name); - addFlatData(ffit->vertex(1)->point()-offset, - (*fnormals)[fd], - color, - name); + addFlatData(ffit.vertex(0)->point() - offset, + (*fnormals)[fd], + color, + name); + addFlatData(ffit.vertex(1)->point() - offset, + (*fnormals)[fd], + color, + name); - addFlatData(ffit->vertex(2)->point()-offset, - (*fnormals)[fd], - color, - name); - if(has_fpatch_id) + addFlatData(ffit.vertex(2)->point() - offset, + (*fnormals)[fd], + color, + name); + if (has_fpatch_id) delete color; } //adds the indices to the appropriate vector else { - if(name.testFlag(Scene_item_rendering_helper::GEOMETRY)) + if (name.testFlag(Scene_item_rendering_helper::GEOMETRY)) { - idx_data_.push_back((*im)[triangulation.v2v[ffit->vertex(0)]]); - idx_data_.push_back((*im)[triangulation.v2v[ffit->vertex(1)]]); - idx_data_.push_back((*im)[triangulation.v2v[ffit->vertex(2)]]); + idx_data_.push_back((*im)[v2v[ffit.vertex(0)]]); + idx_data_.push_back((*im)[v2v[ffit.vertex(1)]]); + idx_data_.push_back((*im)[v2v[ffit.vertex(2)]]); } } + }; + try { + FacetTriangulator::vertex_descriptor> triangulation(fd, normal, smesh_, offset); + triangulation.per_face(f); + } + catch (...) { + FacetTriangulator::vertex_descriptor, CGAL::Exact_intersections_tag> triangulation(fd, normal, smesh_, offset); + triangulation.per_face(f); } } @@ -1357,7 +1360,6 @@ void Scene_surface_mesh_item::invalidate(Gl_data_names name) QList Scene_surface_mesh_item_priv::triangulate_primitive(face_descriptor fit, EPICK::Vector_3 normal) { - typedef FacetTriangulator::vertex_descriptor> FT; //The output list QList res; //check if normal contains NaN values @@ -1366,23 +1368,27 @@ QList Scene_surface_mesh_item_priv::triangulate_primitive(fac qDebug()<<"Warning in triangulation of the selection item: normal contains NaN values and is not valid."; return QList(); } - FT triangulation(fit,normal,smesh_); + //iterates on the internal faces to add the vertices to the positions //and the normals to the appropriate vectors - for( FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; + auto f = [&](auto &ffit, auto& v2v) { + if (ffit.info().is_external) + return; + res << EPICK::Triangle_3(ffit.vertex(0)->point(), + ffit.vertex(1)->point(), + ffit.vertex(2)->point()); + }; - res << EPICK::Triangle_3(ffit->vertex(0)->point(), - ffit->vertex(1)->point(), - ffit->vertex(2)->point()); - + try { + FacetTriangulator::vertex_descriptor> triangulation(fit, normal, smesh_); + triangulation.per_face(f); } + catch (...) { + FacetTriangulator::vertex_descriptor, CGAL::Exact_intersections_tag> triangulation(fit, normal, smesh_); + triangulation.per_face(f); + } + return res; } @@ -2620,21 +2626,24 @@ void Scene_surface_mesh_item::fill_flat_vertex_map() return; } - typedef FacetTriangulator::vertex_descriptor> FT; const CGAL::qglviewer::Vec off = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); EPICK::Vector_3 offset(off.x,off.y,off.z); - FT triangulation(fd,normal,face_graph(), offset); - //iterates on the internal faces - for(FT::CDT::Finite_faces_iterator - ffit = triangulation.cdt->finite_faces_begin(), - end = triangulation.cdt->finite_faces_end(); - ffit != end; ++ffit) - { - if(ffit->info().is_external) - continue; - d->flat_vertices_map[triangulation.v2v[ffit->vertex(0)]].push_back(counter++); - d->flat_vertices_map[triangulation.v2v[ffit->vertex(1)]].push_back(counter++); - d->flat_vertices_map[triangulation.v2v[ffit->vertex(2)]].push_back(counter++); + + auto f = [&](auto ffit, auto &v2v) { + if (ffit.info().is_external) + return; + d->flat_vertices_map[v2v[ffit.vertex(0)]].push_back(counter++); + d->flat_vertices_map[v2v[ffit.vertex(1)]].push_back(counter++); + d->flat_vertices_map[v2v[ffit.vertex(2)]].push_back(counter++); + }; + + try { + FacetTriangulator::vertex_descriptor> triangulation(fd, normal, face_graph(), offset); + triangulation.per_face(f); + } + catch (...) { + FacetTriangulator::vertex_descriptor, CGAL::Exact_intersections_tag> triangulation(fd, normal, face_graph(), offset); + triangulation.per_face(f); } } } diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index fd154ad0514..a294581e15d 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -23,7 +23,7 @@ // @todo just use PMP::triangulate_face()...? // or at least mark_faces_in_domain() -template +template class FacetTriangulator { public: @@ -31,6 +31,8 @@ public: using Point = typename Kernel::Point_3; using Vector = typename Kernel::Vector_3; + using Index = Index_type; + using P_traits = CGAL::Projection_traits_3; using halfedge_descriptor = typename boost::graph_traits::halfedge_descriptor; @@ -46,23 +48,14 @@ public: using Fbb = CGAL::Triangulation_face_base_with_info_2; using Fb = CGAL::Constrained_triangulation_face_base_2; using TDS = CGAL::Triangulation_data_structure_2; - using Itag = CGAL::Exact_predicates_tag;//Exact_intersections_tag - using CDT = CGAL::Constrained_Delaunay_triangulation_2; + using CDT = CGAL::Constrained_Delaunay_triangulation_2; using Vertex_handle = typename CDT::Vertex_handle; using Face_handle = typename CDT::Face_handle; - struct PointAndId - { - Point point; - Index_type id; - PointAndId() = default; - PointAndId(const Point& point, const Index_type id) : point(point), id(id) { } - }; - public: CDT* cdt; - CGAL::Unique_hash_map v2v; + CGAL::Unique_hash_map v2v; public: // Constructor @@ -71,10 +64,10 @@ public: Mesh* poly, Vector offset = Vector(0,0,0)) { - std::vector idPoints; + std::vector > idPoints; for(halfedge_descriptor he_circ : halfedges_around_face(halfedge(fd, *poly), *poly)) - idPoints.emplace_back(get(CGAL::vertex_point, *poly, source(he_circ, *poly)) + offset, - source(he_circ, *poly)); + idPoints.emplace_back(std::make_pair(get(CGAL::vertex_point, *poly, source(he_circ, *poly)) + offset, + source(he_circ, *poly))); if(!triangulate(idPoints, normal)) std::cerr << "Facet not displayed" << std::endl; @@ -86,22 +79,22 @@ public: Mesh* poly, Vector offset = Vector(0,0,0)) { - std::vector idPoints; + std::vector > idPoints; for(halfedge_descriptor he_circ : halfedges_around_face(halfedge(fd, *poly), *poly)) - idPoints.emplace_back(get(CGAL::vertex_point, *poly, source(he_circ, *poly)) + offset, - source(he_circ, *poly)); + idPoints.emplace_back(std::make_pair(get(CGAL::vertex_point, *poly, source(he_circ, *poly)) + offset, + source(he_circ, *poly))); if(!triangulate_with_points(idPoints, more_points, normal)) std::cerr << "Facet not displayed" << std::endl; } - FacetTriangulator(std::vector& idPoints, + FacetTriangulator(std::vector >& idPoints, const Vector& normal) { if(!triangulate(idPoints, normal)) std::cerr << "Facet not displayed" << std::endl; } - FacetTriangulator(std::vector& idPoints, + FacetTriangulator(std::vector < std::pair >& idPoints, const std::vector& more_points, const Vector& normal) { @@ -115,8 +108,14 @@ public: delete cdt; } + template + void per_face(const Func& f) { + for (typename CDT::Finite_faces_iterator fit = cdt->finite_faces_begin(); fit != cdt->finite_faces_end(); ++fit) + f(*fit, v2v); + } + private: - bool triangulate(std::vector& idPoints, + bool triangulate(std::vector >& idPoints, const Vector& normal) { P_traits cdt_traits(normal); @@ -124,28 +123,24 @@ private: std::map, std::size_t> edge_map; std::vector skip(idPoints.size(), false); - bool has_ghost_edges = false; -/* for (std::size_t i = 0; i < idPoints.size(); i++) { int prev = (i - 1 + idPoints.size()) % idPoints.size(); - if (idPoints[i].point < idPoints[prev].point) { - auto it = edge_map.emplace(std::make_pair(idPoints[i].point, idPoints[prev].point), i); + if (idPoints[i].first < idPoints[prev].first) { + auto it = edge_map.emplace(std::make_pair(idPoints[i].first, idPoints[prev].first), i); if (!it.second) { skip[i] = true; skip[it.first->second] = true; - has_ghost_edges = true; } } else { - auto it = edge_map.emplace(std::make_pair(idPoints[prev].point, idPoints[i].point), i); + auto it = edge_map.emplace(std::make_pair(idPoints[prev].first, idPoints[i].first), i); if (!it.second) { skip[i] = true; skip[it.first->second] = true; - has_ghost_edges = true; } } - }*/ + } Vertex_handle previous, first, last_inserted; std::size_t previd, firstid, lastid; @@ -155,20 +150,20 @@ private: for(std::size_t i = 0;i& idPoint = idPoints[i]; + x += idPoint.first.x(); + y += idPoint.first.y(); + z += idPoint.first.z(); Vertex_handle vh; // Always insert the first point, then only insert if the distance with the previous is reasonable. - if(first == Vertex_handle() || idPoint.point != previous->point()) + if(first == Vertex_handle() || idPoint.first != previous->point()) { - vh = cdt->insert(idPoint.point); - v2v[vh] = idPoint.id; + vh = cdt->insert(idPoint.first); + v2v[vh] = idPoint.second; if (first == Vertex_handle()) { first = vh; - firstid = idPoint.id; + firstid = idPoint.second; } if(previous != nullptr && previous != vh) @@ -179,7 +174,7 @@ private: lastid = previd; } previous = vh; - previd = idPoint.id; + previd = idPoint.second; } } @@ -189,76 +184,66 @@ private: if(previous != first && !skip[0]) cdt->insert_constraint(previous, first); -/* - std::vector pts; - std::ofstream vout("test.polylines.txt"); - for (auto& e : cdt->constrained_edges()) { - // edge is a pair of Face_handle and index - auto v1 = e.first->vertex((e.second + 1) % 3); - auto v2 = e.first->vertex((e.second + 2) % 3); - pts.push_back(v1->point()); - pts.push_back(v2->point()); - vout << "2 " << v1->point() << " " << v2->point() << std::endl; - } - vout.close();*/ - // sets mark is_external for(Face_handle f2 : cdt->all_face_handles()) f2->info().is_external = false; - std::unordered_map in_domain_map; - boost::associative_property_map< std::unordered_map > in_domain(in_domain_map); + std::unordered_map in_domain_map; + boost::associative_property_map< std::unordered_map > in_domain(in_domain_map); CGAL::mark_domain_in_triangulation(*cdt, in_domain); - // check if the facet is external or internal -/* - std::queue face_queue; - face_queue.push(cdt->infinite_vertex()->face()); - while(! face_queue.empty()) - { - typename CDT::Face_handle fh = face_queue.front(); - face_queue.pop(); - if(fh->info().is_external) - continue; - - fh->info().is_external = true; - for(int i = 0; i <3; ++i) - { - if(!cdt->is_constrained(std::make_pair(fh, i))) - face_queue.push(fh->neighbor(i)); - } - }*/ - - for (const Face_handle& fh : cdt->all_face_handles()) { + for (const Face_handle& fh : cdt->all_face_handles()) fh->info().is_external = !get(in_domain, fh); - } return true; } - bool triangulate_with_points(std::vector& idPoints, + bool triangulate_with_points(std::vector >& idPoints, const std::vector& more_points, const Vector& normal) { P_traits cdt_traits(normal); cdt = new CDT(cdt_traits); + std::map, std::size_t> edge_map; + std::vector skip(idPoints.size(), false); + + for (std::size_t i = 0; i < idPoints.size(); i++) { + int prev = (i - 1 + idPoints.size()) % idPoints.size(); + if (idPoints[i].first < idPoints[prev].first) { + auto it = edge_map.emplace(std::make_pair(idPoints[i].first, idPoints[prev].first), i); + if (!it.second) { + skip[i] = true; + skip[it.first->second] = true; + } + } + else { + auto it = edge_map.emplace(std::make_pair(idPoints[prev].first, idPoints[i].first), i); + if (!it.second) { + skip[i] = true; + skip[it.first->second] = true; + } + } + } + // Iterate the points of the facet and decide if they must be inserted in the CDT Vertex_handle previous, first, last_inserted; - for(const PointAndId& idPoint : idPoints) + for (std::size_t i = 0; i < idPoints.size(); i++) { + const std::pair& idPoint = idPoints[i]; Vertex_handle vh; // Always insert the first point, then only insert if the distance with the previous is reasonable. - if(first == Vertex_handle() || idPoint.point != previous->point()) + if(first == Vertex_handle() || idPoint.first != previous->point()) { - vh = cdt->insert(idPoint.point); - v2v[vh] = idPoint.id; + vh = cdt->insert(idPoint.first); + v2v[vh] = idPoint.second; if(first == Vertex_handle()) first = vh; if(previous != nullptr && previous != vh) { - cdt->insert_constraint(previous, vh); + if (!skip[i]) + cdt->insert_constraint(previous, vh); last_inserted = previous; } previous = vh; @@ -268,7 +253,9 @@ private: if(last_inserted == Vertex_handle()) return false; + if (previous != first && !skip[0]) cdt->insert_constraint(previous, first); + for(const Point& point : more_points) cdt->insert(point); @@ -276,22 +263,12 @@ private: for(Face_handle f2 : cdt->all_face_handles()) f2->info().is_external = false; - // check if the facet is external or internal - std::queue face_queue; - face_queue.push(cdt->infinite_vertex()->face()); - while(!face_queue.empty()) - { - typename CDT::Face_handle fh = face_queue.front(); - face_queue.pop(); - if(fh->info().is_external) - continue; - fh->info().is_external = true; - for(int i = 0; i <3; ++i) - { - if(!cdt->is_constrained(std::make_pair(fh, i))) - face_queue.push(fh->neighbor(i)); - } - } + std::unordered_map in_domain_map; + boost::associative_property_map< std::unordered_map > in_domain(in_domain_map); + CGAL::mark_domain_in_triangulation(*cdt, in_domain); + + for (const Face_handle& fh : cdt->all_face_handles()) + fh->info().is_external = !get(in_domain, fh); return true; } From afc5382c8c80f4eb7246ab1a99220d2b30f6ac52 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 1 Dec 2023 08:31:50 +0100 Subject: [PATCH 03/95] removed left-overs from debugging bugfixes --- Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/triangulate_primitive.h | 4 ++-- Stream_support/include/CGAL/IO/PLY/PLY_reader.h | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index e7d371e0891..fe4120c5919 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -132,7 +132,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { std::vector fcolors; std::vector vcolors; - if (!(CGAL::IO::read_PLY (in, points, polygons, fcolors, vcolors, true))) + if (!(CGAL::IO::read_PLY (in, points, polygons, fcolors, vcolors))) { QApplication::restoreOverrideCursor(); ok = false; diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index a294581e15d..4fd4afa6a00 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -121,7 +121,7 @@ private: P_traits cdt_traits(normal); cdt = new CDT(cdt_traits); - std::map, std::size_t> edge_map; + std::map, std::size_t> edge_map; std::vector skip(idPoints.size(), false); for (std::size_t i = 0; i < idPoints.size(); i++) { @@ -205,7 +205,7 @@ private: P_traits cdt_traits(normal); cdt = new CDT(cdt_traits); - std::map, std::size_t> edge_map; + std::map, std::size_t> edge_map; std::vector skip(idPoints.size(), false); for (std::size_t i = 0; i < idPoints.size(); i++) { diff --git a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h index c1a0ab4e580..ee8b18ef59c 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h @@ -726,9 +726,6 @@ bool read_PLY_faces(std::istream& in, for(std::size_t j = 0; j < element.number_of_items(); ++ j) { - if (j == 228) - std::cout << std::endl; - for(std::size_t k = 0; k < element.number_of_properties(); ++ k) { PLY_read_number* property = element.property(k); @@ -761,9 +758,6 @@ bool read_PLY_faces(std::istream& in, PLY_property >(vertex_indices_tag))); } - if (get<0>(new_face).size() == 0) - std::cout << "empty face encountered" << std::endl; - polygons.emplace_back(); ::CGAL::internal::resize(polygons.back(), get<0>(new_face).size()); for(std::size_t i = 0; i < get<0>(new_face).size(); ++ i) From 410ead5f56793752b590aefd8ccb06718cc63603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Dec 2023 17:31:02 +0100 Subject: [PATCH 04/95] also look for Basic viewer in targets --- Installation/cmake/modules/CGAL_add_test.cmake | 5 ++--- .../modules/CGAL_enable_end_of_configuration_hook.cmake | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index a163bca7891..904e35e25f1 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -124,9 +124,8 @@ function(cgal_add_compilation_test exe_name) if(TARGET CGAL_Qt6_moc_and_resources) # if CGAL_Qt6 was searched, and is header-only get_property(linked_libraries TARGET "${exe_name}" PROPERTY LINK_LIBRARIES) # message(STATUS "${exe_name} depends on ${linked_libraries}") - string(FIND "${linked_libraries}" "CGAL::CGAL_Qt6" link_with_CGAL_Qt6) - if(link_with_CGAL_Qt6 STRGREATER "-1" AND - NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources") + if( ("CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Basic_viewer" IN_LIST linked_libraries) + AND NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources") # This custom target is useless. It is used only as a flag to # detect that the test has already been created. add_custom_target("compilation_of__CGAL_Qt6_moc_and_resources") diff --git a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake index 9fd8615c2a9..d69c42fc5dd 100644 --- a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake +++ b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake @@ -1,5 +1,5 @@ # This module install a hook (with `variable_watch()`) on CMAKE_CURRENT_LIST_DIR -# +# # That uses the non-documented fact that CMAKE_CURRENT_LIST_DIR is cleared # by CMake at the end of the configuration process. So, if the value of # that variable gets empty, that means that CMake has reached the end of @@ -110,7 +110,7 @@ function(CGAL_hook_fix_ctest_depending_on_Qt6) continue() endif() get_property(_target_links TARGET ${_target} PROPERTY LINK_LIBRARIES) - if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links) + if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Basic_viewer" IN_LIST _target_links) set_property(TEST "compilation of ${_target}" APPEND PROPERTY FIXTURES_REQUIRED CGAL_Qt6_moc_and_resources_Fixture) endif() endforeach() From 31d66c332fe3971abef98d1225c3c21d00140bb2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 14:22:01 +0100 Subject: [PATCH 05/95] Fix display of Qt version --- Installation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 744e4fed4ab..1e912131c12 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1253,6 +1253,6 @@ if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" ) if(Qt6_FOUND) - message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION_STRING}'") + message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION}'") endif()#Qt6_FOUND endif()#RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE From ad8ad2d190c6a8ad21368abac5de105946d65c0a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 14:38:43 +0100 Subject: [PATCH 06/95] display Qt6 version in the test results page --- Maintenance/test_handling/create_testresult_page | 2 +- Maintenance/test_handling/to_zipped_format | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index 3747a4a8313..7cc6ad464c0 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -474,7 +474,7 @@ sub print_platform_descriptions() BOOST MPFR GMP -QT5 +QT LEDA CXXFLAGS LDFLAGS diff --git a/Maintenance/test_handling/to_zipped_format b/Maintenance/test_handling/to_zipped_format index d8c7c1cd433..fdf62712b02 100755 --- a/Maintenance/test_handling/to_zipped_format +++ b/Maintenance/test_handling/to_zipped_format @@ -51,7 +51,7 @@ sub reformat_results($) $_ = $line; open (PLATFORM_INFO,">${platform}.info") or return; open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return; - my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$QT4,$QT5,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","no"); + my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","no"); my ($LDFLAGS,$CXXFLAGS) = ("", ""); while (! /^------/) { if(/^\s*$/) { @@ -97,10 +97,13 @@ sub reformat_results($) $QT="$1"; } if (/QT4_VERSION = '([^']+)'/) { - $QT4="$1"; + $QT="$1"; } if (/Qt5_VERSION = '([^']+)'/) { - $QT5="$1"; + $QT="$1"; + } + if (/Qt6_VERSION = '([^']+)'/) { + $QT="$1"; } if (/BOOST_VERSION = '([^']+)'/) { $BOOST="$1"; @@ -147,7 +150,7 @@ $CMAKE $BOOST $MPFR $GMP -$QT5 +$QT $LEDA_VERSION $CXXFLAGS $LDFLAGS From 811f78c6a1d9d6c9cb0585062de0f07b45a558e7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Dec 2023 15:48:09 +0100 Subject: [PATCH 07/95] fix the bug about CGAL_Qt6_moc_and_resources_Fixture --- .../CGAL_CreateSingleSourceCGALProgram.cmake | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index 2a9fdc4bd87..c51173216b3 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -57,12 +57,6 @@ function(create_single_source_cgal_program firstfile ) set(NO_TESTING TRUE) endif() - if(NOT NO_TESTING) - cgal_add_test(${exe_name}) - else() - cgal_add_test(${exe_name} NO_EXECUTION) - endif() - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} ) target_link_libraries(${exe_name} PRIVATE CGAL::CGAL CGAL::Data) @@ -75,13 +69,10 @@ function(create_single_source_cgal_program firstfile ) target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES}) endif() - if(POLICY CMP0064) - # CMake 3.4 or later - if(NOT NO_TESTING) - cgal_add_test(${exe_name}) - else() - cgal_add_test(${exe_name} NO_EXECUTION) - endif() + if(NOT NO_TESTING) + cgal_add_test(${exe_name}) + else() + cgal_add_test(${exe_name} NO_EXECUTION) endif() else() From 09902686dc5b9c8beeb2c838334b8dc68eeeb10a Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:00:46 +0300 Subject: [PATCH 08/95] minor user man addition --- .../doc/Polygon_mesh_processing/Polygon_mesh_processing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 26d5d9c6450..d8532986e8d 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -998,7 +998,7 @@ solver. The interpolated curvature measures are then computed for each vertex \f$ v \f$ as the sum of the curvature measures of the faces in a ball around \f$ v \f$ weighted by the inclusion ratio of the -triangle in the ball. If the ball radius is not specified, the sum is instead computed over the incident faces +triangle in the ball. If the ball radius is not specified (or negative), the sum is instead computed over the incident faces of \f$ v \f$. To get the final curvature value for a vertex \f$ v \f$, the respective interpolated curvature measure From 5e0a4cabe883c026b7639df68ab8495dc4811947 Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:04:49 +0300 Subject: [PATCH 09/95] minor typo in user man --- .../doc/Polygon_mesh_processing/Polygon_mesh_processing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index d8532986e8d..578fda8cec7 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -974,7 +974,7 @@ introduce a new way to compute curvatures on polygonal meshes. The main idea in based on decoupling the normal information from the position information, which is useful for dealing with digital surfaces, or meshes with noise on vertex positions. \cgalCite{cgal:lrtc-iccmps-20} introduces some extensions to this framework, as it uses linear interpolation on the corrected normal vector field -to derive new closed form equations for the corrected curvature measures. These interpolated +to derive new closed-form equations for the corrected curvature measures. These interpolated curvature measures are the first step for computing the curvatures. For a triangle \f$ \tau_{ijk} \f$, with vertices \a i, \a j, \a k: From 0e60f7cb77b6d04ae52d1d2d88ed9c2530ff0dce Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:16:35 +0300 Subject: [PATCH 10/95] moving average_edge_length to measure --- .../interpolated_corrected_curvatures.h | 18 ++---------------- .../CGAL/Polygon_mesh_processing/measure.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/interpolated_corrected_curvatures.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/interpolated_corrected_curvatures.h index a8d45d8b867..13cad81b410 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/interpolated_corrected_curvatures.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/interpolated_corrected_curvatures.h @@ -76,20 +76,6 @@ struct Principal_curvatures_and_directions { namespace internal { -template -typename GT::FT average_edge_length(const PolygonMesh& pmesh) { - const std::size_t n = edges(pmesh).size(); - if (n == 0) - return 0; - - typename GT::FT avg_edge_length = 0; - for (auto e : edges(pmesh)) - avg_edge_length += edge_length(e, pmesh); - - avg_edge_length /= static_cast(n); - return avg_edge_length; -} - template struct Vertex_measures { typename GT::FT area_measure = 0; @@ -650,7 +636,7 @@ void interpolated_corrected_curvatures_one_vertex( typename GT::FT radius = choose_parameter(get_parameter(np, internal_np::ball_radius), -1); // calculate avg_edge_length as it is used in case radius is 0, and in the principal curvature computation later - typename GT::FT avg_edge_length = average_edge_length(pmesh); + typename GT::FT avg_edge_length = average_edge_length(pmesh); // if the radius is 0, we use a small epsilon to expand the ball (scaled with the average edge length) if (is_zero(radius)) @@ -799,7 +785,7 @@ private: // if no radius is given, we pass -1 which will make the expansion be only on the incident faces instead of a ball const FT radius = choose_parameter(get_parameter(np, internal_np::ball_radius), -1); - avg_edge_length = average_edge_length(pmesh); + avg_edge_length = average_edge_length(pmesh); set_ball_radius(radius); // check which curvature maps are provided by the user (determines which curvatures are computed) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h index 8f1c60347ee..520ebbec9be 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -217,6 +217,25 @@ squared_edge_length(typename boost::graph_traits::edge_descriptor e return squared_edge_length(halfedge(e, pmesh), pmesh, np); } +template +typename GetGeomTraits::type::FT +average_edge_length(const PolygonMesh& pmesh, + const NamedParameters& np = parameters::default_values()) +{ + typedef typename GetGeomTraits::type GT; + + const std::size_t n = edges(pmesh).size(); + CGAL_assertion(n > 0); + + typename GT::FT avg_edge_length = 0; + for (auto e : edges(pmesh)) + avg_edge_length += edge_length(e, pmesh, np); + + avg_edge_length /= static_cast(n); + return avg_edge_length; +} + /** * \ingroup PMP_measure_grp * From 5544ff48933238e57020bf3b87931d08b50fe1ac Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 12 Dec 2023 01:50:26 +0200 Subject: [PATCH 11/95] Eliminated the error-prone c-style casting of the arrangement object that occurs when using observers. --- .../Arrangement_on_surface_2.txt | 24 +++++++------- .../CGAL/Arr_face_index_map.h | 4 +-- .../CGAL/Arr_triangulation_point_location.h | 3 +- .../CGAL/Arr_vertex_index_map.h | 9 +----- .../face_extension.cpp | 8 ++--- .../Arrangement_on_surface_2/observer.cpp | 5 ++- .../include/CGAL/Arr_face_index_map.h | 12 +++---- .../Arr_lm_generator_base.h | 7 ++--- .../Arr_lm_vertices_generator.h | 9 +++--- .../CGAL/Arr_trapezoid_ric_point_location.h | 9 +++--- .../CGAL/Arr_triangulation_point_location.h | 5 ++- .../include/CGAL/Arr_vertex_index_map.h | 14 ++++----- .../include/CGAL/Arrangement_2.h | 31 ------------------- .../Arr_on_surface_with_history_2_impl.h | 23 -------------- .../include/CGAL/Arrangement_on_surface_2.h | 3 +- .../Arrangement_on_surface_with_history_2.h | 22 ------------- .../include/CGAL/Arrangement_with_history_2.h | 30 +----------------- .../test_observer.cpp | 8 ++--- .../Envelope_divide_and_conquer_3.h | 4 +-- .../Envelope_3/Envelope_element_visitor_3.h | 2 +- .../CGAL/Polygon_vertical_decomposition_2.h | 4 +-- .../CGAL/Triangular_expansion_visibility_2.h | 5 ++- 22 files changed, 58 insertions(+), 183 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 7c143578c89..4d95b4e71d3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -5706,17 +5706,19 @@ changes when they occur. In our case observers can be attached to an arrangement object. An attached observer receives notifications about the changes this arrangement undergoes. -An observer object, the type of which is an instance of the -`Arr_observer` class template, stores a pointer to an -arrangement object. When the `Arr_observer` class -template is instantiated, the `Arrangement` parameter must be -substituted with the type of the arrangement object. The observer -receives notifications just before a structural change occurs -in the arrangement and immediately after such a change takes -place. `Arr_observer` serves as a base class for other -observer classes and defines a set of virtual notification -functions, with default empty implementations. The set of functions -can be divided into three categories, as follows: +An observer object that observes changes that an arrangement object of +type `Arrangement` undergoes must be of a type derived from +`Arrangement::Observer`. The observer object stores a pointer to the +observed arrangement object. The observer receives notifications +just before a structural change occurs in the arrangement and +immediately after such a change takes place. +`Arrangement::Observer` is an alias to +`Arr_observer>`, where +`CGAL::Arrangement_on_surface_2<>` is the type of the arrangement +object or its base type. It serves as a base type for other observer +classes and defines a set of virtual notification functions, with +default empty implementations. The set of functions can be divided +into three categories, as follows:
    diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h index bcb0d5c378f..4c48eb10207 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h @@ -21,12 +21,11 @@ to dynamically maintain the mapping of face handles to indices. \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} -\sa `Arr_observer` \sa `Arr_vertex_index_map` */ template< typename Arrangement > -class Arr_face_index_map: public Arr_observer { +class Arr_face_index_map: public Arrangement::Observer { public: /// \name Types @@ -74,4 +73,3 @@ Arr_face_index_map(Arrangement_2& arr); }; /* end Arr_accessor */ } /* end namespace CGAL */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h index 5106f32ec36..2bd83d5a125 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h @@ -23,7 +23,6 @@ namespace CGAL { */ template -class Arr_triangulation_point_location : public Arr_observer -{} +class Arr_triangulation_point_location : public Arrangement_::Observer {} } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h index 1c915a6b23c..af17eafb8a7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h @@ -21,12 +21,11 @@ to dynamically maintain the mapping of vertex handles to indices. \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} -\sa `Arr_observer` \sa `Arr_face_index_map` */ template< typename Arrangement > -class Arr_vertex_index_map: public Arr_observer { +class Arr_vertex_index_map: public Arrangement::Observer { public: /// \name Types @@ -74,9 +73,3 @@ Arr_vertex_index_map(Arrangement_2& arr); }; /* end Arr_accessor */ } /* end namespace CGAL */ - - - - - - diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp index 8befee7dafc..21494ebb891 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp @@ -3,7 +3,6 @@ #include #include -#include #include "arr_exact_construction_segments.h" @@ -12,15 +11,16 @@ using Ex_arrangement = CGAL::Arrangement_2; // An arrangement observer, used to receive notifications of face splits and // to update the indices of the newly created faces. -class Face_index_observer : public CGAL::Arr_observer { +class Face_index_observer : public Ex_arrangement::Observer { private: size_t n_faces; // the current number of faces public: Face_index_observer(Ex_arrangement& arr) : - CGAL::Arr_observer(arr), n_faces(0) + Ex_arrangement::Observer(arr), + n_faces(0) { - CGAL_precondition (arr.is_empty()); + CGAL_precondition(arr.is_empty()); arr.unbounded_face()->set_data (0); } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp index d4261d64dd2..547fdab09c0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp @@ -2,15 +2,14 @@ // Using a simple arrangement observer. #include -#include #include "arr_exact_construction_segments.h" #include "arr_print.h" // An observer that receives notifications of face splits and face mergers. -class My_observer : public CGAL::Arr_observer { +class My_observer : public Arrangement::Observer { public: - My_observer(Arrangement& arr) : CGAL::Arr_observer(arr) {} + My_observer(Arrangement& arr) : Arrangement::Observer(arr) {} virtual void before_split_face(Face_handle, Halfedge_handle e) { std::cout << "-> The insertion of : [ " << e->curve() diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h index 1e03af5e1c6..3fb3915b65a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h @@ -21,7 +21,6 @@ * Definition of the Arr_face_index_map class. */ -#include #include #include @@ -35,8 +34,7 @@ namespace CGAL { * of faces in the arrangement. */ template -class Arr_face_index_map : public Arr_observer -{ +class Arr_face_index_map : public Arrangement_::Observer { public: typedef Arrangement_ Arrangement_2; @@ -51,7 +49,7 @@ public: private: typedef Arr_face_index_map Self; - typedef Arr_observer Base; + typedef typename Arrangement_2::Observer Base; typedef Unique_hash_map Index_map; @@ -73,14 +71,14 @@ public: /*! Constructor with an associated arrangement. */ Arr_face_index_map (const Arrangement_2& arr) : - Base (const_cast (arr)) + Base(const_cast(arr)) { _init(); } /*! Copy constructor. */ Arr_face_index_map (const Self& other) : - Base (const_cast (*(other.arrangement()))) + Base(const_cast(*(other.arrangement()))) { _init(); } @@ -92,7 +90,7 @@ public: return (*this); this->detach(); - this->attach (const_cast (*(other.arrangement()))); + this->attach(const_cast(*(other.arrangement()))); return (*this); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h index daf08604ed2..07cf7520a13 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h @@ -20,7 +20,6 @@ * Definition of the Arr_landmarks_generator_base template. */ #include -#include #include #include #include @@ -43,8 +42,8 @@ namespace CGAL { */ template > -class Arr_landmarks_generator_base : public Arr_observer { + Arr_landmarks_nearest_neighbor > +class Arr_landmarks_generator_base : public Arrangement_::Observer { public: typedef Arrangement_ Arrangement_2; typedef Nearest_neighbor_ Nearest_neighbor; @@ -110,7 +109,7 @@ public: * \param arr (in) The arrangement. */ Arr_landmarks_generator_base(const Arrangement_2& arr) : - Arr_observer (const_cast(arr)), + Arrangement_2::Observer(const_cast(arr)), m_traits(static_cast(arr.geometry_traits())), m_ignore_notifications(false), m_ignore_remove_edge(false), diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h index 57478ec7936..01fd5aba052 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h @@ -98,14 +98,13 @@ public: virtual void build_landmark_set() { // Go over the arrangement, and insert all its vertices as landmarks. - NN_Point_list nnp_list; - const Arrangement_2* arr = this->arrangement(); - Vertex_const_iterator vit; + NN_Point_list nnp_list; + const auto* arr = this->arrangement(); num_landmarks = 0; - for (vit = arr->vertices_begin(); vit != arr->vertices_end(); ++vit) { + for (auto vit = arr->vertices_begin(); vit != arr->vertices_end(); ++vit) { Vertex_const_handle vh = vit; nnp_list.push_back(NN_Point_2(vh->point(), this->pl_make_result(vh))); - num_landmarks++; + ++num_landmarks; } // Update the search structure. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index 7a4042e9601..d04136967ba 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -26,7 +26,6 @@ #include #include #include -#include namespace CGAL { @@ -36,7 +35,7 @@ namespace CGAL { * The Arrangement parameter corresponds to an arrangement instantiation. */ template -class Arr_trapezoid_ric_point_location : public Arr_observer { +class Arr_trapezoid_ric_point_location : public Arrangement_::Observer { public: //type of arrangement on surface typedef Arrangement_ Arrangement_on_surface_2; @@ -148,8 +147,8 @@ public: bool with_guarantees = true, double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : - Arr_observer - (const_cast(arr)), + Arrangement_on_surface_2:: + Observer(const_cast(arr)), m_with_guarantees(with_guarantees) { m_traits = static_cast (arr.geometry_traits()); @@ -352,7 +351,7 @@ protected: std::vector he_container; Edge_const_iterator eit; Halfedge_const_handle he_cst; - Arrangement_on_surface_2 *arr = this->arrangement(); + auto* arr = this->arrangement(); //collect the arrangement halfedges for (eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index e3f5c3565ff..98e0f1742fd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -39,8 +39,7 @@ namespace CGAL { * triangulation algorithm. */ template -class Arr_triangulation_point_location : public Arr_observer -{ +class Arr_triangulation_point_location : public Arrangement_::Observer { public: typedef Arrangement_ Arrangement_2; @@ -129,7 +128,7 @@ public: * \param arr (in) The arrangement. */ Arr_triangulation_point_location(const Arrangement_2& arr) : - Arr_observer(const_cast(arr)), + Arrangement_2::Observer(const_cast(arr)), m_traits(static_cast(arr.geometry_traits())), m_ignore_notifications(false), m_ignore_remove_edge(false) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h index ac6902cc9e2..92f412d2495 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h @@ -22,7 +22,6 @@ /*! \file * Definition of the Arr_vertex_index_map class. */ -#include #include #include @@ -36,8 +35,7 @@ namespace CGAL { * of vertices in the arrangement. */ template -class Arr_vertex_index_map : public Arr_observer -{ +class Arr_vertex_index_map : public Arrangement_::Observer { public: typedef Arrangement_ Arrangement_2; @@ -52,7 +50,7 @@ public: private: typedef Arr_vertex_index_map Self; - typedef Arr_observer Base; + typedef typename Arrangement_2::Observer Base; typedef Unique_hash_map Index_map; @@ -67,21 +65,21 @@ public: /*! Default constructor. */ Arr_vertex_index_map () : - Base (), + Base(), n_vertices (0), rev_map (MIN_REV_MAP_SIZE) {} /*! Constructor with an associated arrangement. */ Arr_vertex_index_map (const Arrangement_2& arr) : - Base (const_cast (arr)) + Base(const_cast(arr)) { _init(); } /*! Copy constructor. */ Arr_vertex_index_map (const Self& other) : - Base (const_cast (*(other.arrangement()))) + Base(const_cast (*(other.arrangement()))) { _init(); } @@ -93,7 +91,7 @@ public: return (*this); this->detach(); - this->attach (const_cast (*(other.arrangement()))); + this->attach (const_cast (*(other.arrangement()))); return (*this); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h index 5ff66d78b30..1861d50cbae 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2.h @@ -115,12 +115,9 @@ public: typedef typename Base::Inner_ccb_const_iterator Hole_const_iterator; private: - - friend class Arr_observer; friend class Arr_accessor; public: - /// \name Constructors. //@{ @@ -215,34 +212,6 @@ public: } //@} - -protected: - - /// \name Managing and notifying the arrangement observers. - //@{ - typedef Arr_observer Observer; - - /*! - * Register a new observer (so it starts receiving notifications). - * \param p_obs A pointer to the observer object. - */ - void _register_observer (Observer *p_obs) - { - Base::_register_observer ((typename Base::Observer*)p_obs); - return; - } - - /*! - * Unregister a new observer (so it stops receiving notifications). - * \param p_obs A pointer to the observer object. - * \return Whether the observer was successfully unregistered. - */ - bool _unregister_observer (Observer *p_obs) - { - return (Base::_unregister_observer ((typename Base::Observer*)p_obs)); - } - //@} - }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h index b60f198906f..8c63a3344c1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_on_surface_with_history_2_impl.h @@ -273,29 +273,6 @@ bool Arrangement_on_surface_with_history_2::are_mergeable e2->curve())); } -//----------------------------------------------------------------------------- -// Register a new observer (so it starts receiving notifications). -// -template -void Arrangement_on_surface_with_history_2:: -_register_observer(Arr_observer *p_obs) -{ - Base_arr_2::_register_observer - (reinterpret_cast*>(p_obs)); - return; -} - -//----------------------------------------------------------------------------- -// Unregister an observer (so it stops receiving notifications). -// -template -bool Arrangement_on_surface_with_history_2:: -_unregister_observer(Arr_observer *p_obs) -{ - return (Base_arr_2::_unregister_observer - (reinterpret_cast*>(p_obs))); -} - } //namespace CGAL #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index ae87c8ddb28..f99be868ac0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -109,6 +109,8 @@ public: typedef typename Topology_traits::Dcel Dcel; typedef typename Dcel::Size Size; + typedef Arr_observer Observer; + protected: friend class Arr_observer; friend class Arr_accessor; @@ -892,7 +894,6 @@ protected: typedef CGAL_ALLOCATOR(Point_2) Points_alloc; typedef CGAL_ALLOCATOR(X_monotone_curve_2) Curves_alloc; - typedef Arr_observer Observer; typedef std::list Observers_container; typedef typename Observers_container::iterator Observers_iterator; diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h index af560449961..ad1413f9f1c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -75,10 +74,7 @@ public: typedef typename Geometry_traits_2::Curve_2 Curve_2; typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - typedef Arr_observer Observer; - protected: - friend class Arr_observer; friend class Arr_accessor; friend class Arr_with_history_accessor; @@ -582,24 +578,6 @@ public: //@} protected: - - /// \name Managing and notifying the arrangement observers. - //@{ - - /*! - * Register a new observer (so it starts receiving notifications). - * \param p_obs A pointer to the observer object. - */ - void _register_observer (Observer *p_obs); - - /*! - * Unregister an observer (so it stops receiving notifications). - * \param p_obs A pointer to the observer object. - * \return Whether the observer was successfully unregistered. - */ - bool _unregister_observer (Observer *p_obs); - //@} - /// \name Curve insertion and deletion. //@{ diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h index 134c2f0c20e..24853e94b9c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_with_history_2.h @@ -119,7 +119,6 @@ public: private: typedef Arrangement_with_history_2 Self; - friend class Arr_observer; friend class Arr_accessor; public: @@ -233,35 +232,8 @@ public: return (Face_const_handle (p_oc->face())); } + //@} - -protected: - - /// \name Managing and notifying the arrangement observers. - //@{ - typedef Arr_observer Observer; - - /*! - * Register a new observer (so it starts receiving notifications). - * \param p_obs A pointer to the observer object. - */ - void _register_observer (Observer *p_obs) - { - Base::_register_observer ((typename Base::Observer*)p_obs); - return; - } - - /*! - * Unregister a new observer (so it stops receiving notifications). - * \param p_obs A pointer to the observer object. - * \return Whether the observer was successfully unregistered. - */ - bool _unregister_observer (Observer *p_obs) - { - return (Base::_unregister_observer ((typename Base::Observer*)p_obs)); - } - //@} - }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp index 6f12f6e8c73..bc03ddc0957 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -57,14 +56,11 @@ void compare_results(std::string str) // An arrangement observer, used to receive notifications of face splits and // face mergers. -class Test_observer : public CGAL::Arr_observer -{ +class Test_observer : public Arrangement_2::Observer { public: - Test_observer (Arrangement_2& arr) : - CGAL::Arr_observer (arr) - {} + Test_observer(Arrangement_2& arr) : Arrangement_2::Observer(arr) {} /// \name Notification functions on global arrangement operations. //@{ diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h index 9b3136be2b4..757ef127412 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -134,7 +133,8 @@ protected: typedef typename Minimization_diagram_2::Inner_ccb_iterator Inner_ccb_iterator; - typedef Arr_observer Md_observer; + typedef typename Minimization_diagram_2::Observer + Md_observer; typedef typename Minimization_diagram_2::Dcel::Dcel_data_iterator Envelope_data_iterator; diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index e5184ba9a2a..d5e118bf8d7 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -96,7 +96,7 @@ protected: typedef typename Minimization_diagram_2::Dcel::Dcel_data_iterator Envelope_data_iterator; - typedef Arr_observer Md_observer; + typedef typename Minimization_diagram_2::Observer Md_observer; typedef Arr_accessor Md_accessor; typedef typename Topology_traits::Default_point_location_strategy diff --git a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h index 5db68c8abaa..d040ccb7158 100644 --- a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h +++ b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h @@ -77,9 +77,9 @@ private: // An arrangement observer, used to receive notifications of face splits and // face mergers. - class My_observer : public CGAL::Arr_observer { + class My_observer : public Arrangement_2::Observer { public: - My_observer(Arrangement_2& arr) : Arr_observer(arr) {} + My_observer(Arrangement_2& arr) : Arrangement_2::Observer(arr) {} virtual void after_split_face(Face_handle f, Face_handle new_f, bool /* is_hole */) diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index 408bf95c847..72465c5c97f 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -86,10 +85,10 @@ private: }; // Observer to track any changes of the attached arrangement. - class Observer : public Arr_observer + class Observer : public Arrangement_2::Observer { - typedef Arr_observer Base; + typedef typename Arrangement_2::Observer Base; typedef Observer Self; From 92e2a7da2d45467218eb37f9df96e7923f36d2a0 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 12 Dec 2023 02:54:19 +0200 Subject: [PATCH 12/95] Eliminated the error-prone c-style casting of the arrangement that occurs when using observers; renamed Arr_observer => Aos_observer, and introduced Arr_observer for backward compatibility. --- .../Arrangement_on_surface_2.txt | 43 +- .../CGAL/Aos_observer.h | 409 +++++++++++++ .../CGAL/Arr_observer.h | 432 +------------ .../PackageDescription.txt | 3 +- .../face_extension.cpp | 5 +- .../Arrangement_on_surface_2/observer.cpp | 5 +- .../sgm_point_location.cpp | 16 - .../include/CGAL/Aos_observer.h | 573 ++++++++++++++++++ .../include/CGAL/Arr_observer.h | 556 +---------------- .../CGAL/Arr_triangulation_point_location.h | 1 - .../include/CGAL/Arrangement_on_surface_2.h | 6 +- .../Arrangement_on_surface_with_history_2.h | 2 +- .../Envelope_3/Envelope_element_visitor_3.h | 1 - .../CGAL/Triangular_expansion_visibility_2.h | 2 +- 14 files changed, 1054 insertions(+), 1000 deletions(-) create mode 100644 Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h create mode 100644 Arrangement_on_surface_2/include/CGAL/Aos_observer.h diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 4d95b4e71d3..622492d43d8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -5703,22 +5703,25 @@ objects, so that when one object changes state, all its dependents are notified and updated automatically. The observed object does not know anything about the observers. It merely "publishes" information about changes when they occur. In our case observers can be attached to an -arrangement object. An attached observer receives notifications about -the changes this arrangement undergoes. +arrangement object. -An observer object that observes changes that an arrangement object of -type `Arrangement` undergoes must be of a type derived from -`Arrangement::Observer`. The observer object stores a pointer to the -observed arrangement object. The observer receives notifications -just before a structural change occurs in the arrangement and -immediately after such a change takes place. -`Arrangement::Observer` is an alias to -`Arr_observer>`, where -`CGAL::Arrangement_on_surface_2<>` is the type of the arrangement -object or its base type. It serves as a base type for other observer -classes and defines a set of virtual notification functions, with -default empty implementations. The set of functions can be divided -into three categories, as follows: +An observer object that observes changes in an arrangement object +stores a pointer to the attached arrangement object. It receives +notifications about the changes this arrangement undergoes. The +observer receives notifications just before a structural +change occurs in the arrangement and immediately after such a +change takes place. An observer object that observes changes in an +arrangement object of type `Arrangement` must be of a type derived +from `Arrangement::Observer`, which is an alias to +`Aos_observer`, where +`Arrangement_on_surface_2` is the type of the arrangement object or +its base type. An instance of `Aos_observer<>` serves as a base type +for other observer classes and defines a set of virtual notification +functions, with default empty implementations. You can also use the +template alias `Arr_observer`, where `Arrangement_2` is +the type of the arrangement object in case it is derived from +`Arrangement_on_surface_2`. The set of functions can be divided into +three categories, as follows:
      @@ -5784,10 +5787,10 @@ the call to `after_global_change()`.
    See the Reference Manual for a detailed specification of the -`Arr_observer` class template and the prototypes of all notification +`Aos_observer` class template and the prototypes of all notification functions. -Each arrangement object stores a list of pointers to `Arr_observer` +Each arrangement object stores a list of pointers to `Aos_observer` objects. This list may be empty, in which case the arrangement does not have to notify any external class on the structural changes it undergoes. If, however, there are observers associated with the @@ -5801,7 +5804,7 @@ invoked for each observer. Concrete arrangement-observer classes should inherit from -`Arr_observer`. When an observer is constructed, it is attached to a +`Aos_observer`. When an observer is constructed, it is attached to a valid arrangement supplied to the observed constructor, or alternatively the observer can be attached to the arrangement at a later time. When this happens, the observer object inserts itself @@ -5811,8 +5814,8 @@ thereafter. Subsequently, the observer object unregisters itself by removing itself from this list just before it is destroyed. Most concrete observer-classes do not need to use the full set of notifications. Thus, the bodies of all notification methods defined in -the base class `Arr_observer` are empty. A concrete observer that -inherits from `Arr_observer` needs to override only the relevant +the base class `Aos_observer` are empty. A concrete observer that +inherits from `Aos_observer` needs to override only the relevant notification methods. The remaining methods are invoked when corresponding changes occur, but they do nothing. diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h new file mode 100644 index 00000000000..8ae211dbe5a --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h @@ -0,0 +1,409 @@ +namespace CGAL { + +/*! \ingroup PkgArrangementOnSurface2Ref + * + * \anchor arr_refarr_obs + * + * `Aos_observer` serves as an abstract base class for all observer classes that + * are attached to an arrangement instance of type `Arrangement` and receive + * notifications from the arrangement. This base class handles the attachment + * of the observer to a given arrangement instance or to the detachment of the + * observer from this arrangement instance. It also gives a default empty + * implementation to all notification functions that are invoked by the + * arrangement to notify the observer on local or global changes it undergoes. + * The notification functions are all virtual functions, so they can be + * overridden by the concrete observer classes that inherit from `Aos_observer`. + * + * In order to implement a concrete arrangement observer-class, one simply needs + * to derive from `Aos_observer` and override the relevant notification + * functions. For example, if only face-split events are of interest, it is + * sufficient to override just `before_split_face()` (or just + * `after_split_face()`). + */ +template +class Aos_observer { +public: + + /// \name Types + /// @{ + + /*! the type of the associated arrangement. */ + typedef unspecified_type Arrangement_2; + + /*! the point type. */ + typedef typename Arrangement_2::Point_2 Point_2; + + /*! the \f$ x\f$-monotone curve type. */ + typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + + /*! */ + typedef typename Arrangement_2::Vertex_handle Vertex_handle; + + /*! */ + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + + /*! */ + typedef typename Arrangement_2::Face_handle Face_handle; + + /*! represents a connected component of the boundary (CCB), either an outer + * boundary or an inner boundary (the latter is also referred to as a hole). + */ + typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; + + /// @} + + /// \name Creation + /// @{ + + /*! constructs an observer that is unattached to any arrangement instance. */ + Aos_observer(); + + /*! constructs an observer and attaches it to the given arrangement `arr`. */ + Aos_observer(Arrangement_2& arr); + + /// @} + + /// \name Modifiers + /// @{ + + /*! attaches the observer to the given arrangement `arr`. */ + void attach(Arrangement_2& arr); + + /*! detaches the observer from its arrangement. */ + void detach(); + + /// @} + + /// \name Notifications on Global Arrangement Operations + /// @{ + + /*! issued just before the attached arrangement is assigned with the contents of + * another arrangement `arr`. + */ + virtual void before_assign(const Arrangement_2& arr); + + /*! issued immediately after the attached arrangement has been assigned with the + * contents of another arrangement. + */ + virtual void after_assign(); + + /*! issued just before the attached arrangement is cleared. */ + virtual void before_clear(); + + /*! issued immediately after the attached arrangement has been cleared, so it + * now consists only of a the unbounded face `uf`. + */ + virtual void after_clear(Face_handle uf); + + /*! issued just before a global function starts to modify the attached + * arrangement. It is guaranteed that no queries (especially no point-location + * queries) are issued until the termination of the global function is indicated + * by `after_global_change()`. + */ + virtual void before_global_change(); + + /*! + issued immediately after a global function has stopped modifying the + attached arrangement. + */ + virtual void after_global_change(); + + /// @} + + /// \name Notifications on Attachment or Detachment + /// @{ + + /*! issued just before the observer is attached to the arrangement instance + * `arr`. + */ + virtual void before_attach(const Arrangement_2& arr); + + /*! issued immediately after the observer has been attached to an arrangement + * instance. + */ + virtual void after_attach(); + + /*! issued just before the observer is detached from its arrangement instance. + */ + virtual void before_detach(); + + /*! issued immediately after the observer has been detached from its arrangement + * instance. + */ + virtual void after_detach(); + + /// @} + + /// \name Notifications on Local Changes in the Arrangement + /// @{ + + /*! issued just before a new vertex that corresponds to the point `p` is + * created. + */ + virtual void before_create_vertex(const Point_2& p); + + /*! issued immediately after a new vertex `v` has been created. Note that the + * vertex still has no incident edges and is not connected to any other vertex. + */ + virtual void after_create_vertex(Vertex_handle v); + + /*! issued just before a new vertex at infinity is created, `cv` is the curve + * incident to the surface boundary, `ind` is the relevant curve-end, `ps_x` is + * the boundary condition of the vertex in \f$ x\f$ and `ps_y` is the boundary + * condition of the vertex in \f$ y\f$. + */ + virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv, + Arr_curve_end ind, + Arr_parameter_space ps_x, + Arr_parameter_space ps_y); + + /*! issued immediately after a new vertex `v` has been created. Note that the + * vertex still has no incident edges and is not connected to any other vertex. + */ + virtual void after_create_boundary_vertex(Vertex_handle v); + + /*! issued just before a new edge that corresponds to the \f$ x\f$-monotone + * curve `c` and connects the vertices `v1` and `v2` is created. + */ + virtual void before_create_edge(const X_monotone_curve_2& c, + Vertex_handle v1, Vertex_handle v2); + + /*! issued immediately after a new edge `e` has been created. The halfedge that + * is sent to this function is always directed from `v1` to `v2` (see above). + */ + virtual void after_create_edge(Halfedge_handle e); + + /*! issued just before a vertex `v` is modified to be associated with the point + * `p`. + */ + virtual void before_modify_vertex(Vertex_handle v, const Point_2& p); + + /*! issued immediately after an existing vertex `v` has been modified. */ + virtual void after_modify_vertex(Vertex_handle v); + + /*! issued just before an edge `e` is modified to be associated with the \f$ + * x\f$-monotone curve `c`. + */ + virtual void before_modify_edge(Halfedge_handle e, const X_monotone_curve_2& c); + + /*! issued immediately after an existing edge `e` has been modified. */ + virtual void after_modify_edge(Halfedge_handle e); + + /*! issued just before an edge `e` is split into two edges that should be + * associated with the \f$ x\f$-monotone curves `c1` and `c2`. The vertex `v` + * corresponds to the split point, and will be used to separate the two + * resulting edges. + */ + virtual void before_split_edge(Halfedge_handle e, Vertex_handle v, + const X_monotone_curve_2& c1, + const X_monotone_curve_2& c2); + + /*! issued immediately after an existing edge has been split into the two given + * edges `e1` and `e2`. + */ + virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2); + + /*! issued just before a fictitious edge `e` is split into two. The vertex at + * infinity `v` corresponds to the split point, and will be used to separate the + * two resulting edges. + */ + virtual void before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v); + + /*! issued immediately after an existing fictitious edge has been split into the + * two given fictitious edges `e1` and `e2`. + */ + virtual void after_split_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2); + + /*! issued just before a face `f` is split into two, as a result of the + * insertion of the edge `e` into the arrangement. + */ + virtual void before_split_face(Face_handle f, Halfedge_handle e); + + /*! issued immediately after the existing face `f1` has been split, such that a + * portion of it now forms a new face `f2`. The flag `is_hole` designates + * whether `f2` forms a hole (an inner CCB) inside `f1`. + */ + virtual void after_split_face(Face_handle f1, Face_handle f2, bool is_hole); + + /*! issued just before outer ccb `h` inside a face `f` is split into two, as a + * result of the removal of the edge `e` from the arrangement. + */ + virtual void before_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h, + Halfedge_handle e); + + /*! issued immediately after an outer ccb of the face `f` has been split, + * resulting in the two holes `h1` and `h2`. + */ + virtual void after_split_outer_ccb(Face_handle f, + Ccb_halfedge_circulator h1, + Ccb_halfedge_circulator h2); + + /*! issued just before an inner ccb `h` inside a face `f` is split into two, as + * a result of the removal of the edge `e` from the arrangement. + */ + virtual void before_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h, + Halfedge_handle e); + + /*! issued immediately after an inner ccb of the face `f` has been split, + * resulting in the two inner CCBs (holes) `h1` and `h2`. + */ + virtual void after_split_inner_ccb(Face_handle f, + Ccb_halfedge_circulator h1, + Ccb_halfedge_circulator h2); + + /*! issued just before the edge `e` is inserted as a new outer ccb inside the + * face `f`. + */ + virtual void before_add_outer_ccb(Face_handle f, Halfedge_handle e); + + /*! issued immediately after a new outer ccb `h` has been created. The outer ccb + * always consists of a single pair of twin halfedges. + */ + virtual void after_add_outer_ccb(Ccb_halfedge_circulator h); + + /*! issued just before the edge `e` is inserted as a new inner ccb inside the + * face `f`. + */ + virtual void before_add_inner_ccb(Face_handle f, Halfedge_handle e); + + /*! issued immediately after a new inner ccb `h` has been created. The inner ccb + * always consists of a single pair of twin halfedges. + */ + virtual void after_add_inner_ccb(Ccb_halfedge_circulator h); + + /*! issued just before the vertex `v` is inserted as an isolated vertex inside + * the face `f`. + */ + virtual void before_add_isolated_vertex(Face_handle f, Vertex_handle v); + + /*! issued immediately after the vertex `v` has been set as an isolated vertex. + */ + virtual void after_add_isolated_vertex(Vertex_handle v); + + /*! issued just before the two edges `e1` and `e2` are merged to form a single + * edge that will be associated with the \f$ x\f$-monotone curve `c`. + */ + virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2, + const X_monotone_curve_2& c); + + /*! issued immediately after two edges have been merged to form the edge `e`. */ + virtual void after_merge_edge(Halfedge_handle e); + + /*! issued just before the two fictitious edges `e1` and `e2` are merged to form + * a single fictitious edge. + */ + virtual void before_merge_fictitious_edge(Halfedge_handle e1, + Halfedge_handle e2); + + /*! issued immediately after two fictitious edges have been merged to form the + * fictitious edge `e`. + */ + virtual void after_merge_fictitious_edge(Halfedge_handle e); + + /*! issued just before the two edges `f1` and `f2` are merged to form a single + * face, following the removal of the edge `e` from the arrangement. + */ + virtual void before_merge_face(Face_handle f1, Face_handle f2, + Halfedge_handle e); + + /*! issued immediately after two faces have been merged to form the face `f`. */ + virtual void after_merge_face(Face_handle f); + + /*! issued just before two outer ccbs `h1` and `h2` inside the face `f` are + * merged to form a single connected component, following the insertion of the + * edge `e` into the arrangement. + */ + virtual void before_merge_outer_ccb(Face_handle f, + Ccb_halfedge_circulator h1, + Ccb_halfedge_circulator h2, + Halfedge_handle e); + + /*! issued immediately after two outer ccbs have been merged to form a single + * outer ccb `h` inside the face `f`. + */ + virtual void after_merge_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); + + /*! issued just before two inner ccbs `h1` and `h2` inside the face `f` are + * merged to form a single connected component, following the insertion of the + * edge `e` into the arrangement. + */ + virtual void before_merge_inner_ccb(Face_handle f, + Ccb_halfedge_circulator h1, + Ccb_halfedge_circulator h2, + Halfedge_handle e); + + /*! issued immediately after two inner ccbs have been merged to form a single + * inner ccb `h` inside the face `f`. + */ + virtual void after_merge_inner_ccb(Face_handle f, Ccb_halfedge_circulator h); + + /*! issued just before the outer ccb `h` is moved from one face to another. + * This can happen if the face `to_f` containing the outer ccb has just been + * split from `from_f`. + */ + virtual void before_move_outer_ccb(Face_handle from_f, Face_handle to_f, + Ccb_halfedge_circulator h); + + /*! issued immediately after the outer ccb `h` has been moved to a new face. */ + virtual void after_move_outer_ccb(Ccb_halfedge_circulator h); + + /*! issued just before the inner ccb `h` is moved from one face to another. + * This can happen if the face `to_f` containing the inner ccb has just been + * split from `from_f`. + */ + virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f, + Ccb_halfedge_circulator h); + + /*! issued immediately after the inner ccb `h` has been moved to a new face. */ + virtual void after_move_inner_ccb(Ccb_halfedge_circulator h); + + /*! issued just before the isolated vertex `v` is moved from one face to + * another. This can happen if the face `to_f` containing the isolated vertex + * has just been split from `from_f`. + */ + virtual void before_move_isolated_vertex(Face_handle from_f, + Face_handle to_f, Vertex_handle v); + + /*! issued immediately after the isolated vertex `v` has been moved to a new + * face. + */ + virtual void after_move_isolated_vertex(Vertex_handle v); + + /*! issued just before the vertex `v` is removed from the arrangement. */ + virtual void before_remove_vertex(Vertex_handle v); + + /*! issued immediately after a vertex has been removed (and deleted) from the + * arrangement. + */ + virtual void after_remove_vertex(); + + /*! issued just before the edge `e` is removed from the arrangement. */ + virtual void before_remove_edge(Halfedge_handle e); + + /*! issued immediately after an edge has been removed (and deleted) from the + * arrangement. + */ + virtual void after_remove_edge(); + + /*! issued just before the outer ccb `f` is removed from inside the face `f`. */ + virtual void before_remove_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); + + /*! issued immediately after a outer ccb has been removed (and deleted) from + * inside the face `f`. + */ + virtual void after_remove_outer_ccb(Face_handle f); + + /*! issued just before the inner ccb `f` is removed from inside the face `f`. + */ + virtual void before_remove_inner_ccb(Face_handle f, + Ccb_halfedge_circulator h); + + /*! issued immediately after a inner ccb has been removed (and deleted) from + * inside the face `f`. + */ + virtual void after_remove_inner_ccb(Face_handle f); + + /// @} + +}; /* end Aos_observer */ +} /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index fe04d140aeb..092a1b55732 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -1,409 +1,33 @@ +// Copyright (c) 2023 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Efi Fogel + +#ifndef CGAL_ARR_OBSERVER_H +#define CGAL_ARR_OBSERVER_H + +/*! \file + * Definition of the Arr_observer base class mainly for backward compatibility. + */ + +#include + +#include + namespace CGAL { -/*! \ingroup PkgArrangementOnSurface2Ref - * - * \anchor arr_refarr_obs - * - * `Arr_observer` serves as an abstract base class for all observer classes that - * are attached to an arrangement instance of type `Arrangement` and receive - * notifications from the arrangement. This base class handles the attachment - * of the observer to a given arrangement instance or to the detachment of the - * observer from this arrangement instance. It also gives a default empty - * implementation to all notification functions that are invoked by the - * arrangement to notify the observer on local or global changes it undergoes. - * The notification functions are all virtual functions, so they can be - * overridden by the concrete observer classes that inherit from `Arr_observer`. - * - * In order to implement a concrete arrangement observer-class, one simply needs - * to derive from `Arr_observer` and override the relevant notification - * functions. For example, if only face-split events are of interest, it is - * sufficient to override just `before_split_face()` (or just - * `after_split_face()`). - */ -template< typename Arrangement > -class Arr_observer { -public: +template +using Arr_observer = typename Arrangement_::Observer; -/// \name Types -/// @{ +} // namespace CGAL -/*! the type of the associated arrangement. */ -typedef unspecified_type Arrangement_2; +#include -/*! the point type. */ -typedef typename Arrangement_2::Point_2 Point_2; - -/*! the \f$ x\f$-monotone curve type. */ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - -/*! */ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; - -/*! */ -typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - -/*! */ -typedef typename Arrangement_2::Face_handle Face_handle; - -/*! represents a connected component of the boundary (CCB), either an outer - * boundary or an inner boundary (the latter is also referred to as a hole). - */ -typedef typename Arrangement_2::Ccb_halfedge_circulator Ccb_halfedge_circulator; - -/// @} - -/// \name Creation -/// @{ - -/*! constructs an observer that is unattached to any arrangement instance. */ -Arr_observer(); - -/*! constructs an observer and attaches it to the given arrangement `arr`. */ -Arr_observer(Arrangement_2& arr); - -/// @} - -/// \name Modifiers -/// @{ - -/*! attaches the observer to the given arrangement `arr`. */ -void attach(Arrangement_2& arr); - -/*! detaches the observer from its arrangement. */ -void detach(); - -/// @} - -/// \name Notifications on Global Arrangement Operations -/// @{ - -/*! issued just before the attached arrangement is assigned with the contents of - * another arrangement `arr`. - */ -virtual void before_assign(const Arrangement_2& arr); - -/*! issued immediately after the attached arrangement has been assigned with the - * contents of another arrangement. - */ -virtual void after_assign(); - -/*! issued just before the attached arrangement is cleared. */ -virtual void before_clear(); - -/*! issued immediately after the attached arrangement has been cleared, so it - * now consists only of a the unbounded face `uf`. - */ -virtual void after_clear(Face_handle uf); - -/*! issued just before a global function starts to modify the attached - * arrangement. It is guaranteed that no queries (especially no point-location - * queries) are issued until the termination of the global function is indicated - * by `after_global_change()`. - */ -virtual void before_global_change(); - -/*! -issued immediately after a global function has stopped modifying the -attached arrangement. -*/ -virtual void after_global_change(); - -/// @} - -/// \name Notifications on Attachment or Detachment -/// @{ - -/*! issued just before the observer is attached to the arrangement instance - * `arr`. - */ -virtual void before_attach(const Arrangement_2& arr); - -/*! issued immediately after the observer has been attached to an arrangement - * instance. - */ -virtual void after_attach(); - -/*! issued just before the observer is detached from its arrangement instance. - */ -virtual void before_detach(); - -/*! issued immediately after the observer has been detached from its arrangement - * instance. - */ -virtual void after_detach(); - -/// @} - -/// \name Notifications on Local Changes in the Arrangement -/// @{ - -/*! issued just before a new vertex that corresponds to the point `p` is - * created. - */ -virtual void before_create_vertex(const Point_2& p); - -/*! issued immediately after a new vertex `v` has been created. Note that the - * vertex still has no incident edges and is not connected to any other vertex. - */ -virtual void after_create_vertex(Vertex_handle v); - -/*! issued just before a new vertex at infinity is created, `cv` is the curve - * incident to the surface boundary, `ind` is the relevant curve-end, `ps_x` is - * the boundary condition of the vertex in \f$ x\f$ and `ps_y` is the boundary - * condition of the vertex in \f$ y\f$. - */ -virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv, - Arr_curve_end ind, - Arr_parameter_space ps_x, - Arr_parameter_space ps_y); - -/*! issued immediately after a new vertex `v` has been created. Note that the - * vertex still has no incident edges and is not connected to any other vertex. - */ -virtual void after_create_boundary_vertex(Vertex_handle v); - -/*! issued just before a new edge that corresponds to the \f$ x\f$-monotone - * curve `c` and connects the vertices `v1` and `v2` is created. - */ -virtual void before_create_edge(const X_monotone_curve_2& c, - Vertex_handle v1, Vertex_handle v2); - -/*! issued immediately after a new edge `e` has been created. The halfedge that - * is sent to this function is always directed from `v1` to `v2` (see above). - */ -virtual void after_create_edge(Halfedge_handle e); - -/*! issued just before a vertex `v` is modified to be associated with the point - * `p`. - */ -virtual void before_modify_vertex(Vertex_handle v, const Point_2& p); - -/*! issued immediately after an existing vertex `v` has been modified. */ -virtual void after_modify_vertex(Vertex_handle v); - -/*! issued just before an edge `e` is modified to be associated with the \f$ - * x\f$-monotone curve `c`. - */ -virtual void before_modify_edge(Halfedge_handle e, const X_monotone_curve_2& c); - -/*! issued immediately after an existing edge `e` has been modified. */ -virtual void after_modify_edge(Halfedge_handle e); - -/*! issued just before an edge `e` is split into two edges that should be - * associated with the \f$ x\f$-monotone curves `c1` and `c2`. The vertex `v` - * corresponds to the split point, and will be used to separate the two - * resulting edges. - */ -virtual void before_split_edge(Halfedge_handle e, Vertex_handle v, - const X_monotone_curve_2& c1, - const X_monotone_curve_2& c2); - -/*! issued immediately after an existing edge has been split into the two given - * edges `e1` and `e2`. - */ -virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2); - -/*! issued just before a fictitious edge `e` is split into two. The vertex at - * infinity `v` corresponds to the split point, and will be used to separate the - * two resulting edges. - */ -virtual void before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v); - -/*! issued immediately after an existing fictitious edge has been split into the - * two given fictitious edges `e1` and `e2`. - */ -virtual void after_split_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2); - -/*! issued just before a face `f` is split into two, as a result of the - * insertion of the edge `e` into the arrangement. - */ -virtual void before_split_face(Face_handle f, Halfedge_handle e); - -/*! issued immediately after the existing face `f1` has been split, such that a - * portion of it now forms a new face `f2`. The flag `is_hole` designates - * whether `f2` forms a hole (an inner CCB) inside `f1`. - */ -virtual void after_split_face(Face_handle f1, Face_handle f2, bool is_hole); - -/*! issued just before outer ccb `h` inside a face `f` is split into two, as a - * result of the removal of the edge `e` from the arrangement. - */ -virtual void before_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h, - Halfedge_handle e); - -/*! issued immediately after an outer ccb of the face `f` has been split, - * resulting in the two holes `h1` and `h2`. - */ -virtual void after_split_outer_ccb(Face_handle f, - Ccb_halfedge_circulator h1, - Ccb_halfedge_circulator h2); - -/*! issued just before an inner ccb `h` inside a face `f` is split into two, as - * a result of the removal of the edge `e` from the arrangement. - */ -virtual void before_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h, - Halfedge_handle e); - -/*! issued immediately after an inner ccb of the face `f` has been split, - * resulting in the two inner CCBs (holes) `h1` and `h2`. - */ -virtual void after_split_inner_ccb(Face_handle f, - Ccb_halfedge_circulator h1, - Ccb_halfedge_circulator h2); - -/*! issued just before the edge `e` is inserted as a new outer ccb inside the - * face `f`. - */ -virtual void before_add_outer_ccb(Face_handle f, Halfedge_handle e); - -/*! issued immediately after a new outer ccb `h` has been created. The outer ccb - * always consists of a single pair of twin halfedges. - */ -virtual void after_add_outer_ccb(Ccb_halfedge_circulator h); - -/*! issued just before the edge `e` is inserted as a new inner ccb inside the - * face `f`. - */ -virtual void before_add_inner_ccb(Face_handle f, Halfedge_handle e); - -/*! issued immediately after a new inner ccb `h` has been created. The inner ccb - * always consists of a single pair of twin halfedges. - */ -virtual void after_add_inner_ccb(Ccb_halfedge_circulator h); - -/*! issued just before the vertex `v` is inserted as an isolated vertex inside - * the face `f`. - */ -virtual void before_add_isolated_vertex(Face_handle f, Vertex_handle v); - -/*! issued immediately after the vertex `v` has been set as an isolated vertex. - */ -virtual void after_add_isolated_vertex(Vertex_handle v); - -/*! issued just before the two edges `e1` and `e2` are merged to form a single - * edge that will be associated with the \f$ x\f$-monotone curve `c`. -*/ -virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2, - const X_monotone_curve_2& c); - -/*! issued immediately after two edges have been merged to form the edge `e`. */ -virtual void after_merge_edge(Halfedge_handle e); - -/*! issued just before the two fictitious edges `e1` and `e2` are merged to form - * a single fictitious edge. - */ -virtual void before_merge_fictitious_edge(Halfedge_handle e1, - Halfedge_handle e2); - -/*! issued immediately after two fictitious edges have been merged to form the - * fictitious edge `e`. - */ -virtual void after_merge_fictitious_edge(Halfedge_handle e); - -/*! issued just before the two edges `f1` and `f2` are merged to form a single - * face, following the removal of the edge `e` from the arrangement. - */ -virtual void before_merge_face(Face_handle f1, Face_handle f2, - Halfedge_handle e); - -/*! issued immediately after two faces have been merged to form the face `f`. */ -virtual void after_merge_face(Face_handle f); - -/*! issued just before two outer ccbs `h1` and `h2` inside the face `f` are - * merged to form a single connected component, following the insertion of the - * edge `e` into the arrangement. - */ -virtual void before_merge_outer_ccb(Face_handle f, - Ccb_halfedge_circulator h1, - Ccb_halfedge_circulator h2, - Halfedge_handle e); - -/*! issued immediately after two outer ccbs have been merged to form a single - * outer ccb `h` inside the face `f`. - */ -virtual void after_merge_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); - -/*! issued just before two inner ccbs `h1` and `h2` inside the face `f` are - * merged to form a single connected component, following the insertion of the - * edge `e` into the arrangement. - */ -virtual void before_merge_inner_ccb(Face_handle f, - Ccb_halfedge_circulator h1, - Ccb_halfedge_circulator h2, - Halfedge_handle e); - -/*! issued immediately after two inner ccbs have been merged to form a single - * inner ccb `h` inside the face `f`. - */ -virtual void after_merge_inner_ccb(Face_handle f, Ccb_halfedge_circulator h); - -/*! issued just before the outer ccb `h` is moved from one face to another. - * This can happen if the face `to_f` containing the outer ccb has just been - * split from `from_f`. - */ -virtual void before_move_outer_ccb(Face_handle from_f, Face_handle to_f, - Ccb_halfedge_circulator h); - -/*! issued immediately after the outer ccb `h` has been moved to a new face. */ -virtual void after_move_outer_ccb(Ccb_halfedge_circulator h); - -/*! issued just before the inner ccb `h` is moved from one face to another. - * This can happen if the face `to_f` containing the inner ccb has just been - * split from `from_f`. - */ -virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f, - Ccb_halfedge_circulator h); - -/*! issued immediately after the inner ccb `h` has been moved to a new face. */ -virtual void after_move_inner_ccb(Ccb_halfedge_circulator h); - -/*! issued just before the isolated vertex `v` is moved from one face to - * another. This can happen if the face `to_f` containing the isolated vertex - * has just been split from `from_f`. - */ -virtual void before_move_isolated_vertex(Face_handle from_f, - Face_handle to_f, Vertex_handle v); - -/*! issued immediately after the isolated vertex `v` has been moved to a new - * face. - */ -virtual void after_move_isolated_vertex(Vertex_handle v); - -/*! issued just before the vertex `v` is removed from the arrangement. */ -virtual void before_remove_vertex(Vertex_handle v); - -/*! issued immediately after a vertex has been removed (and deleted) from the - * arrangement. - */ -virtual void after_remove_vertex(); - -/*! issued just before the edge `e` is removed from the arrangement. */ -virtual void before_remove_edge(Halfedge_handle e); - -/*! issued immediately after an edge has been removed (and deleted) from the - * arrangement. - */ -virtual void after_remove_edge(); - -/*! issued just before the outer ccb `f` is removed from inside the face `f`. */ -virtual void before_remove_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); - -/*! issued immediately after a outer ccb has been removed (and deleted) from - * inside the face `f`. - */ -virtual void after_remove_outer_ccb(Face_handle f); - -/*! issued just before the inner ccb `f` is removed from inside the face `f`. - */ -virtual void before_remove_inner_ccb(Face_handle f, -Ccb_halfedge_circulator h); - -/*! issued immediately after a inner ccb has been removed (and deleted) from - * inside the face `f`. - */ -virtual void after_remove_inner_ccb(Face_handle f); - -/// @} - -}; /* end Arr_observer */ -} /* end namespace CGAL */ +#endif diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 20dc50a5795..5d9ba63b69b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -199,7 +199,8 @@ implemented as peripheral classes or as free (global) functions. - `CGAL::Arrangement_2` - `CGAL::Arrangement_with_history_2` - `CGAL::Arr_accessor` -- `CGAL::Arr_observer` +- `CGAL::Aos_observer` +- `CGAL::Arr_observer` - `CGAL::Arrangement_2::Vertex` - `CGAL::Arrangement_2::Halfedge` - `CGAL::Arrangement_2::Face` diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp index 21494ebb891..d1bdaa8bb38 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "arr_exact_construction_segments.h" @@ -11,13 +12,13 @@ using Ex_arrangement = CGAL::Arrangement_2; // An arrangement observer, used to receive notifications of face splits and // to update the indices of the newly created faces. -class Face_index_observer : public Ex_arrangement::Observer { +class Face_index_observer : public CGAL::Arr_observer { private: size_t n_faces; // the current number of faces public: Face_index_observer(Ex_arrangement& arr) : - Ex_arrangement::Observer(arr), + CGAL::Arr_observer(arr), n_faces(0) { CGAL_precondition(arr.is_empty()); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp index 547fdab09c0..d4261d64dd2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer.cpp @@ -2,14 +2,15 @@ // Using a simple arrangement observer. #include +#include #include "arr_exact_construction_segments.h" #include "arr_print.h" // An observer that receives notifications of face splits and face mergers. -class My_observer : public Arrangement::Observer { +class My_observer : public CGAL::Arr_observer { public: - My_observer(Arrangement& arr) : Arrangement::Observer(arr) {} + My_observer(Arrangement& arr) : CGAL::Arr_observer(arr) {} virtual void before_split_face(Face_handle, Halfedge_handle e) { std::cout << "-> The insertion of : [ " << e->curve() diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp index 1b27e3bdda0..2fb6649b535 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp @@ -55,22 +55,6 @@ int main() { // Landmarks_pl landmarks_pl(gm); Walk_pl walk_pl(gm); // Trap_pl trap_pl(gm); - /* Need to add the code below to both Arr_spherical_gaussian_map_3 and - * Arr_polyhedral_sgm, and then work on the trap point location code... - -private: - friend class Arr_observer; - friend class Arr_accessor; - -protected: - typedef Arr_observer Observer; - - void _register_observer(Observer *p_obs) - { Base::_register_observer((typename Base::Observer*)p_obs); } - - bool _unregister_observer(Observer *p_obs) - { return (Base::_unregister_observer ((typename Base::Observer*)p_obs)); } - */ Gm_traits traits; Gm_initializer gm_initializer(gm); diff --git a/Arrangement_on_surface_2/include/CGAL/Aos_observer.h b/Arrangement_on_surface_2/include/CGAL/Aos_observer.h new file mode 100644 index 00000000000..d74034640e2 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Aos_observer.h @@ -0,0 +1,573 @@ +// Copyright (c) 2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s): Ron Wein +// Efi Fogel + +#ifndef CGAL_AOS_OBSERVER_H +#define CGAL_AOS_OBSERVER_H + +#include + +#include + +#include + +/*! \file + * Definition of the Aos_observer base class. + */ + +namespace CGAL { + +/*! \class + * A base class for arrangement observers. + * The Arrangement parameter corresponds to an arrangement instantiation. + */ +template +class Aos_observer +{ +public: + typedef Arrangement_ Arrangement_2; + typedef Aos_observer Self; + + typedef typename Arrangement_2::Point_2 Point_2; + typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + + typedef typename Arrangement_2::Vertex_handle Vertex_handle; + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + typedef typename Arrangement_2::Face_handle Face_handle; + typedef typename Arrangement_2::Ccb_halfedge_circulator + Ccb_halfedge_circulator; + +private: + Arrangement_2* p_arr; // The associated arrangement. + + /*! Copy constructor - not supported. */ + Aos_observer(const Self&); + + /*! Assignment operator - not supported. */ + Self& operator=(const Self&); + +public: + /// \name Construction and destruction functions. + //@{ + + /*! Default constructor. */ + Aos_observer() : p_arr(nullptr) {} + + /*! Constructor with an associated arrangement. */ + Aos_observer(Arrangement_2& arr) : p_arr(&arr) + { + // Register the observer object in the arrangement. + p_arr->_register_observer(this); + } + + /*! Destructor. */ + virtual ~Aos_observer() + { + // Unregister the observer object from the arrangement. + if (p_arr != nullptr) + p_arr->_unregister_observer(this); + } + //@} + + /// \name Modifying the associated arrangement. + //@{ + + /*! Get the associated arrangement (non-const version). */ + const Arrangement_2* arrangement() const { return (p_arr); } + + /*! Get the associated arrangement (non-const version). */ + Arrangement_2* arrangement() { return (p_arr); } + + /*! Attach the observer to an arrangement. + * \pre The observer is not already attached to an arrangement. + */ + void attach(Arrangement_2& arr) + { + // Do nothing if the associated arrangement is not changed. + if (p_arr == &arr) return; + + // The observer is not already attached to an arrangement. + CGAL_precondition (p_arr == nullptr); + + if (p_arr != nullptr) return; + + // Notify the concrete observer (the sub-class) about the attachment. + before_attach(arr); + + // Register the observer object in the new arrangement. + p_arr = &arr; + p_arr->_register_observer(this); + + // Notify the concrete observer that the attachment took place. + after_attach(); + } + + /*! Detach the observer from the arrangement. */ + void detach() + { + if (p_arr == nullptr) return; + + // Notify the concrete observer (the sub-class) about the detachment. + before_detach (); + + // Unregister the observer object from the current arrangement, and mark + // that the observer is not attached to an arrangement. + p_arr->_unregister_observer(this); + p_arr = nullptr; + + // Notify the concrete observer that the detachment took place. + after_detach(); + } + //@} + + /// \name Notification functions on global arrangement operations. + //@{ + + /*! Notification before the arrangement is assigned with another + * arrangement. + * \param arr The arrangement to be copied. + */ + virtual void before_assign(const Arrangement_2& /* arr */) {} + + /*! Notification after the arrangement has been assigned with another + * arrangement. + */ + virtual void after_assign() {} + + /*! Notification before the arrangement is cleared. */ + virtual void before_clear() {} + + /*! Notification after the arrangement is cleared. */ + virtual void after_clear() {} + + /*! Notification before a global operation modifies the arrangement. */ + virtual void before_global_change() {} + + /*! Notification after a global operation is completed. */ + virtual void after_global_change() {} + //@} + + /// \name Notification functions on observer attachment or detachment. + //@{ + + /*! Notification before the observer is attached to an arrangement. + * \param arr The arrangement we are about to attach the observer to. + */ + virtual void before_attach(const Arrangement_2& /* arr */) {} + + /*! Notification after the observer has been attached to an arrangement. */ + virtual void after_attach() {} + + /*! Notification before the observer is detached from the arrangement. */ + virtual void before_detach() {} + + /*! Notification after the observer has been detached to the arrangement. */ + virtual void after_detach() {} + //@} + + /// \name Notification functions on local changes in the arrangement. + //@{ + + /*! + * Notification before the creation of a new vertex. + * \param p The point to be associated with the vertex. + * This point cannot lies on the surface boundaries. + */ + virtual void before_create_vertex(const Point_2& /* p */) {} + + /*! Notification after the creation of a new vertex. + * \param v A handle to the created vertex. + */ + virtual void after_create_vertex(Vertex_handle /* v */) + {} + + /*! Notification before the creation of a new boundary vertex. + * \param p The on the surface boundary. + * \param ps_x The boundary condition of the vertex in x. + * \param ps_y The boundary condition of the vertex in y. + */ + virtual void before_create_boundary_vertex(const Point_2& /* p */, + Arr_parameter_space /* ps_x */, + Arr_parameter_space /* ps_y */) + {} + + /*! Notification before the creation of a new boundary vertex. + * \param cv The curve incident to the surface boundary. + * \param ind The relevant curve-end. + * \param ps_x The boundary condition of the vertex in x. + * \param ps_y The boundary condition of the vertex in y. + */ + virtual void before_create_boundary_vertex(const X_monotone_curve_2& /* cv */, + Arr_curve_end /* ind */, + Arr_parameter_space /* ps_x */, + Arr_parameter_space /* ps_y */) + {} + + /*! Notification after the creation of a new vertex at infinity. + * \param v A handle to the created vertex. + */ + virtual void after_create_boundary_vertex(Vertex_handle /* v */) {} + + /*! Notification before the creation of a new edge. + * \param c The x-monotone curve to be associated with the edge. + * \param v1 A handle to the first end-vertex of the edge. + * \param v2 A handle to the second end-vertex of the edge. + */ + virtual void before_create_edge(const X_monotone_curve_2& /* c */, + Vertex_handle /* v1 */, + Vertex_handle /* v2 */) + {} + + /*! Notification after the creation of a new edge. + * \param e A handle to one of the twin halfedges that were created. + */ + virtual void after_create_edge(Halfedge_handle /* e */) {} + + /*! Notification before the modification of an existing vertex. + * \param v A handle to the vertex to be updated. + * \param p The point to be associated with the vertex. + */ + virtual void before_modify_vertex(Vertex_handle /* v */, + const Point_2& /* p */) + {} + + /*! Notification after a vertex was modified. + * \param v A handle to the updated vertex. + */ + virtual void after_modify_vertex(Vertex_handle /* v */) {} + + /*! Notification before the modification of an existing edge. + * \param e A handle to one of the twin halfedges to be updated. + * \param c The x-monotone curve to be associated with the edge. + */ + virtual void before_modify_edge(Halfedge_handle /* e */, + const X_monotone_curve_2& /* c */) + {} + + /*! Notification after an edge was modified. + * \param e A handle to one of the twin halfedges that were updated. + */ + virtual void after_modify_edge(Halfedge_handle /* e */) {} + + /*! Notification before the splitting of an edge into two. + * \param e A handle to one of the existing halfedges. + * \param v A vertex representing the split point. + * \param c1 The x-monotone curve to be associated with the first edge. + * \param c2 The x-monotone curve to be associated with the second edge. + */ + virtual void before_split_edge(Halfedge_handle /* e */, + Vertex_handle /* v */, + const X_monotone_curve_2& /* c1 */, + const X_monotone_curve_2& /* c2 */) + {} + + /*! Notification after an edge was split. + * \param e1 A handle to one of the twin halfedges forming the first edge. + * \param e2 A handle to one of the twin halfedges forming the second edge. + */ + virtual void after_split_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) + {} + + /*! Notification before the splitting of a fictitious edge into two. + * \param e A handle to one of the existing halfedges. + * \param v A vertex representing the unbounded split point. + */ + virtual void before_split_fictitious_edge(Halfedge_handle /* e */, + Vertex_handle /* v */) + {} + + /*! Notification after a fictitious edge was split. + * \param e1 A handle to one of the twin halfedges forming the first edge. + * \param e2 A handle to one of the twin halfedges forming the second edge. + */ + virtual void after_split_fictitious_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) + {} + + /*! Notification before the splitting of a face into two. + * \param f A handle to the existing face. + * \param e The new edge whose insertion causes the face to split. + */ + virtual void before_split_face(Face_handle /* f */, + Halfedge_handle /* e */) + {} + + /*! Notification after a face was split. + * \param f A handle to the face we have just split. + * \param new_f A handle to the new face that has been created. + * \param is_hole Whether the new face forms a hole inside f. + */ + virtual void after_split_face(Face_handle /* f */, + Face_handle /* new_f */, + bool /* is_hole */) + {} + + /*! Notification before the splitting of an outer CCB into two. + * \param f A handle to the face that owns the outer CCB. + * \param h A circulator representing the component boundary. + * \param e The new edge whose removal causes the outer CCB to split. + */ + virtual void before_split_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */, + Halfedge_handle /* e */) + {} + + /*! Notification after an outer CCB was split. + * \param f A handle to the face that owns the outer CCBs. + * \param h1 A circulator representing the boundary of the first component. + * \param h2 A circulator representing the boundary of the second component. + */ + virtual void after_split_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */) + {} + + /*! Notification before the splitting of an inner CCB into two. + * \param f A handle to the face containing the inner CCB. + * \param h A circulator representing the component boundary. + * \param e The new edge whose removal causes the inner CCB to split. + */ + virtual void before_split_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */, + Halfedge_handle /* e */) + {} + + /*! Notification after an inner CCB was split. + * \param f A handle to the face containing the inner CCBs. + * \param h1 A circulator representing the boundary of the first component. + * \param h2 A circulator representing the boundary of the second component. + */ + virtual void after_split_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */) + {} + + /*! Notification before the creation of a new outer CCB of a face. + * \param f A handle to the face that owns the outer CCB. + * \param e A halfedge along the new outer CCB. + */ + virtual void before_add_outer_ccb(Face_handle /* f */, + Halfedge_handle /* e */) + {} + + /*! Notification after an outer CCB was added to a face. + * \param h A circulator representing the boundary of the new outer CCB. + */ + virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) {} + + /*! Notification before the creation of a new inner CCB inside a face. + * \param f A handle to the face containing the inner CCB. + * \param e The new halfedge that forms the new inner CCB. + */ + virtual void before_add_inner_ccb(Face_handle /* f */, + Halfedge_handle /* e */) + {} + + /*! Notification after an inner CCB was created inside a face. + * \param h A circulator representing the boundary of the new inner CCB. + */ + virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) {} + + /*! Notification before the creation of a new isolated vertex inside a face. + * \param f A handle to the face containing the isolated vertex. + * \param v The isolated vertex. + */ + virtual void before_add_isolated_vertex(Face_handle /* f */, + Vertex_handle /* v */) + {} + + /*! Notification after an isolated vertex was created inside a face. + * \param v The isolated vertex. + */ + virtual void after_add_isolated_vertex(Vertex_handle /* v */) {} + + /*! Notification before the merging of two edges. + * \param e1 A handle to one of the halfedges forming the first edge. + * \param e2 A handle to one of the halfedges forming the second edge. + * \param c The x-monotone curve to be associated with the merged edge. + */ + virtual void before_merge_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */, + const X_monotone_curve_2& /* c */) + {} + + /*! Notification after an edge was merged. + * \param e A handle to one of the twin halfedges forming the merged edge. + */ + virtual void after_merge_edge(Halfedge_handle /* e */) {} + + /*! Notification before the merging of two fictitious edges. + * \param e1 A handle to one of the halfedges forming the first edge. + * \param e2 A handle to one of the halfedges forming the second edge. + */ + virtual void before_merge_fictitious_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) + {} + + /*! Notification after a fictitious edge was merged. + * \param e A handle to one of the twin halfedges forming the merged edge. + */ + virtual void after_merge_fictitious_edge(Halfedge_handle /* e */) {} + + /*! Notification before the merging of two faces. + * \param f1 A handle to the first face. + * \param f2 A handle to the second face. + * \param e The edge whose removal causes the faces to merge. + */ + virtual void before_merge_face(Face_handle /* f1 */, + Face_handle /* f2 */, + Halfedge_handle /* e */) + {} + + /*! Notification after a face was merged. + * \param f A handle to the merged face. + */ + virtual void after_merge_face(Face_handle /* f */) {} + + /*! Notification before the merging of two outer CCBs. + * \param f A handle to the face that owns the outer CCBs. + * \param h1 A circulator representing the boundary of the first component. + * \param h2 A circulator representing the boundary of the second component. + * \param e The edge whose insertion or removal causes the CCBs to merge. + */ + virtual void before_merge_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */, + Halfedge_handle /* e */) + {} + + /*! Notification after an outer CCB was merged. + * \param f A handle to the face that owns the outer CCBs. + * \param h A circulator representing the boundary of the merged component. + */ + virtual void after_merge_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! Notification before the merging of two inner CCBs (holes). + * \param f A handle to the face that contains the inner CCBs. + * \param h1 A circulator representing the boundary of the first component. + * \param h2 A circulator representing the boundary of the second component. + * \param e The edge whose insertion causes the inner CCBs to merge. + */ + virtual void before_merge_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */, + Halfedge_handle /* e */) + {} + + /*! Notification after an inner CCB was merged. + * \param f A handle to the face that contains the inner CCBs. + * \param h A circulator representing the boundary of the merged component. + */ + virtual void after_merge_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! Notification before an outer CCB is moved from one face to another. + * \param from_f A handle to the face that currently owns the outer CCB. + * \param to_f A handle to the face that should own the outer CCB. + * \param h A circulator representing the boundary of the component. + */ + virtual void before_move_outer_ccb(Face_handle /* from_f */, + Face_handle /* to_f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! Notification after an outer CCB is moved from one face to another. + * \param h A circulator representing the boundary of the component. + */ + virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) {} + + + /*! Notification before an inner CCB is moved from one face to another. + * \param from_f A handle to the face currently containing the inner CCB. + * \param to_f A handle to the face that should contain the inner CCB. + * \param h A circulator representing the boundary of the component. + */ + virtual void before_move_inner_ccb(Face_handle /* from_f */, + Face_handle /* to_f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! + * Notification after an inner CCB is moved from one face to another. + * \param h A circulator representing the boundary of the component. + */ + virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) {} + + /*! Notification before an isolated vertex is moved from one face to another. + * \param from_f A handle to the face currently containing the vertex. + * \param to_f A handle to the face that should contain the vertex. + * \param v The isolated vertex. + */ + virtual void before_move_isolated_vertex(Face_handle /* from_f */, + Face_handle /* to_f */, + Vertex_handle /* v */) + {} + + /*! Notification after an isolated vertex is moved from one face to another. + * \param v The isolated vertex. + */ + virtual void after_move_isolated_vertex(Vertex_handle /* v */) {} + + /*! Notificaion before the removal of a vertex. + * \param v A handle to the vertex to be deleted. + */ + virtual void before_remove_vertex(Vertex_handle /* v */) {} + + /*! Notificaion after the removal of a vertex. */ + virtual void after_remove_vertex() {} + + /*! Notification before the removal of an edge. + * \param e A handle to one of the twin halfedges to be deleted. + */ + virtual void before_remove_edge(Halfedge_handle /* e */) {} + + /*! Notificaion after the removal of an edge. */ + virtual void after_remove_edge() {} + + /*! Notification before the removal of an outer CCB. + * \param f The face that owns the outer CCB. + * \param h A circulator representing the boundary of the component. + */ + virtual void before_remove_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! Notificaion after the removal of an outer CCB. + * \param f The face that used to own the outer CCB. + */ + virtual void after_remove_outer_ccb(Face_handle /* f */) {} + + /*! Notification before the removal of an inner CCB. + * \param f The face containing the inner CCB. + * \param h A circulator representing the boundary of the component. + */ + virtual void before_remove_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) + {} + + /*! Notificaion after the removal of an inner CCB. + * \param f The face that used to contain the inner CCB. + */ + virtual void after_remove_inner_ccb(Face_handle /* f */) {} + + //@} +}; + +} //namespace CGAL + +#include + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h index c622bbe1a32..092a1b55732 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// Copyright (c) 2023 Tel-Aviv University (Israel). // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -8,565 +8,25 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Ron Wein -// Efi Fogel +// Author(s): Efi Fogel #ifndef CGAL_ARR_OBSERVER_H #define CGAL_ARR_OBSERVER_H +/*! \file + * Definition of the Arr_observer base class mainly for backward compatibility. + */ + #include #include -#include - -/*! \file - * Definition of the Arr_observer base class. - */ - namespace CGAL { -/*! \class - * A base class for arrangement observers. - * The Arrangement parameter corresponds to an arrangement instantiation. - */ template -class Arr_observer -{ -public: - typedef Arrangement_ Arrangement_2; - typedef Arr_observer Self; +using Arr_observer = typename Arrangement_::Observer; - typedef typename Arrangement_2::Point_2 Point_2; - typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; - typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; - -private: - Arrangement_2* p_arr; // The associated arrangement. - - /*! Copy constructor - not supported. */ - Arr_observer(const Self&); - - /*! Assignment operator - not supported. */ - Self& operator=(const Self&); - -public: - /// \name Construction and destruction functions. - //@{ - - /*! Default constructor. */ - Arr_observer() : p_arr(nullptr) {} - - /*! Constructor with an associated arrangement. */ - Arr_observer(Arrangement_2& arr) : p_arr(&arr) - { - // Register the observer object in the arrangement. - p_arr->_register_observer(this); - } - - /*! Destructor. */ - virtual ~Arr_observer() - { - // Unregister the observer object from the arrangement. - if (p_arr != nullptr) - p_arr->_unregister_observer(this); - } - //@} - - /// \name Modifying the associated arrangement. - //@{ - - /*! Get the associated arrangement (non-const version). */ - const Arrangement_2* arrangement() const { return (p_arr); } - - /*! Get the associated arrangement (non-const version). */ - Arrangement_2* arrangement() { return (p_arr); } - - /*! Attach the observer to an arrangement. - * \pre The observer is not already attached to an arrangement. - */ - void attach(Arrangement_2& arr) - { - // Do nothing if the associated arrangement is not changed. - if (p_arr == &arr) return; - - // The observer is not already attached to an arrangement. - CGAL_precondition (p_arr == nullptr); - - if (p_arr != nullptr) return; - - // Notify the concrete observer (the sub-class) about the attachment. - before_attach(arr); - - // Register the observer object in the new arrangement. - p_arr = &arr; - p_arr->_register_observer(this); - - // Notify the concrete observer that the attachment took place. - after_attach(); - } - - /*! Detach the observer from the arrangement. */ - void detach() - { - if (p_arr == nullptr) return; - - // Notify the concrete observer (the sub-class) about the detachment. - before_detach (); - - // Unregister the observer object from the current arrangement, and mark - // that the observer is not attached to an arrangement. - p_arr->_unregister_observer(this); - p_arr = nullptr; - - // Notify the concrete observer that the detachment took place. - after_detach(); - } - //@} - - /// \name Notification functions on global arrangement operations. - //@{ - - /*! Notification before the arrangement is assigned with another - * arrangement. - * \param arr The arrangement to be copied. - */ - virtual void before_assign(const Arrangement_2& /* arr */) {} - - /*! Notification after the arrangement has been assigned with another - * arrangement. - */ - virtual void after_assign() {} - - /*! Notification before the arrangement is cleared. */ - virtual void before_clear() {} - - /*! Notification after the arrangement is cleared. */ - virtual void after_clear() {} - - /*! Notification before a global operation modifies the arrangement. */ - virtual void before_global_change() {} - - /*! Notification after a global operation is completed. */ - virtual void after_global_change() {} - //@} - - /// \name Notification functions on observer attachment or detachment. - //@{ - - /*! Notification before the observer is attached to an arrangement. - * \param arr The arrangement we are about to attach the observer to. - */ - virtual void before_attach(const Arrangement_2& /* arr */) {} - - /*! Notification after the observer has been attached to an arrangement. */ - virtual void after_attach() {} - - /*! Notification before the observer is detached from the arrangement. */ - virtual void before_detach() {} - - /*! Notification after the observer has been detached to the arrangement. */ - virtual void after_detach() {} - //@} - - /// \name Notification functions on local changes in the arrangement. - //@{ - - /*! - * Notification before the creation of a new vertex. - * \param p The point to be associated with the vertex. - * This point cannot lies on the surface boundaries. - */ - virtual void before_create_vertex(const Point_2& /* p */) {} - - /*! Notification after the creation of a new vertex. - * \param v A handle to the created vertex. - */ - virtual void after_create_vertex(Vertex_handle /* v */) - {} - - /*! Notification before the creation of a new boundary vertex. - * \param p The on the surface boundary. - * \param ps_x The boundary condition of the vertex in x. - * \param ps_y The boundary condition of the vertex in y. - */ - virtual void before_create_boundary_vertex(const Point_2& /* p */, - Arr_parameter_space /* ps_x */, - Arr_parameter_space /* ps_y */) - {} - - /*! Notification before the creation of a new boundary vertex. - * \param cv The curve incident to the surface boundary. - * \param ind The relevant curve-end. - * \param ps_x The boundary condition of the vertex in x. - * \param ps_y The boundary condition of the vertex in y. - */ - virtual void before_create_boundary_vertex(const X_monotone_curve_2& /* cv */, - Arr_curve_end /* ind */, - Arr_parameter_space /* ps_x */, - Arr_parameter_space /* ps_y */) - {} - - /*! Notification after the creation of a new vertex at infinity. - * \param v A handle to the created vertex. - */ - virtual void after_create_boundary_vertex(Vertex_handle /* v */) {} - - /*! Notification before the creation of a new edge. - * \param c The x-monotone curve to be associated with the edge. - * \param v1 A handle to the first end-vertex of the edge. - * \param v2 A handle to the second end-vertex of the edge. - */ - virtual void before_create_edge(const X_monotone_curve_2& /* c */, - Vertex_handle /* v1 */, - Vertex_handle /* v2 */) - {} - - /*! Notification after the creation of a new edge. - * \param e A handle to one of the twin halfedges that were created. - */ - virtual void after_create_edge(Halfedge_handle /* e */) {} - - /*! Notification before the modification of an existing vertex. - * \param v A handle to the vertex to be updated. - * \param p The point to be associated with the vertex. - */ - virtual void before_modify_vertex(Vertex_handle /* v */, - const Point_2& /* p */) - {} - - /*! Notification after a vertex was modified. - * \param v A handle to the updated vertex. - */ - virtual void after_modify_vertex(Vertex_handle /* v */) {} - - /*! Notification before the modification of an existing edge. - * \param e A handle to one of the twin halfedges to be updated. - * \param c The x-monotone curve to be associated with the edge. - */ - virtual void before_modify_edge(Halfedge_handle /* e */, - const X_monotone_curve_2& /* c */) - {} - - /*! Notification after an edge was modified. - * \param e A handle to one of the twin halfedges that were updated. - */ - virtual void after_modify_edge(Halfedge_handle /* e */) {} - - /*! Notification before the splitting of an edge into two. - * \param e A handle to one of the existing halfedges. - * \param v A vertex representing the split point. - * \param c1 The x-monotone curve to be associated with the first edge. - * \param c2 The x-monotone curve to be associated with the second edge. - */ - virtual void before_split_edge(Halfedge_handle /* e */, - Vertex_handle /* v */, - const X_monotone_curve_2& /* c1 */, - const X_monotone_curve_2& /* c2 */) - {} - - /*! Notification after an edge was split. - * \param e1 A handle to one of the twin halfedges forming the first edge. - * \param e2 A handle to one of the twin halfedges forming the second edge. - */ - virtual void after_split_edge(Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - {} - - /*! Notification before the splitting of a fictitious edge into two. - * \param e A handle to one of the existing halfedges. - * \param v A vertex representing the unbounded split point. - */ - virtual void before_split_fictitious_edge(Halfedge_handle /* e */, - Vertex_handle /* v */) - {} - - /*! Notification after a fictitious edge was split. - * \param e1 A handle to one of the twin halfedges forming the first edge. - * \param e2 A handle to one of the twin halfedges forming the second edge. - */ - virtual void after_split_fictitious_edge(Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - {} - - /*! Notification before the splitting of a face into two. - * \param f A handle to the existing face. - * \param e The new edge whose insertion causes the face to split. - */ - virtual void before_split_face(Face_handle /* f */, - Halfedge_handle /* e */) - {} - - /*! Notification after a face was split. - * \param f A handle to the face we have just split. - * \param new_f A handle to the new face that has been created. - * \param is_hole Whether the new face forms a hole inside f. - */ - virtual void after_split_face(Face_handle /* f */, - Face_handle /* new_f */, - bool /* is_hole */) - {} - - /*! Notification before the splitting of an outer CCB into two. - * \param f A handle to the face that owns the outer CCB. - * \param h A circulator representing the component boundary. - * \param e The new edge whose removal causes the outer CCB to split. - */ - virtual void before_split_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */, - Halfedge_handle /* e */) - {} - - /*! Notification after an outer CCB was split. - * \param f A handle to the face that owns the outer CCBs. - * \param h1 A circulator representing the boundary of the first component. - * \param h2 A circulator representing the boundary of the second component. - */ - virtual void after_split_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */) - {} - - /*! Notification before the splitting of an inner CCB into two. - * \param f A handle to the face containing the inner CCB. - * \param h A circulator representing the component boundary. - * \param e The new edge whose removal causes the inner CCB to split. - */ - virtual void before_split_inner_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */, - Halfedge_handle /* e */) - {} - - /*! Notification after an inner CCB was split. - * \param f A handle to the face containing the inner CCBs. - * \param h1 A circulator representing the boundary of the first component. - * \param h2 A circulator representing the boundary of the second component. - */ - virtual void after_split_inner_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */) - {} - - /*! Notification before the creation of a new outer CCB of a face. - * \param f A handle to the face that owns the outer CCB. - * \param e A halfedge along the new outer CCB. - */ - virtual void before_add_outer_ccb(Face_handle /* f */, - Halfedge_handle /* e */) - {} - - /*! Notification after an outer CCB was added to a face. - * \param h A circulator representing the boundary of the new outer CCB. - */ - virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) {} - - /*! Notification before the creation of a new inner CCB inside a face. - * \param f A handle to the face containing the inner CCB. - * \param e The new halfedge that forms the new inner CCB. - */ - virtual void before_add_inner_ccb(Face_handle /* f */, - Halfedge_handle /* e */) - {} - - /*! Notification after an inner CCB was created inside a face. - * \param h A circulator representing the boundary of the new inner CCB. - */ - virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) {} - - /*! Notification before the creation of a new isolated vertex inside a face. - * \param f A handle to the face containing the isolated vertex. - * \param v The isolated vertex. - */ - virtual void before_add_isolated_vertex(Face_handle /* f */, - Vertex_handle /* v */) - {} - - /*! Notification after an isolated vertex was created inside a face. - * \param v The isolated vertex. - */ - virtual void after_add_isolated_vertex(Vertex_handle /* v */) {} - - /*! Notification before the merging of two edges. - * \param e1 A handle to one of the halfedges forming the first edge. - * \param e2 A handle to one of the halfedges forming the second edge. - * \param c The x-monotone curve to be associated with the merged edge. - */ - virtual void before_merge_edge(Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */, - const X_monotone_curve_2& /* c */) - {} - - /*! Notification after an edge was merged. - * \param e A handle to one of the twin halfedges forming the merged edge. - */ - virtual void after_merge_edge(Halfedge_handle /* e */) {} - - /*! Notification before the merging of two fictitious edges. - * \param e1 A handle to one of the halfedges forming the first edge. - * \param e2 A handle to one of the halfedges forming the second edge. - */ - virtual void before_merge_fictitious_edge(Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - {} - - /*! Notification after a fictitious edge was merged. - * \param e A handle to one of the twin halfedges forming the merged edge. - */ - virtual void after_merge_fictitious_edge(Halfedge_handle /* e */) {} - - /*! Notification before the merging of two faces. - * \param f1 A handle to the first face. - * \param f2 A handle to the second face. - * \param e The edge whose removal causes the faces to merge. - */ - virtual void before_merge_face(Face_handle /* f1 */, - Face_handle /* f2 */, - Halfedge_handle /* e */) - {} - - /*! Notification after a face was merged. - * \param f A handle to the merged face. - */ - virtual void after_merge_face(Face_handle /* f */) {} - - /*! Notification before the merging of two outer CCBs. - * \param f A handle to the face that owns the outer CCBs. - * \param h1 A circulator representing the boundary of the first component. - * \param h2 A circulator representing the boundary of the second component. - * \param e The edge whose insertion or removal causes the CCBs to merge. - */ - virtual void before_merge_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */, - Halfedge_handle /* e */) - {} - - /*! Notification after an outer CCB was merged. - * \param f A handle to the face that owns the outer CCBs. - * \param h A circulator representing the boundary of the merged component. - */ - virtual void after_merge_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! Notification before the merging of two inner CCBs (holes). - * \param f A handle to the face that contains the inner CCBs. - * \param h1 A circulator representing the boundary of the first component. - * \param h2 A circulator representing the boundary of the second component. - * \param e The edge whose insertion causes the inner CCBs to merge. - */ - virtual void before_merge_inner_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */, - Halfedge_handle /* e */) - {} - - /*! Notification after an inner CCB was merged. - * \param f A handle to the face that contains the inner CCBs. - * \param h A circulator representing the boundary of the merged component. - */ - virtual void after_merge_inner_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! Notification before an outer CCB is moved from one face to another. - * \param from_f A handle to the face that currently owns the outer CCB. - * \param to_f A handle to the face that should own the outer CCB. - * \param h A circulator representing the boundary of the component. - */ - virtual void before_move_outer_ccb(Face_handle /* from_f */, - Face_handle /* to_f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! Notification after an outer CCB is moved from one face to another. - * \param h A circulator representing the boundary of the component. - */ - virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) {} - - - /*! Notification before an inner CCB is moved from one face to another. - * \param from_f A handle to the face currently containing the inner CCB. - * \param to_f A handle to the face that should contain the inner CCB. - * \param h A circulator representing the boundary of the component. - */ - virtual void before_move_inner_ccb(Face_handle /* from_f */, - Face_handle /* to_f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! - * Notification after an inner CCB is moved from one face to another. - * \param h A circulator representing the boundary of the component. - */ - virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) {} - - /*! Notification before an isolated vertex is moved from one face to another. - * \param from_f A handle to the face currently containing the vertex. - * \param to_f A handle to the face that should contain the vertex. - * \param v The isolated vertex. - */ - virtual void before_move_isolated_vertex(Face_handle /* from_f */, - Face_handle /* to_f */, - Vertex_handle /* v */) - {} - - /*! Notification after an isolated vertex is moved from one face to another. - * \param v The isolated vertex. - */ - virtual void after_move_isolated_vertex(Vertex_handle /* v */) {} - - /*! Notificaion before the removal of a vertex. - * \param v A handle to the vertex to be deleted. - */ - virtual void before_remove_vertex(Vertex_handle /* v */) {} - - /*! Notificaion after the removal of a vertex. */ - virtual void after_remove_vertex() {} - - /*! Notification before the removal of an edge. - * \param e A handle to one of the twin halfedges to be deleted. - */ - virtual void before_remove_edge(Halfedge_handle /* e */) {} - - /*! Notificaion after the removal of an edge. */ - virtual void after_remove_edge() {} - - /*! Notification before the removal of an outer CCB. - * \param f The face that owns the outer CCB. - * \param h A circulator representing the boundary of the component. - */ - virtual void before_remove_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! Notificaion after the removal of an outer CCB. - * \param f The face that used to own the outer CCB. - */ - virtual void after_remove_outer_ccb(Face_handle /* f */) {} - - /*! Notification before the removal of an inner CCB. - * \param f The face containing the inner CCB. - * \param h A circulator representing the boundary of the component. - */ - virtual void before_remove_inner_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - {} - - /*! Notificaion after the removal of an inner CCB. - * \param f The face that used to contain the inner CCB. - */ - virtual void after_remove_inner_ccb(Face_handle /* f */) {} - - //@} -}; - -} //namespace CGAL +} // namespace CGAL #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index 98e0f1742fd..91ac2394e39 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -21,7 +21,6 @@ * Definition of the Arr_triangulation_point_location template. */ -#include #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index f99be868ac0..108600caec2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -109,10 +109,10 @@ public: typedef typename Topology_traits::Dcel Dcel; typedef typename Dcel::Size Size; - typedef Arr_observer Observer; + typedef Aos_observer Observer; protected: - friend class Arr_observer; + friend class Aos_observer; friend class Arr_accessor; // Internal DCEL types: diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h index ad1413f9f1c..6b59905c8d7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h @@ -272,7 +272,7 @@ protected: * involving edges and updates the list of halfedges associated with the * input curves accordingly. */ - class Curve_halfedges_observer : public Arr_observer { + class Curve_halfedges_observer : public Base_arr_2::Observer { public: typedef typename Base_arr_2::Halfedge_handle Halfedge_handle; diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index d5e118bf8d7..413559ace7e 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index 72465c5c97f..63f59bba6ec 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -102,7 +102,7 @@ private: : Base(const_cast(arr)), has_changed(false) {} - // Arr_observer interface + // Aos_observer interface void after_attach() { has_changed = false; } From 6089c485a1493fb4ad2e7eda2914b4151d687ae1 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Tue, 12 Dec 2023 03:06:19 +0200 Subject: [PATCH 13/95] Added the description of Arr_observer --- .../Arrangement_on_surface_2.txt | 6 ++-- .../CGAL/Aos_observer.h | 2 +- .../CGAL/Arr_observer.h | 36 ++++++------------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 622492d43d8..505576d9024 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -5719,9 +5719,9 @@ its base type. An instance of `Aos_observer<>` serves as a base type for other observer classes and defines a set of virtual notification functions, with default empty implementations. You can also use the template alias `Arr_observer`, where `Arrangement_2` is -the type of the arrangement object in case it is derived from -`Arrangement_on_surface_2`. The set of functions can be divided into -three categories, as follows: +the type of the arrangement object in case it is derived from an +instance of the template `Arrangement_on_surface_2`. The set of +functions can be divided into three categories, as follows:
      diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h index 8ae211dbe5a..5b99967ba77 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h @@ -2,7 +2,7 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref * - * \anchor arr_refarr_obs + * \anchor arr_refaos_obs * * `Aos_observer` serves as an abstract base class for all observer classes that * are attached to an arrangement instance of type `Arrangement` and receive diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index 092a1b55732..d3870fc69ea 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -1,33 +1,17 @@ // Copyright (c) 2023 Tel-Aviv University (Israel). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s): Efi Fogel - -#ifndef CGAL_ARR_OBSERVER_H -#define CGAL_ARR_OBSERVER_H - -/*! \file - * Definition of the Arr_observer base class mainly for backward compatibility. - */ - -#include - -#include - namespace CGAL { +/*! \ingroup PkgArrangementOnSurface2Ref + * + * \anchor arr_refarr_obs + * + * `Arr_observer` is an alias for Aos_observer`, + * where `Arrangement_2` derives from `Arrangement_on_surface_2` and the latter is an + * instance of the template + * `CGAL::Arrangement_on_surface_2`. + */ + template using Arr_observer = typename Arrangement_::Observer; } // namespace CGAL - -#include - -#endif From 615850c4a6e4fa580671955a5da341998d80bd59 Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 13 Dec 2023 13:41:51 +0200 Subject: [PATCH 14/95] Cleaned up --- .../CGAL/Aos_observer.h | 145 ++++++++++-------- .../CGAL/Arr_observer.h | 7 +- .../include/CGAL/Aos_observer.h | 30 ++-- .../include/CGAL/Arr_observer.h | 3 +- 4 files changed, 97 insertions(+), 88 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h index 5b99967ba77..eb3efa4af84 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h @@ -6,7 +6,7 @@ namespace CGAL { * * `Aos_observer` serves as an abstract base class for all observer classes that * are attached to an arrangement instance of type `Arrangement` and receive - * notifications from the arrangement. This base class handles the attachment + * notifications from the arrangement. This base class handles the attachment * of the observer to a given arrangement instance or to the detachment of the * observer from this arrangement instance. It also gives a default empty * implementation to all notification functions that are invoked by the @@ -27,22 +27,22 @@ public: /// \name Types /// @{ - /*! the type of the associated arrangement. */ + //! the type of the associated arrangement. typedef unspecified_type Arrangement_2; - /*! the point type. */ + //! the point type. typedef typename Arrangement_2::Point_2 Point_2; - /*! the \f$ x\f$-monotone curve type. */ + //! the \f$x\f$-monotone curve type. typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - /*! */ + //! the type of a handle to an arrangement vertex. typedef typename Arrangement_2::Vertex_handle Vertex_handle; - /*! */ + //! the type of a handle to an arrangement halfedge. typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - /*! */ + //! the type of a handle to an arrangement face. typedef typename Arrangement_2::Face_handle Face_handle; /*! represents a connected component of the boundary (CCB), either an outer @@ -77,13 +77,13 @@ public: /// \name Notifications on Global Arrangement Operations /// @{ - /*! issued just before the attached arrangement is assigned with the contents of - * another arrangement `arr`. + /*! issued just before the attached arrangement is assigned with the contents + * of another arrangement `arr`. */ virtual void before_assign(const Arrangement_2& arr); - /*! issued immediately after the attached arrangement has been assigned with the - * contents of another arrangement. + /*! issued immediately after the attached arrangement has been assigned with + * the contents of another arrangement. */ virtual void after_assign(); @@ -97,8 +97,8 @@ public: /*! issued just before a global function starts to modify the attached * arrangement. It is guaranteed that no queries (especially no point-location - * queries) are issued until the termination of the global function is indicated - * by `after_global_change()`. + * queries) are issued until the termination of the global function is + * indicated by `after_global_change()`. */ virtual void before_global_change(); @@ -115,6 +115,7 @@ public: /*! issued just before the observer is attached to the arrangement instance * `arr`. + * \param arr The arrangement that is about to attach the observer. */ virtual void before_attach(const Arrangement_2& arr); @@ -127,8 +128,8 @@ public: */ virtual void before_detach(); - /*! issued immediately after the observer has been detached from its arrangement - * instance. + /*! issued immediately after the observer has been detached from its + * arrangement instance. */ virtual void after_detach(); @@ -142,34 +143,35 @@ public: */ virtual void before_create_vertex(const Point_2& p); - /*! issued immediately after a new vertex `v` has been created. Note that the + /*! issued immediately after a new vertex `v` has been created. Note that the * vertex still has no incident edges and is not connected to any other vertex. */ virtual void after_create_vertex(Vertex_handle v); /*! issued just before a new vertex at infinity is created, `cv` is the curve - * incident to the surface boundary, `ind` is the relevant curve-end, `ps_x` is - * the boundary condition of the vertex in \f$ x\f$ and `ps_y` is the boundary - * condition of the vertex in \f$ y\f$. + * incident to the surface boundary, `ind` is the relevant curve-end, `ps_x` + * is the boundary condition of the vertex in \f$x\f$ and `ps_y` is the + * boundary condition of the vertex in \f$y\f$. */ virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv, Arr_curve_end ind, Arr_parameter_space ps_x, Arr_parameter_space ps_y); - /*! issued immediately after a new vertex `v` has been created. Note that the + /*! issued immediately after a new vertex `v` has been created. Note that the * vertex still has no incident edges and is not connected to any other vertex. */ virtual void after_create_boundary_vertex(Vertex_handle v); - /*! issued just before a new edge that corresponds to the \f$ x\f$-monotone + /*! issued just before a new edge that corresponds to the \f$x\f$-monotone * curve `c` and connects the vertices `v1` and `v2` is created. */ virtual void before_create_edge(const X_monotone_curve_2& c, Vertex_handle v1, Vertex_handle v2); - /*! issued immediately after a new edge `e` has been created. The halfedge that - * is sent to this function is always directed from `v1` to `v2` (see above). + /*! issued immediately after a new edge `e` has been created. The halfedge + * that is sent to this function is always directed from `v1` to `v2` (see + * `before_create_edge()`). */ virtual void after_create_edge(Halfedge_handle e); @@ -181,16 +183,17 @@ public: /*! issued immediately after an existing vertex `v` has been modified. */ virtual void after_modify_vertex(Vertex_handle v); - /*! issued just before an edge `e` is modified to be associated with the \f$ - * x\f$-monotone curve `c`. + /*! issued just before an edge `e` is modified to be associated with the + * \f$x\f$-monotone curve `c`. */ - virtual void before_modify_edge(Halfedge_handle e, const X_monotone_curve_2& c); + virtual void before_modify_edge(Halfedge_handle e, + const X_monotone_curve_2& c); /*! issued immediately after an existing edge `e` has been modified. */ virtual void after_modify_edge(Halfedge_handle e); /*! issued just before an edge `e` is split into two edges that should be - * associated with the \f$ x\f$-monotone curves `c1` and `c2`. The vertex `v` + * associated with the \f$x\f$-monotone curves `c1` and `c2`. The vertex `v` * corresponds to the split point, and will be used to separate the two * resulting edges. */ @@ -198,76 +201,77 @@ public: const X_monotone_curve_2& c1, const X_monotone_curve_2& c2); - /*! issued immediately after an existing edge has been split into the two given - * edges `e1` and `e2`. + /*! issued immediately after an existing edge has been split into the two + * given edges `e1` and `e2`. */ virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2); /*! issued just before a fictitious edge `e` is split into two. The vertex at - * infinity `v` corresponds to the split point, and will be used to separate the - * two resulting edges. + * infinity `v` corresponds to the split point, and will be used to separate + * the two resulting edges. */ virtual void before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v); - /*! issued immediately after an existing fictitious edge has been split into the - * two given fictitious edges `e1` and `e2`. + /*! issued immediately after an existing fictitious edge has been split into + * the two given fictitious edges `e1` and `e2`. */ - virtual void after_split_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2); + virtual void after_split_fictitious_edge(Halfedge_handle e1, + Halfedge_handle e2); /*! issued just before a face `f` is split into two, as a result of the * insertion of the edge `e` into the arrangement. */ virtual void before_split_face(Face_handle f, Halfedge_handle e); - /*! issued immediately after the existing face `f1` has been split, such that a - * portion of it now forms a new face `f2`. The flag `is_hole` designates + /*! issued immediately after the existing face `f1` has been split, such that + * a portion of it now forms a new face `f2`. The flag `is_hole` designates * whether `f2` forms a hole (an inner CCB) inside `f1`. */ virtual void after_split_face(Face_handle f1, Face_handle f2, bool is_hole); - /*! issued just before outer ccb `h` inside a face `f` is split into two, as a + /*! issued just before outer CCB `h` inside a face `f` is split into two, as a * result of the removal of the edge `e` from the arrangement. */ virtual void before_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h, Halfedge_handle e); - /*! issued immediately after an outer ccb of the face `f` has been split, + /*! issued immediately after an outer CCB of the face `f` has been split, * resulting in the two holes `h1` and `h2`. */ virtual void after_split_outer_ccb(Face_handle f, Ccb_halfedge_circulator h1, Ccb_halfedge_circulator h2); - /*! issued just before an inner ccb `h` inside a face `f` is split into two, as - * a result of the removal of the edge `e` from the arrangement. + /*! issued just before an inner CCB `h` inside a face `f` is split into two, + * as a result of the removal of the edge `e` from the arrangement. */ virtual void before_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h, Halfedge_handle e); - /*! issued immediately after an inner ccb of the face `f` has been split, + /*! issued immediately after an inner CCB of the face `f` has been split, * resulting in the two inner CCBs (holes) `h1` and `h2`. */ virtual void after_split_inner_ccb(Face_handle f, Ccb_halfedge_circulator h1, Ccb_halfedge_circulator h2); - /*! issued just before the edge `e` is inserted as a new outer ccb inside the + /*! issued just before the edge `e` is inserted as a new outer CCB inside the * face `f`. */ virtual void before_add_outer_ccb(Face_handle f, Halfedge_handle e); - /*! issued immediately after a new outer ccb `h` has been created. The outer ccb - * always consists of a single pair of twin halfedges. + /*! issued immediately after a new outer ccb `h` has been created. The outer + * ccb always consists of a single pair of twin halfedges. */ virtual void after_add_outer_ccb(Ccb_halfedge_circulator h); - /*! issued just before the edge `e` is inserted as a new inner ccb inside the + /*! issued just before the edge `e` is inserted as a new inner CCB inside the * face `f`. */ virtual void before_add_inner_ccb(Face_handle f, Halfedge_handle e); - /*! issued immediately after a new inner ccb `h` has been created. The inner ccb - * always consists of a single pair of twin halfedges. + /*! issued immediately after a new inner CCB `h` has been created. The inner + * CCB always consists of a single pair of twin halfedges. */ virtual void after_add_inner_ccb(Ccb_halfedge_circulator h); @@ -281,16 +285,17 @@ public: virtual void after_add_isolated_vertex(Vertex_handle v); /*! issued just before the two edges `e1` and `e2` are merged to form a single - * edge that will be associated with the \f$ x\f$-monotone curve `c`. + * edge that will be associated with the \f$x\f$-monotone curve `c`. */ virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2, const X_monotone_curve_2& c); - /*! issued immediately after two edges have been merged to form the edge `e`. */ + /*! issued immediately after two edges have been merged to form the edge `e`. + */ virtual void after_merge_edge(Halfedge_handle e); - /*! issued just before the two fictitious edges `e1` and `e2` are merged to form - * a single fictitious edge. + /*! issued just before the two fictitious edges `e1` and `e2` are merged to + * form a single fictitious edge. */ virtual void before_merge_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2); @@ -306,7 +311,8 @@ public: virtual void before_merge_face(Face_handle f1, Face_handle f2, Halfedge_handle e); - /*! issued immediately after two faces have been merged to form the face `f`. */ + /*! issued immediately after two faces have been merged to form the face `f`. + */ virtual void after_merge_face(Face_handle f); /*! issued just before two outer ccbs `h1` and `h2` inside the face `f` are @@ -318,12 +324,12 @@ public: Ccb_halfedge_circulator h2, Halfedge_handle e); - /*! issued immediately after two outer ccbs have been merged to form a single - * outer ccb `h` inside the face `f`. + /*! issued immediately after two outer cCBs have been merged to form a single + * outer CCB `h` inside the face `f`. */ virtual void after_merge_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); - /*! issued just before two inner ccbs `h1` and `h2` inside the face `f` are + /*! issued just before two inner CCBs `h1` and `h2` inside the face `f` are * merged to form a single connected component, following the insertion of the * edge `e` into the arrangement. */ @@ -332,33 +338,35 @@ public: Ccb_halfedge_circulator h2, Halfedge_handle e); - /*! issued immediately after two inner ccbs have been merged to form a single - * inner ccb `h` inside the face `f`. + /*! issued immediately after two inner CCBs have been merged to form a single + * inner CCB `h` inside the face `f`. */ virtual void after_merge_inner_ccb(Face_handle f, Ccb_halfedge_circulator h); - /*! issued just before the outer ccb `h` is moved from one face to another. - * This can happen if the face `to_f` containing the outer ccb has just been + /*! issued just before the outer CCB `h` is moved from one face to another. + * This can happen if the face `to_f` containing the outer CCB has just been * split from `from_f`. */ virtual void before_move_outer_ccb(Face_handle from_f, Face_handle to_f, Ccb_halfedge_circulator h); - /*! issued immediately after the outer ccb `h` has been moved to a new face. */ + /*! issued immediately after the outer CCB `h` has been moved to a new face. + */ virtual void after_move_outer_ccb(Ccb_halfedge_circulator h); - /*! issued just before the inner ccb `h` is moved from one face to another. - * This can happen if the face `to_f` containing the inner ccb has just been + /*! issued just before the inner CCB `h` is moved from one face to another. + * This can happen if the face `to_f` containing the inner CCB has just been * split from `from_f`. */ virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f, Ccb_halfedge_circulator h); - /*! issued immediately after the inner ccb `h` has been moved to a new face. */ + /*! issued immediately after the inner CCB `h` has been moved to a new face. + */ virtual void after_move_inner_ccb(Ccb_halfedge_circulator h); /*! issued just before the isolated vertex `v` is moved from one face to - * another. This can happen if the face `to_f` containing the isolated vertex + * another. This can happen if the face `to_f` containing the isolated vertex * has just been split from `from_f`. */ virtual void before_move_isolated_vertex(Face_handle from_f, @@ -385,20 +393,21 @@ public: */ virtual void after_remove_edge(); - /*! issued just before the outer ccb `f` is removed from inside the face `f`. */ + /*! issued just before the outer ccb `f` is removed from inside the face `f`. + */ virtual void before_remove_outer_ccb(Face_handle f, Ccb_halfedge_circulator h); - /*! issued immediately after a outer ccb has been removed (and deleted) from + /*! issued immediately after a outer CCB has been removed (and deleted) from * inside the face `f`. */ virtual void after_remove_outer_ccb(Face_handle f); - /*! issued just before the inner ccb `f` is removed from inside the face `f`. + /*! issued just before the inner CCB `f` is removed from inside the face `f`. */ virtual void before_remove_inner_ccb(Face_handle f, Ccb_halfedge_circulator h); - /*! issued immediately after a inner ccb has been removed (and deleted) from + /*! issued immediately after a inner CCB has been removed (and deleted) from * inside the face `f`. */ virtual void after_remove_inner_ccb(Face_handle f); diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index d3870fc69ea..2c41b89f7a8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -5,9 +5,10 @@ namespace CGAL { * * \anchor arr_refarr_obs * - * `Arr_observer` is an alias for Aos_observer`, - * where `Arrangement_2` derives from `Arrangement_on_surface_2` and the latter is an - * instance of the template + * `Arr_observer` is an alias for + * Aos_observer`, + * where `Arrangement_2` derives from `Arrangement_on_surface_2` and the latter + * is an instance of the template * `CGAL::Arrangement_on_surface_2`. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Aos_observer.h b/Arrangement_on_surface_2/include/CGAL/Aos_observer.h index d74034640e2..6f918138c66 100644 --- a/Arrangement_on_surface_2/include/CGAL/Aos_observer.h +++ b/Arrangement_on_surface_2/include/CGAL/Aos_observer.h @@ -21,7 +21,7 @@ #include /*! \file - * Definition of the Aos_observer base class. + * Definition of the `Aos_observer` base class. */ namespace CGAL { @@ -31,8 +31,7 @@ namespace CGAL { * The Arrangement parameter corresponds to an arrangement instantiation. */ template -class Aos_observer -{ +class Aos_observer { public: typedef Arrangement_ Arrangement_2; typedef Aos_observer Self; @@ -44,7 +43,7 @@ public: typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; + Ccb_halfedge_circulator; private: Arrangement_2* p_arr; // The associated arrangement. @@ -81,7 +80,7 @@ public: /// \name Modifying the associated arrangement. //@{ - /*! Get the associated arrangement (non-const version). */ + /*! Get the associated arrangement (const version). */ const Arrangement_2* arrangement() const { return (p_arr); } /*! Get the associated arrangement (non-const version). */ @@ -160,7 +159,7 @@ public: //@{ /*! Notification before the observer is attached to an arrangement. - * \param arr The arrangement we are about to attach the observer to. + * \param arr The arrangement that is about to attach the observer. */ virtual void before_attach(const Arrangement_2& /* arr */) {} @@ -170,17 +169,16 @@ public: /*! Notification before the observer is detached from the arrangement. */ virtual void before_detach() {} - /*! Notification after the observer has been detached to the arrangement. */ + /*! Notification after the observer has been detached from the arrangement. */ virtual void after_detach() {} //@} /// \name Notification functions on local changes in the arrangement. //@{ - /*! - * Notification before the creation of a new vertex. + /*! Notification before the creation of a new vertex. * \param p The point to be associated with the vertex. - * This point cannot lies on the surface boundaries. + * This point cannot lie on the surface boundaries. */ virtual void before_create_vertex(const Point_2& /* p */) {} @@ -191,7 +189,7 @@ public: {} /*! Notification before the creation of a new boundary vertex. - * \param p The on the surface boundary. + * \param p The point on the surface boundary. * \param ps_x The boundary condition of the vertex in x. * \param ps_y The boundary condition of the vertex in y. */ @@ -218,7 +216,7 @@ public: virtual void after_create_boundary_vertex(Vertex_handle /* v */) {} /*! Notification before the creation of a new edge. - * \param c The x-monotone curve to be associated with the edge. + * \param c The \f$x\f$-monotone curve to be associated with the edge. * \param v1 A handle to the first end-vertex of the edge. * \param v2 A handle to the second end-vertex of the edge. */ @@ -247,7 +245,7 @@ public: /*! Notification before the modification of an existing edge. * \param e A handle to one of the twin halfedges to be updated. - * \param c The x-monotone curve to be associated with the edge. + * \param c The \f$x\f$-monotone curve to be associated with the edge. */ virtual void before_modify_edge(Halfedge_handle /* e */, const X_monotone_curve_2& /* c */) @@ -261,8 +259,8 @@ public: /*! Notification before the splitting of an edge into two. * \param e A handle to one of the existing halfedges. * \param v A vertex representing the split point. - * \param c1 The x-monotone curve to be associated with the first edge. - * \param c2 The x-monotone curve to be associated with the second edge. + * \param c1 The \f$x\f$-monotone curve to be associated with the first edge. + * \param c2 The \f$x\f$-monotone curve to be associated with the second edge. */ virtual void before_split_edge(Halfedge_handle /* e */, Vertex_handle /* v */, @@ -394,7 +392,7 @@ public: /*! Notification before the merging of two edges. * \param e1 A handle to one of the halfedges forming the first edge. * \param e2 A handle to one of the halfedges forming the second edge. - * \param c The x-monotone curve to be associated with the merged edge. + * \param c The \f$x\f$-monotone curve to be associated with the merged edge. */ virtual void before_merge_edge(Halfedge_handle /* e1 */, Halfedge_handle /* e2 */, diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h index 092a1b55732..1e0791ed05a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h @@ -14,7 +14,8 @@ #define CGAL_ARR_OBSERVER_H /*! \file - * Definition of the Arr_observer base class mainly for backward compatibility. + * Definition of the `Arr_observer` base class mainly for backward + * compatibility. */ #include From 0ec51c5110c7640439b36837b12c6448377726cc Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 13 Dec 2023 13:49:14 +0200 Subject: [PATCH 15/95] Cleaned up --- .../doc/Arrangement_on_surface_2/CGAL/Arr_observer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index 2c41b89f7a8..a248556f650 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -1,4 +1,3 @@ -// Copyright (c) 2023 Tel-Aviv University (Israel). namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref From eaa0091bfd1ac862ec7db9920d55191ed5e5215b Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 13 Dec 2023 15:42:44 +0200 Subject: [PATCH 16/95] Added an item that describes a fix in the 2D Arrangements package that has to do with observers --- Installation/CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index d802f740b9b..9dde0d222c3 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -23,6 +23,8 @@ Release date: October 2023 `std::variant`. The support for the old macro `CGAL_ARR_POINT_LOCATION_VERSION` has been removed. +- Eliminated the error-prone c-type casting that was used to define observers. In general, backward compatibility was maintained; however, the former class template `Arr_observer` was replaced by an alias template. (The former class Arr_observer was renamed to Aos_observer). + #### Envelopes of Surfaces in 3D - **Breaking change**: Construct_projected_boundary_2 in `EnvelopeTraits_3` is now using `std::variant` instead of `Object` From c6a21e9f983c47895222fabb3937331eaf42cafb Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 14 Dec 2023 21:17:29 +0200 Subject: [PATCH 17/95] Fixed the definition of the memebrs before_assign(arr) before_attach(arr) of all observers (derived from Aos_observer) --- .../CGAL/Aos_observer.h | 16 +++++++++----- .../Arr_lm_generator_base.h | 16 +++++++------- .../Trapezoidal_decomposition_2.h | 5 +++-- .../CGAL/Arr_trapezoid_ric_point_location.h | 21 ++++++++++++++----- .../include/CGAL/Arrangement_on_surface_2.h | 3 ++- .../test_observer.cpp | 16 +++++++------- 6 files changed, 49 insertions(+), 28 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h index eb3efa4af84..2f21f4a886c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Aos_observer.h @@ -77,10 +77,13 @@ public: /// \name Notifications on Global Arrangement Operations /// @{ - /*! issued just before the attached arrangement is assigned with the contents - * of another arrangement `arr`. + /*! issued just before the attached arrangement is assigned with the contents of another + * arrangement. + * \param arr The other arrangement. Notice that the arrangement type is the type used to + * instantiate the observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. */ - virtual void before_assign(const Arrangement_2& arr); + virtual void before_assign(const typename Arrangement_2::Base_aos& arr); /*! issued immediately after the attached arrangement has been assigned with * the contents of another arrangement. @@ -115,9 +118,12 @@ public: /*! issued just before the observer is attached to the arrangement instance * `arr`. - * \param arr The arrangement that is about to attach the observer. + * \param arr The arrangement that is about to attach the observer. Notice + * that the arrangement type is the type used to instantiate the + * observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. */ - virtual void before_attach(const Arrangement_2& arr); + virtual void before_attach(const typename Arrangement_2::Base_aos& arr); /*! issued immediately after the observer has been attached to an arrangement * instance. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h index 07cf7520a13..5e573527334 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h @@ -45,7 +45,9 @@ template > class Arr_landmarks_generator_base : public Arrangement_::Observer { public: - typedef Arrangement_ Arrangement_2; + using Arrangement_2 = Arrangement_; + using Base_aos = typename Arrangement_2::Base_aos; + typedef Nearest_neighbor_ Nearest_neighbor; typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; @@ -161,13 +163,13 @@ public: /// \name Overloaded observer functions on global changes. //@{ - /*! - * Notification before the arrangement is assigned with another + /*! Notification before the arrangement is assigned with the content of another * arrangement. - * \param arr The arrangement to be copied. + * \param arr The other arrangement. Notice that the arrangement type is the type used to + * instantiate the observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. */ - virtual void before_assign(const Arrangement_2& arr) - { + virtual void before_assign(const Base_aos& arr) { this->clear_landmark_set(); m_traits = static_cast(arr.geometry_traits()); m_ignore_notifications = true; @@ -185,7 +187,7 @@ public: /*! Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ - virtual void before_attach(const Arrangement_2& arr) + virtual void before_attach(const Base_aos& arr) { this->clear_landmark_set(); m_traits = static_cast(arr.geometry_traits()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 1a3549c0008..82b554cb6a0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -177,6 +177,7 @@ public: //typedef of arrangement on surface typedef typename Traits::Arrangement_on_surface_2 Arrangement_on_surface_2; + using Base_aos = typename Arrangement_on_surface_2::Base_aos; //type of traits adaptor typedef typename Traits::Arrangement_on_surface_2::Traits_adaptor_2 @@ -1804,7 +1805,7 @@ public: return m_number_of_curves; } - void init_arrangement_and_traits(const Arrangement_on_surface_2* arr, + void init_arrangement_and_traits(const Base_aos* arr, bool allocate_traits = true) { m_arr = arr; @@ -2125,7 +2126,7 @@ protected: unsigned long m_number_of_curves; const Traits* traits; //Before_split_data m_before_split; - const Arrangement_on_surface_2* m_arr; + const Base_aos* m_arr; const Traits_adaptor_2* m_trts_adaptor; Halfedge_const_handle m_empty_he_handle; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index d04136967ba..91739414dcb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -38,7 +38,8 @@ template class Arr_trapezoid_ric_point_location : public Arrangement_::Observer { public: //type of arrangement on surface - typedef Arrangement_ Arrangement_on_surface_2; + using Arrangement_on_surface_2 = Arrangement_; + using Base_aos = typename Arrangement_on_surface_2::Base_aos; //type of geometry traits typedef typename Arrangement_on_surface_2::Geometry_traits_2 @@ -238,8 +239,13 @@ public: // base observer. //@{ - virtual void before_assign (const Arrangement_on_surface_2& arr) - { + /*! Notification before the arrangement is assigned with the content of another + * arrangement. + * \param arr The other arrangement. Notice that the arrangement type is the type used to + * instantiate the observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. + */ + virtual void before_assign(const Base_aos& arr) { td.clear(); m_traits = static_cast (arr.geometry_traits()); td.init_arrangement_and_traits(&arr, false); @@ -260,8 +266,13 @@ public: _construct_td(); } - virtual void before_attach (const Arrangement_on_surface_2& arr) - { + /*! Notification before the observer is attached to an arrangement. + * \param arr The arrangement that is about to attach the observer. Notice + * that the arrangement type is the type used to instantiate the + * observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. + */ + virtual void before_attach(const Base_aos& arr) { td.clear(); m_traits = static_cast (arr.geometry_traits()); td.init_arrangement_and_traits(&arr); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index 108600caec2..92c3e9ba698 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -109,7 +109,8 @@ public: typedef typename Topology_traits::Dcel Dcel; typedef typename Dcel::Size Size; - typedef Aos_observer Observer; + using Observer = Aos_observer; + using Base_aos = Self; protected: friend class Aos_observer; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp index bc03ddc0957..c095d9c2507 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp @@ -59,21 +59,21 @@ void compare_results(std::string str) class Test_observer : public Arrangement_2::Observer { public: + using Base_aos = typename Arrangement_2::Base_aos; Test_observer(Arrangement_2& arr) : Arrangement_2::Observer(arr) {} /// \name Notification functions on global arrangement operations. //@{ - /*! - * Notification before the arrangement is assigned with another + /*! Notification before the arrangement is assigned with the content of another * arrangement. - * \param arr The arrangement to be copied. + * \param arr The other arrangement. Notice that the arrangement type is the type used to + * instantiate the observer, which is conveniently defined as + * `Arrangement_2::Base_aos`. */ - virtual void before_assign (const Arrangement_2& /* arr */) - { - compare_results("before_assign"); - } + virtual void before_assign (const Base_aos& /* arr */) + { compare_results("before_assign"); } /*! * Notification after the arrangement has been assigned with another @@ -118,7 +118,7 @@ public: * Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ - virtual void before_attach (const Arrangement_2& /* arr */) + virtual void before_attach (const Base_aos& /* arr */) { compare_results("before_attach"); } From 6b90164b554e29e125b6934a857904fb3e4ea24e Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 20 Dec 2023 22:09:34 +0200 Subject: [PATCH 18/95] Fixed the types used in all arrangement observers --- .../CGAL/Arr_face_index_map.h | 106 ++- .../CGAL/Arr_triangulation_point_location.h | 3 +- .../CGAL/Arr_vertex_index_map.h | 106 ++- .../include/CGAL/Arr_face_index_map.h | 181 ++--- .../Arr_lm_generator_base.h | 158 ++-- .../CGAL/Arr_trapezoid_ric_point_location.h | 293 +++----- .../CGAL/Arr_triangulation_point_location.h | 158 ++-- .../include/CGAL/Arr_vertex_index_map.h | 201 ++--- .../Arrangement_on_surface_with_history_2.h | 108 +-- .../test_observer.cpp | 686 +++++++----------- .../Envelope_divide_and_conquer_3.h | 58 +- .../Envelope_3/Envelope_element_visitor_3.h | 246 +++---- .../CGAL/Polygon_vertical_decomposition_2.h | 7 +- .../CGAL/Triangular_expansion_visibility_2.h | 110 +-- 14 files changed, 984 insertions(+), 1437 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h index 4c48eb10207..21f071f4596 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_face_index_map.h @@ -1,75 +1,69 @@ namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2Ref + /*! \ingroup PkgArrangementOnSurface2Ref + * + * `Arr_face_index_map` maintains a mapping of face handles of an attached + * arrangement object to indices (of type `unsigned int`). This class template + * is a model of the concept `ReadablePropertyMap`. A mapping between face + * handles and indices enables convenient usage of property-map classes supplied + * by `boost`. For example, the property-map class templates + * `boost::vector_property_map`, which is based on `std::vector`, and + * `boost::iterator_property_map`, which can be used to implement a property map + * based on a native \CC array, require the user to supply a mapping such as + * `Arr_face_index_map`. + * + * As new faces might be inserted into the attached arrangement, and + * existing faces might be removed, the notification mechanism is used + * to dynamically maintain the mapping of face handles to indices. + * + * \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} + * + * \sa `Arr_vertex_index_map` + */ -`Arr_face_index_map` maintains a mapping of face handles of an -attached arrangement object to indices (of type `unsigned int`). -This class template is a model of the concept -`ReadablePropertyMap`. A mapping between face handles and indices -enables convenient usage of property-map classes supplied by `boost`. -For example, the property-map class templates -`boost::vector_property_map`, which is based on `std::vector`, -and `boost::iterator_property_map`, which can be used to implement -a property map based on a native \CC array, require the -user to supply a mapping such as `Arr_face_index_map`. + template + class Arr_face_index_map: public Arrangement_::Observer { + public: -As new faces might be inserted into the attached arrangement, and -existing faces might be removed, the notification mechanism is used -to dynamically maintain the mapping of face handles to indices. + /// \name Types + /// @{ + /*! the type of the attached arrangement. + */ + typedef Arrangement_ Arrangement_2; + typedef typename Arrangement_2::Base_aos Base_aos; -\cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} + typedef boost::readable_property_map_tag category; -\sa `Arr_vertex_index_map` -*/ + typedef unsigned int value_type; -template< typename Arrangement > -class Arr_face_index_map: public Arrangement::Observer { -public: + typedef unsigned int reference; -/// \name Types -/// @{ + typedef Face_handle key_type; -/*! -the type of the attached arrangement. -*/ -typedef Arrangement Arrangement_2; + /*! The face handle type. + */ + typedef typename Base_aos::Face_handle Face_handle; -typedef boost::readable_property_map_tag category; + /*! The type of mapping of faces to indices. + */ + typedef Unique_hash_map Index_map; -typedef unsigned int value_type; + /// @} -typedef unsigned int reference; + /// \name Creation + /// @{ -typedef Face_handle key_type; + /*! constructs a map that is unattached to any arrangement instance. + */ + Arr_face_index_map(); -/*! -The face handle type. -*/ -typedef typename Arrangement_2::Face_handle Face_handle; + /*! constructs a map and attaches it to the given arrangement `arr`. + */ + Arr_face_index_map(Base_aos& arr); -/*! -The type of mapping of faces to indices. -*/ -typedef Unique_hash_map Index_map; + /// @} -/// @} + }; /* end Arr_accessor */ -/// \name Creation -/// @{ - -/*! -constructs a map that is unattached to any arrangement instance. -*/ -Arr_face_index_map(); - -/*! -constructs a map and attaches it to the given arrangement `arr`. -*/ -Arr_face_index_map(Arrangement_2& arr); - -/// @} - -}; /* end Arr_accessor */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h index 2bd83d5a125..f0799d553be 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_triangulation_point_location.h @@ -1,7 +1,6 @@ namespace CGAL { -/*! - * \ingroup PkgArrangementOnSurface2PointLocation +/*! \ingroup PkgArrangementOnSurface2PointLocation * * \anchor arr_reftri_pl * diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h index af17eafb8a7..e5bb1449dbf 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_vertex_index_map.h @@ -1,75 +1,69 @@ namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2Ref + /*! \ingroup PkgArrangementOnSurface2Ref + * + * `Arr_vertex_index_map` maintains a mapping of vertex handles of an attached + * arrangement object to indices (of type `unsigned int`). This class template + * is a model of the concept `ReadablePropertyMap`. A mapping between vertex + * handles and indices enables convenient usage of property-map classes supplied + * by `boost`. For example, the property-map class templates + * `boost::vector_property_map`, which is based on `std::vector`, and + * `boost::iterator_property_map`, which can be used to implement a property map + * based on a native \CC array, require the user to supply a mapping such as + * `Arr_vertex_index_map`. + * + * As new vertices might be inserted into the attached arrangement, and + * existing vertices might be removed, the notification mechanism is used + * to dynamically maintain the mapping of vertex handles to indices. + * + * \cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} + * + * \sa `Arr_face_index_map` + */ -`Arr_vertex_index_map` maintains a mapping of vertex handles of an -attached arrangement object to indices (of type `unsigned int`). -This class template is a model of the concept -`ReadablePropertyMap`. A mapping between vertex handles and indices -enables convenient usage of property-map classes supplied by `boost`. -For example, the property-map class templates -`boost::vector_property_map`, which is based on `std::vector`, -and `boost::iterator_property_map`, which can be used to implement -a property map based on a native \CC array, require the -user to supply a mapping such as `Arr_vertex_index_map`. + template< typename Arrangement_> + class Arr_vertex_index_map: public Arrangement_::Observer { + public: -As new vertices might be inserted into the attached arrangement, and -existing vertices might be removed, the notification mechanism is used -to dynamically maintain the mapping of vertex handles to indices. + /// \name Types + /// @{ + /*! the type of the attached arrangement. + */ + typedef Arrangement_ Arrangement_2; + typedef typename Arrangement_2::Base_aos Base_aos; -\cgalModels{DefaultConstructible,CopyConstructible,Assignable,ReadablePropertyMap} + typedef boost::readable_property_map_tag category; -\sa `Arr_face_index_map` -*/ + typedef unsigned int value_type; -template< typename Arrangement > -class Arr_vertex_index_map: public Arrangement::Observer { -public: + typedef unsigned int reference; -/// \name Types -/// @{ + typedef Vertex_handle key_type; -/*! -the type of the attached arrangement. -*/ -typedef Arrangement Arrangement_2; + /*! The vertex handle type. + */ + typedef typename Base_aos::Vertex_handle Vertex_handle; -typedef boost::readable_property_map_tag category; + /*! The type of mapping of vertices to indices. + */ + typedef Unique_hash_map Index_map; -typedef unsigned int value_type; + /// @} -typedef unsigned int reference; + /// \name Creation + /// @{ -typedef Vertex_handle key_type; + /*! constructs a map that is unattached to any arrangement instance. + */ + Arr_vertex_index_map(); -/*! -The vertex handle type. -*/ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; + /*! constructs a map and attaches it to the given arrangement `arr`. + */ + Arr_vertex_index_map(Base_aos& arr); -/*! -The type of mapping of vertices to indices. -*/ -typedef Unique_hash_map Index_map; + /// @} -/// @} + }; /* end Arr_accessor */ -/// \name Creation -/// @{ - -/*! -constructs a map that is unattached to any arrangement instance. -*/ -Arr_vertex_index_map(); - -/*! -constructs a map and attaches it to the given arrangement `arr`. -*/ -Arr_vertex_index_map(Arrangement_2& arr); - -/// @} - -}; /* end Arr_accessor */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h index 3fb3915b65a..ee804c574c5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h @@ -33,139 +33,110 @@ namespace CGAL { * arrangement faces to the indices 0, ..., (n -1), where n is the number * of faces in the arrangement. */ -template +template class Arr_face_index_map : public Arrangement_::Observer { public: + using Arrangement_2 = Arrangement_; + using Base_aos = typename Arrangement_2::Base_aos; - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Face_handle Face_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using Face_handle = typename Base_aos::Face_handle; // Boost property type definitions: - typedef boost::readable_property_map_tag category; - typedef unsigned int value_type; - typedef value_type reference; - typedef Face_handle key_type; + using category = boost::readable_property_map_tag; + using value_type = unsigned int; + using reference = value_type; + using key_type = Face_handle; private: + using Self = Arr_face_index_map; + using Base = typename Arrangement_2::Observer; - typedef Arr_face_index_map Self; - typedef typename Arrangement_2::Observer Base; - - typedef Unique_hash_map Index_map; + using Index_map = Unique_hash_map; // Data members: - unsigned int n_faces; // The current number of faces. - Index_map index_map; // Mapping faces to indices. - std::vector rev_map; // Mapping indices to faces. + unsigned int n_faces; // The current number of faces. + Index_map index_map; // Mapping faces to indices. + std::vector rev_map; // Mapping indices to faces. enum {MIN_REV_MAP_SIZE = 32}; public: - /*! Default constructor. */ - Arr_face_index_map () : - Base (), - n_faces (0), - rev_map (MIN_REV_MAP_SIZE) + Arr_face_index_map() : + Base(), + n_faces(0), + rev_map(MIN_REV_MAP_SIZE) {} /*! Constructor with an associated arrangement. */ - Arr_face_index_map (const Arrangement_2& arr) : - Base(const_cast(arr)) - { - _init(); - } + Arr_face_index_map(const Base_aos& arr) : + Base(const_cast(arr)) + { _init(); } /*! Copy constructor. */ - Arr_face_index_map (const Self& other) : - Base(const_cast(*(other.arrangement()))) - { - _init(); - } + Arr_face_index_map(const Self& other) : + Base(const_cast(*(other.arrangement()))) + { _init(); } /*! Assignment operator. */ - Self& operator= (const Self& other) - { - if (this == &other) - return (*this); + Self& operator= (const Self& other) { + if (this == &other) return (*this); this->detach(); - this->attach(const_cast(*(other.arrangement()))); + this->attach(const_cast(*(other.arrangement()))); return (*this); } - /*! - * Get the index of a given face. + /*! Get the index of a given face. * \param f A handle to the face. * \pre f is a valid face in the arrangement. */ - unsigned int operator[] (Face_handle f) const - { - return (index_map[f]); - } + unsigned int operator[](Face_handle f) const { return (index_map[f]); } - /*! - * Get the face given its index. + /*! Get the face given its index. * \param i The index of the face. * \pre i is less than the number of faces in the arrangement. */ - Face_handle face (const int i) const - { + Face_handle face(const int i) const { CGAL_precondition((unsigned int) i < n_faces); - return (rev_map[i]); } /// \name Notification functions, to keep the mapping up-to-date. //@{ - /*! - * Update the mapping after the arrangement has been assigned with another + /*! Update the mapping after the arrangement has been assigned with another * arrangement. */ - virtual void after_assign () - { - _init(); - } + virtual void after_assign() override { _init(); } - /*! - * Update the mapping after the arrangement is cleared. + /*! Update the mapping after the arrangement is cleared. */ - virtual void after_clear () - { - _init(); - } + virtual void after_clear() override { _init(); } - /*! - * Update the mapping after attaching to a new arrangement. + /*! Update the mapping after attaching to a new arrangement. */ - virtual void after_attach () - { - _init(); - } + virtual void after_attach() override { _init(); } - /*! - * Update the mapping after detaching the arrangement. + /*! Update the mapping after detaching the arrangement. */ - virtual void after_detach () - { + virtual void after_detach() override { n_faces = 0; index_map.clear(); } - /*! - * Update the mapping after the creation of a new face is split from another + /*! Update the mapping after the creation of a new face is split from another * face. * \param f A handle to the existing face. * \param new_f A handle to the newly created face. */ - virtual void after_split_face (Face_handle /* f */, - Face_handle new_f, - bool /* is_hole */) - { + virtual void after_split_face(Face_handle /* f */, + Face_handle new_f, + bool /* is_hole */) override { // Update the number of vertices. - n_faces++; + ++n_faces; // If necessary, allocate memory for the reverse mapping. if (rev_map.size() < n_faces) @@ -174,97 +145,77 @@ public: // Update the mapping of the newly created face. index_map[new_f] = n_faces - 1; rev_map[n_faces - 1] = new_f; - - return; } - /*! - * Update the mapping before the merge of two faces. + /*! Update the mapping before the merge of two faces. * \param f1 A handle to the face that is going to remain. * \param f2 A handle to the face that is about to be removed. */ - virtual void before_merge_face (Face_handle /* f1 */, - Face_handle f2, - typename - Arrangement_2::Halfedge_handle /* e */) - { + virtual void before_merge_face(Face_handle /* f1 */, + Face_handle f2, + Halfedge_handle /* e */) override { // Update the number of faces. - n_faces--; + --n_faces; // Reduce memory consumption in case the number of faces has // drastically decreased. if (2*n_faces+1 < rev_map.size() && rev_map.size() / 2 >= MIN_REV_MAP_SIZE) { - rev_map.resize (rev_map.size() / 2); + rev_map.resize(rev_map.size() / 2); } // Get the current face index, and assign this index to the face // currently indexed (n - 1). - unsigned int index = index_map[f2]; + unsigned int index = index_map[f2]; - if (index == n_faces) - return; + if (index == n_faces) return; - Face_handle last_f = rev_map[n_faces]; + Face_handle last_f = rev_map[n_faces]; index_map[last_f] = index; rev_map[index] = last_f; // Clear the reverse mapping for the last face. rev_map[n_faces] = Face_handle(); - - return; } //@} private: - /*! Initialize the map for the given arrangement. */ - void _init () - { + void _init() { // Get the number of faces and allocate the reverse map accordingly. n_faces = static_cast(this->arrangement()->number_of_faces()); - if (n_faces < MIN_REV_MAP_SIZE) - rev_map.resize (MIN_REV_MAP_SIZE); - else - rev_map.resize (n_faces); + if (n_faces < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE); + else rev_map.resize (n_faces); // Clear the current mapping. index_map.clear(); // Create the initial mapping. - typename Arrangement_2::Face_iterator fit; - Face_handle fh; - unsigned int index = 0; + Face_handle fh; + unsigned int index = 0; - for (fit = this->arrangement()->faces_begin(); - fit != this->arrangement()->faces_end(); ++fit, ++index) - { + for (auto fit = this->arrangement()->faces_begin(); + fit != this->arrangement()->faces_end(); ++fit, ++index) { // Map the current face to the current index. fh = fit; index_map[fh] = index; rev_map[index] = fh; } - - return; } - }; -/*! - * Get the index property-map function. Provided so that boost is able to +/*! Get the index property-map function. Provided so that boost is able to * access the Arr_face_index_map above. * \param index_map The index map. * \param f A face handle. * \return The face index. */ -template -unsigned int get (const CGAL::Arr_face_index_map& index_map, - typename Arrangement::Face_handle f) -{ - return (index_map[f]); -} +template +unsigned int get(const CGAL::Arr_face_index_map& index_map, + typename Arrangement::Face_handle f) +{ return (index_map[f]); } } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h index 5e573527334..42dc494377f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h @@ -48,40 +48,38 @@ public: using Arrangement_2 = Arrangement_; using Base_aos = typename Arrangement_2::Base_aos; - typedef Nearest_neighbor_ Nearest_neighbor; + using Nearest_neighbor = Nearest_neighbor_; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; - typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; - typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; + using Geometry_traits_2 = typename Base_aos::Geometry_traits_2; + using Vertex_const_handle = typename Base_aos::Vertex_const_handle; + using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle; + using Face_const_handle = typename Base_aos::Face_const_handle; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using Face_handle = typename Base_aos::Face_handle; + using Vertex_const_iterator = typename Base_aos::Vertex_const_iterator; + using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator; - typedef typename Arrangement_2::Point_2 Point_2; - typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + using Point_2 = typename Base_aos::Point_2; + using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2; - typedef typename Nearest_neighbor::NN_Point_2 NN_Point_2; - typedef std::list NN_Points_set; + using NN_Point_2 = typename Nearest_neighbor::NN_Point_2; + using NN_Points_set = std::list; - typedef std::vector Points_set; + using Points_set = std::vector; - typedef Arr_point_location_result PL_result; - typedef typename PL_result::Type PL_result_type; + using PL_result = Arr_point_location_result; + using PL_result_type = typename PL_result::Type; - typedef std::pair PL_pair; - typedef std::vector Pairs_set; - typedef typename std::vector::iterator Pairs_iterator; + using PL_pair = std::pair; + using Pairs_set = std::vector; + using Pairs_iterator = typename std::vector::iterator; private: - typedef Arr_landmarks_generator_base - Self; + using Self = Arr_landmarks_generator_base; protected: - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; + using Traits_adaptor_2 = Arr_traits_basic_adaptor_2; // Data members: const Traits_adaptor_2* m_traits; // The associated traits object. @@ -110,8 +108,8 @@ public: /*! Constructor from an arrangement. * \param arr (in) The arrangement. */ - Arr_landmarks_generator_base(const Arrangement_2& arr) : - Arrangement_2::Observer(const_cast(arr)), + Arr_landmarks_generator_base(const Base_aos& arr) : + Base_aos::Observer(const_cast(arr)), m_traits(static_cast(arr.geometry_traits())), m_ignore_notifications(false), m_ignore_remove_edge(false), @@ -125,8 +123,7 @@ public: /*! Create the landmarks set (choosing the landmarks) , * and saving them in the nearest-neighbor search structure. */ - virtual void build_landmark_set() - { + virtual void build_landmark_set() { // Create the landmark points. NN_Points_set nn_points; _create_nn_points_set(nn_points); @@ -141,8 +138,7 @@ public: /*! clear the set of landmarks. */ - virtual void clear_landmark_set() - { + virtual void clear_landmark_set() { nn.clear(); num_small_not_updated_changes = 0; updated = false; @@ -154,8 +150,7 @@ public: * arrangement (a vertex, halfedge, or face handle). * \return The nearest landmark point. */ - virtual Point_2 closest_landmark(const Point_2& p, PL_result_type& obj) - { + virtual Point_2 closest_landmark(const Point_2& p, PL_result_type& obj) { CGAL_assertion(updated); return (nn.find_nearest_neighbor(p, obj)); } @@ -163,13 +158,13 @@ public: /// \name Overloaded observer functions on global changes. //@{ - /*! Notification before the arrangement is assigned with the content of another - * arrangement. - * \param arr The other arrangement. Notice that the arrangement type is the type used to - * instantiate the observer, which is conveniently defined as - * `Arrangement_2::Base_aos`. + /*! Notification before the arrangement is assigned with the content of + * another arrangement. + * \param arr The other arrangement. Notice that the arrangement type is the + * type used to instantiate the observer, which is conveniently + * defined as `Arrangement_2::Base_aos`. */ - virtual void before_assign(const Base_aos& arr) { + virtual void before_assign(const Base_aos& arr) override { this->clear_landmark_set(); m_traits = static_cast(arr.geometry_traits()); m_ignore_notifications = true; @@ -178,8 +173,7 @@ public: /*! Notification after the arrangement has been assigned with another * arrangement. */ - virtual void after_assign() - { + virtual void after_assign() override { this->build_landmark_set(); m_ignore_notifications = false; } @@ -187,8 +181,7 @@ public: /*! Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ - virtual void before_attach(const Base_aos& arr) - { + virtual void before_attach(const Base_aos& arr) override { this->clear_landmark_set(); m_traits = static_cast(arr.geometry_traits()); m_ignore_notifications = true; @@ -196,38 +189,33 @@ public: /*! Notification after the observer has been attached to an arrangement. */ - virtual void after_attach() - { + virtual void after_attach() override { this->build_landmark_set(); m_ignore_notifications = false; } /*! Notification before the observer is detached from the arrangement. */ - virtual void before_detach() - { this->clear_landmark_set(); } + virtual void before_detach() override { this->clear_landmark_set(); } /*! Notification after the arrangement is cleared. * \param u A handle to the unbounded face. */ - virtual void after_clear() - { + virtual void after_clear() override { this->clear_landmark_set(); this->build_landmark_set(); } /*! Notification before a global operation modifies the arrangement. */ - virtual void before_global_change() - { + virtual void before_global_change() override { this->clear_landmark_set(); m_ignore_notifications = true; } /*! Notification after a global operation is completed. */ - virtual void after_global_change() - { + virtual void after_global_change() override { this->build_landmark_set(); m_ignore_notifications = false; } @@ -239,12 +227,11 @@ public: /*! Notification before the removal of an edge. * \param e (in) A handle to one of the twin halfedges to be removed. */ - virtual void before_remove_edge(Halfedge_handle /* e */) + virtual void before_remove_edge(Halfedge_handle /* e */) override { m_ignore_remove_edge = true; } /*! Notification after the creation of a new vertex. */ - virtual void after_create_vertex(Vertex_handle) - { + virtual void after_create_vertex(Vertex_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -252,8 +239,7 @@ public: } /*! Notification after the creation of a new edge. */ - virtual void after_create_edge(Halfedge_handle) - { + virtual void after_create_edge(Halfedge_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -261,8 +247,7 @@ public: } /*! Notification after an edge was split. */ - virtual void after_split_edge(Halfedge_handle, Halfedge_handle) - { + virtual void after_split_edge(Halfedge_handle, Halfedge_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -270,8 +255,7 @@ public: } /*! Notification after a face was split. */ - virtual void after_split_face(Face_handle, Face_handle, bool) - { + virtual void after_split_face(Face_handle, Face_handle, bool) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -281,8 +265,7 @@ public: /*! Notification after an outer CCB was split.*/ virtual void after_split_outer_ccb(Face_handle, Ccb_halfedge_circulator, - Ccb_halfedge_circulator) - { + Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -292,8 +275,7 @@ public: /*! Notification after an inner CCB was split. */ virtual void after_split_inner_ccb(Face_handle, Ccb_halfedge_circulator, - Ccb_halfedge_circulator) - { + Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -301,8 +283,7 @@ public: } /*! Notification after an outer CCB was added to a face. */ - virtual void after_add_outer_ccb(Ccb_halfedge_circulator) - { + virtual void after_add_outer_ccb(Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -310,8 +291,7 @@ public: } /*! Notification after an inner CCB was created inside a face. */ - virtual void after_add_inner_ccb(Ccb_halfedge_circulator) - { + virtual void after_add_inner_ccb(Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -319,8 +299,7 @@ public: } /*! Notification after an isolated vertex was created inside a face. */ - virtual void after_add_isolated_vertex(Vertex_handle) - { + virtual void after_add_isolated_vertex(Vertex_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -328,8 +307,7 @@ public: } /*! Notification after an edge was merged. */ - virtual void after_merge_edge(Halfedge_handle) - { + virtual void after_merge_edge(Halfedge_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -337,8 +315,7 @@ public: } /*! Notification after a face was merged. */ - virtual void after_merge_face(Face_handle) - { + virtual void after_merge_face(Face_handle) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_landmark_set(); build_landmark_set(); @@ -347,7 +324,7 @@ public: /*! Notification after an outer CCB was merged. */ virtual void after_merge_outer_ccb(Face_handle, Ccb_halfedge_circulator) - { + override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -356,7 +333,7 @@ public: /*! Notification after an inner CCB was merged. */ virtual void after_merge_inner_ccb(Face_handle, Ccb_halfedge_circulator) - { + override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -364,8 +341,7 @@ public: } /*! Notification after an outer CCB is moved from one face to another. */ - virtual void after_move_outer_ccb(Ccb_halfedge_circulator ) - { + virtual void after_move_outer_ccb(Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -373,8 +349,7 @@ public: } /*! Notification after an inner CCB is moved from one face to another. */ - virtual void after_move_inner_ccb(Ccb_halfedge_circulator ) - { + virtual void after_move_inner_ccb(Ccb_halfedge_circulator) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -382,8 +357,7 @@ public: } /*! Notification after an isolated vertex is moved. */ - virtual void after_move_isolated_vertex(Vertex_handle ) - { + virtual void after_move_isolated_vertex(Vertex_handle) override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -391,8 +365,7 @@ public: } /*! Notificaion after the removal of a vertex. */ - virtual void after_remove_vertex() - { + virtual void after_remove_vertex() override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_landmark_set(); build_landmark_set(); @@ -400,8 +373,7 @@ public: } /*! Notification after the removal of an edge. */ - virtual void after_remove_edge() - { + virtual void after_remove_edge() override { if (! m_ignore_notifications) { clear_landmark_set(); build_landmark_set(); @@ -410,8 +382,7 @@ public: } /*! Notificaion after the removal of an outer CCB. */ - virtual void after_remove_outer_ccb(Face_handle) - { + virtual void after_remove_outer_ccb(Face_handle) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_landmark_set(); build_landmark_set(); @@ -419,8 +390,7 @@ public: } /*! Notificaion after the removal of an inner CCB. */ - virtual void after_remove_inner_ccb(Face_handle) - { + virtual void after_remove_inner_ccb(Face_handle) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_landmark_set(); build_landmark_set(); @@ -435,8 +405,7 @@ protected: */ virtual void _create_points_set(Points_set&) = 0; - virtual void _create_nn_points_set(NN_Points_set& nn_points) - { + virtual void _create_nn_points_set(NN_Points_set& nn_points) { Points_set points; Pairs_set pairs; @@ -454,8 +423,7 @@ protected: // Insert all landmarks (paired with their current location in the // arrangement) into the nearest-neighbor search structure. - Pairs_iterator itr; - for (itr = pairs.begin(); itr != pairs.end(); ++itr) { + for (auto itr = pairs.begin(); itr != pairs.end(); ++itr) { NN_Point_2 np(itr->first, itr->second); nn_points.push_back(np); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index 91739414dcb..5776d9cf3ab 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -8,8 +8,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Idit Haran -// (based on old version by Oren Nechushtan and Iddo Hanniel) +// Author(s): Idit Haran +// (based on old version by Oren Nechushtan and Iddo Hanniel) #ifndef CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H #define CGAL_ARR_TRAPEZOID_RIC_POINT_LOCATION_H @@ -42,90 +42,88 @@ public: using Base_aos = typename Arrangement_on_surface_2::Base_aos; //type of geometry traits - typedef typename Arrangement_on_surface_2::Geometry_traits_2 - Geometry_traits_2; + using Geometry_traits_2 = typename Base_aos::Geometry_traits_2; + //type of traits adaptor - typedef typename Arrangement_on_surface_2::Traits_adaptor_2 - Traits_adaptor_2; + using Traits_adaptor_2 = typename Base_aos::Traits_adaptor_2; + //type of vertex handle - typedef typename Arrangement_on_surface_2::Vertex_handle - Vertex_handle; + using Vertex_handle = typename Base_aos::Vertex_handle; + //type of vertex const handle - typedef typename Arrangement_on_surface_2::Vertex_const_handle - Vertex_const_handle; + using Vertex_const_handle = typename Base_aos::Vertex_const_handle; + //type of halfedge handle - typedef typename Arrangement_on_surface_2::Halfedge_handle - Halfedge_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + //type of halfedge const handle - typedef typename Arrangement_on_surface_2::Halfedge_const_handle - Halfedge_const_handle; + using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle; + //type of face const handle - typedef typename Arrangement_on_surface_2::Face_const_handle - Face_const_handle; + using Face_const_handle = typename Base_aos::Face_const_handle; + //type of edge const iterator - typedef typename Arrangement_on_surface_2::Edge_const_iterator - Edge_const_iterator; + using Edge_const_iterator = typename Base_aos::Edge_const_iterator; + //type of isolated vertex const iterator - typedef typename Arrangement_on_surface_2::Isolated_vertex_const_iterator - Isolated_vertex_const_iterator; + using Isolated_vertex_const_iterator = + typename Base_aos::Isolated_vertex_const_iterator; + //type of point - typedef typename Geometry_traits_2::Point_2 Point_2; + using Point_2 = typename Geometry_traits_2::Point_2; //type of x-monotone curve - typedef typename Geometry_traits_2::X_monotone_curve_2 - X_monotone_curve_2; + using X_monotone_curve_2 = typename Geometry_traits_2::X_monotone_curve_2; + //type of trapezoidal decomposition traits class - typedef CGAL::Td_traits - Td_traits; + using Td_traits = CGAL::Td_traits; + //type of trapezoidal decomposition class - typedef Trapezoidal_decomposition_2 - Trapezoidal_decomposition; + using Trapezoidal_decomposition = Trapezoidal_decomposition_2; //!types of Td_map_item-s - typedef typename Trapezoidal_decomposition::Td_map_item - Td_map_item; - typedef typename Trapezoidal_decomposition::Td_active_vertex - Td_active_vertex; - typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex - Td_active_fictitious_vertex; - typedef typename Trapezoidal_decomposition::Td_active_edge - Td_active_edge; - typedef typename Trapezoidal_decomposition::Td_active_trapezoid - Td_active_trapezoid; + using Td_map_item = typename Trapezoidal_decomposition::Td_map_item; + using Td_active_vertex = typename Trapezoidal_decomposition::Td_active_vertex; + using Td_active_fictitious_vertex = + typename Trapezoidal_decomposition::Td_active_fictitious_vertex; + using Td_active_edge = typename Trapezoidal_decomposition::Td_active_edge; + using Td_active_trapezoid = + typename Trapezoidal_decomposition::Td_active_trapezoid; + //!type of side tags - typedef typename Traits_adaptor_2::Left_side_category Left_side_category; - typedef typename Traits_adaptor_2::Bottom_side_category Bottom_side_category; - typedef typename Traits_adaptor_2::Top_side_category Top_side_category; - typedef typename Traits_adaptor_2::Right_side_category Right_side_category; + using Left_side_category = typename Traits_adaptor_2::Left_side_category; + using Bottom_side_category = typename Traits_adaptor_2::Bottom_side_category; + using Top_side_category = typename Traits_adaptor_2::Top_side_category; + using Right_side_category = typename Traits_adaptor_2::Right_side_category; protected: - typedef Arr_point_location_result Result; - typedef typename Result::Type Result_type; + using Result = Arr_point_location_result; + using Result_type = typename Result::Type; public: // Support cpp11::result_of - typedef Result_type result_type; + using result_type = Result_type; protected: //type of trapezoidal decomposition class - typedef Trapezoidal_decomposition TD; + using TD = Trapezoidal_decomposition; - typedef typename Arr_all_sides_oblivious_category::result - All_sides_oblivious_category; + using All_sides_oblivious_category= + typename Arr_all_sides_oblivious_category::result; // Data members: const Traits_adaptor_2* m_traits; // Its associated traits object. - TD td; // instance of trapezoidal decomposition + TD td; // instance of trapezoidal decomposition bool m_with_guarantees; //for the notification functions - X_monotone_curve_2 m_cv_before_split; - Halfedge_handle m_he_after_merge; - //X_monotone_curve_2 m_cv_before_merge1; - //X_monotone_curve_2 m_cv_before_merge2; + X_monotone_curve_2 m_cv_before_split; + Halfedge_handle m_he_after_merge; + //X_monotone_curve_2 m_cv_before_merge1; + //X_monotone_curve_2 m_cv_before_merge2; template Result_type make_result(T t) const { return Result::make_result(t); } @@ -133,26 +131,25 @@ protected: public: /*! Default constructor. */ - Arr_trapezoid_ric_point_location(bool with_guarantees = true, - double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, - double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : - m_traits(nullptr), m_with_guarantees(with_guarantees) - { + Arr_trapezoid_ric_point_location + (bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : + m_traits(nullptr), m_with_guarantees(with_guarantees) { td.set_with_guarantees(with_guarantees); td.depth_threshold(depth_thrs); td.size_threshold(size_thrs); } /*! Constructor given an arrangement. */ - Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr, - bool with_guarantees = true, - double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, - double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : - Arrangement_on_surface_2:: - Observer(const_cast(arr)), - m_with_guarantees(with_guarantees) - { - m_traits = static_cast (arr.geometry_traits()); + Arr_trapezoid_ric_point_location + (const Base_aos& arr, + bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : + Base_aos::Observer(const_cast(arr)), + m_with_guarantees(with_guarantees) { + m_traits = static_cast(arr.geometry_traits()); td.set_with_guarantees(with_guarantees); td.init_arrangement_and_traits(&arr); td.depth_threshold(depth_thrs); @@ -161,17 +158,15 @@ public: } /*! Destructor. */ - ~Arr_trapezoid_ric_point_location () { } + ~Arr_trapezoid_ric_point_location() { } /*! defines whether the underlying search structure guarantees logarithmic * query time and linear size */ - void with_guarantees (bool with_guarantees) - { + void with_guarantees(bool with_guarantees) { //if with_guarantees was changed from false to true - reconstruct // the search structure with guarantees td.set_with_guarantees(with_guarantees); - if (with_guarantees && !m_with_guarantees) - { + if (with_guarantees && !m_with_guarantees) { td.clear(); _construct_td(); } @@ -182,30 +177,20 @@ public: * (the longest path in the DAG) */ unsigned long depth() //longest_dag_path() - { - return td.largest_leaf_depth() + 1; - } + { return td.largest_leaf_depth() + 1; } /*! returns the longest query path in the underlying search structure */ unsigned long longest_query_path_length() - { - return td.longest_query_path_length(); - } + { return td.longest_query_path_length(); } #ifdef CGAL_TD_DEBUG //void locate_and_print (std::ostream& out, const Point_2& p) const - //{ - // td.locate_and_print(out, p); - //} + //{ td.locate_and_print(out, p); } - void print_dag(std::ostream& out) const - { - td.print_dag(out); - } + void print_dag(std::ostream& out) const { td.print_dag(out); } #endif - /*! - * Locate the arrangement feature containing the given point. + /*! Locate the arrangement feature containing the given point. * \param p The query point. * \return An object representing the arrangement feature containing the * query point. This object is either a Face_const_handle or a @@ -213,8 +198,7 @@ public: */ result_type locate(const Point_2& p) const; - /*! - * Locate the arrangement feature which a upward vertical ray emanating from + /*! Locate the arrangement feature which a upward vertical ray emanating from * the given point hits. * \param p The query point. * \return An object representing the arrangement feature the ray hits. @@ -224,8 +208,7 @@ public: result_type ray_shoot_up(const Point_2& p) const { return (_vertical_ray_shoot(p, true)); } - /*! - * Locate the arrangement feature which a downward vertical ray emanating + /*! Locate the arrangement feature which a downward vertical ray emanating * from the given point hits. * \param p The query point. * \return An object representing the arrangement feature the ray hits. @@ -239,32 +222,23 @@ public: // base observer. //@{ - /*! Notification before the arrangement is assigned with the content of another - * arrangement. - * \param arr The other arrangement. Notice that the arrangement type is the type used to - * instantiate the observer, which is conveniently defined as - * `Arrangement_2::Base_aos`. + /*! Notification before the arrangement is assigned with the content of + * another arrangement. + * \param arr The other arrangement. Notice that the arrangement type is the + * type used to instantiate the observer, which is conveniently + * defined as `Arrangement_2::Base_aos`. */ - virtual void before_assign(const Base_aos& arr) { + virtual void before_assign(const Base_aos& arr) override { td.clear(); m_traits = static_cast (arr.geometry_traits()); td.init_arrangement_and_traits(&arr, false); } - virtual void after_assign () - { - _construct_td(); - } + virtual void after_assign() override { _construct_td(); } - virtual void before_clear () - { - td.clear(); - } + virtual void before_clear() override { td.clear(); } - virtual void after_clear () - { - _construct_td(); - } + virtual void after_clear() override { _construct_td(); } /*! Notification before the observer is attached to an arrangement. * \param arr The arrangement that is about to attach the observer. Notice @@ -272,49 +246,38 @@ public: * observer, which is conveniently defined as * `Arrangement_2::Base_aos`. */ - virtual void before_attach(const Base_aos& arr) { + virtual void before_attach(const Base_aos& arr) override { td.clear(); m_traits = static_cast (arr.geometry_traits()); td.init_arrangement_and_traits(&arr); } - virtual void after_attach () - { - _construct_td(); - } + virtual void after_attach() override { _construct_td(); } - virtual void before_detach () - { - td.clear(); - } + virtual void before_detach() override { td.clear(); } - virtual void after_create_edge (Halfedge_handle e) - { - td.insert(e); - } + virtual void after_create_edge(Halfedge_handle e) override { td.insert(e); } //TODO IDIT OREN: what can be done in order to avoid the need //to save the original curve is to find the common endpoint of the //two new halfedges, locate it in the trapezoid in order to find the //curve it lies on, which is the curve that was split, and then remove //this curve. - virtual void before_split_edge (Halfedge_handle e, - Vertex_handle /* v */, - const X_monotone_curve_2& /* cv1 */ , - const X_monotone_curve_2& /* cv2 */ ) - { + virtual void before_split_edge(Halfedge_handle e, + Vertex_handle /* v */, + const X_monotone_curve_2& /* cv1 */, + const X_monotone_curve_2& /* cv2 */) override { - ////MICHAL: commented due to inefficient depth update, remove and insert instead - ////save the curve for the "after" function. + ////MICHAL: commented due to inefficient depth update, remove and insert + ////instead save the curve for the "after" function. //m_cv_before_split = e->curve(); //td.before_split_edge(m_cv_before_split, cv1, cv2); td.remove(e); } - virtual void after_split_edge (Halfedge_handle e1, - Halfedge_handle e2) - { + virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2) + override { //MICHAL: commented due to inefficient depth update, remove and insert instead //td.split_edge(m_cv_before_split,e1,e2); @@ -322,29 +285,20 @@ public: td.insert(e2); } - virtual void before_merge_edge (Halfedge_handle e1, - Halfedge_handle e2, - const X_monotone_curve_2& cv) - { + virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2, + const X_monotone_curve_2& cv) override { //save the halfedge handle for the "after" function. m_he_after_merge = e1; td.merge_edge (e1, e2, cv); } - virtual void after_merge_edge (Halfedge_handle e) - { - td.after_merge_edge(e, m_he_after_merge); - } + virtual void after_merge_edge(Halfedge_handle e) override + { td.after_merge_edge(e, m_he_after_merge); } - virtual void before_remove_edge (Halfedge_handle e) - { - //called before combinatoric deletion - td.remove(e); - } + virtual void before_remove_edge(Halfedge_handle e) override { td.remove(e); } //@} public: - //#ifdef CGAL_TD_DEBUG // void debug() // { @@ -353,27 +307,22 @@ public: //#endif protected: - /*! Construct the trapezoidal decomposition. */ - void _construct_td () - { + void _construct_td() { td.clear(); std::vector he_container; - Edge_const_iterator eit; - Halfedge_const_handle he_cst; auto* arr = this->arrangement(); //collect the arrangement halfedges - for (eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) - { - he_cst = eit; + for (auto eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) { + Halfedge_const_handle he_cst = eit; he_container.push_back(he_cst); } //container insertion td.insert(he_container.begin(), he_container.end()); } - /*! gets the unbounded face that contains the point when the trapezoid is + /*! Obtain the unbounded face that contains the point when the trapezoid is * unbounded * \param tr The unbounded trapezoid whose face we should get * \param p The query point. @@ -381,24 +330,23 @@ protected: * \return A Face_const_handle representing the arrangement unbounded face in * which the point p lies */ - Face_const_handle _get_unbounded_face (const Td_map_item& tr, - const Point_2& p, - Arr_all_sides_oblivious_tag) const; + Face_const_handle _get_unbounded_face(const Td_map_item& tr, + const Point_2& p, + Arr_all_sides_oblivious_tag) const; - /*! gets the unbounded face that contains the point when the trapezoid is + /*! Obtain the unbounded face that contains the point when the trapezoid is * unbounded * \param tr The unbounded trapezoid whose face we should get * \param p The query point. * \param Arr_not_all_sides_oblivious_tag - * \return A Face_const_handle representing the arrangement unbounded face in which - * the point p lies + * \return A Face_const_handle representing the arrangement unbounded face in + * which the point p lies */ - Face_const_handle _get_unbounded_face (const Td_map_item& tr, - const Point_2& p, - Arr_not_all_sides_oblivious_tag) const; + Face_const_handle _get_unbounded_face(const Td_map_item& tr, + const Point_2& p, + Arr_not_all_sides_oblivious_tag) const; - /*! - * Locate the arrangement feature which a vertical ray emanating from the + /*! Locate the arrangement feature which a vertical ray emanating from the * given point hits, considering isolated vertices. * \param p The query point. * \param shoot_up Indicates whether the ray is directed upward or downward. @@ -413,11 +361,10 @@ protected: * we check the isolated vertices inside the face to check whether there * is an isolated vertex right above/below the query point. */ - result_type - _check_isolated_for_vertical_ray_shoot - (Halfedge_const_handle halfedge_found, - const Point_2& p, bool shoot_up, - const Td_map_item& tr) const; + result_type _check_isolated_for_vertical_ray_shoot + (Halfedge_const_handle halfedge_found, + const Point_2& p, bool shoot_up, + const Td_map_item& tr) const; }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index 91ac2394e39..37aef38630c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -40,70 +40,68 @@ namespace CGAL { template class Arr_triangulation_point_location : public Arrangement_::Observer { public: - typedef Arrangement_ Arrangement_2; + using Arrangement_2 = Arrangement_; + using Base_aos = typename Arrangement_2::Base_aos; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef typename Geometry_traits_2::Kernel Kernel; + using Geometry_traits_2 = typename Base_aos::Geometry_traits_2; + using Kernel = typename Geometry_traits_2::Kernel; - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; + using Vertex_const_handle = typename Base_aos::Vertex_const_handle; + using Halfedge_const_handle = typename Base_aos::Halfedge_const_handle; + using Face_const_handle = typename Base_aos::Face_const_handle; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using Face_handle = typename Base_aos::Face_handle; - typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; - typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; - typedef typename Arrangement_2::Face_const_iterator Face_const_iterator; - typedef typename Arrangement_2::Halfedge_const_iterator - Halfedge_const_iterator; - typedef typename Arrangement_2::Halfedge_around_vertex_const_circulator - Halfedge_around_vertex_const_circulator; - typedef typename Arrangement_2::Ccb_halfedge_const_circulator - Ccb_halfedge_const_circulator; - typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; - typedef typename Arrangement_2::Isolated_vertex_const_iterator - Isolated_vertex_const_iterator; + using Vertex_const_iterator = typename Base_aos::Vertex_const_iterator; + using Edge_const_iterator = typename Base_aos::Edge_const_iterator; + using Face_const_iterator = typename Base_aos::Face_const_iterator; + using Halfedge_const_iterator = typename Base_aos::Halfedge_const_iterator; + using Halfedge_around_vertex_const_circulator = + typename Base_aos::Halfedge_around_vertex_const_circulator; + using Ccb_halfedge_const_circulator = + typename Base_aos::Ccb_halfedge_const_circulator; + using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator; + using Isolated_vertex_const_iterator = + typename Base_aos::Isolated_vertex_const_iterator; - typedef typename Geometry_traits_2::Point_2 Point_2; - typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; + using Point_2 = typename Geometry_traits_2::Point_2; + using X_monotone_curve_2 = typename Geometry_traits_2::X_monotone_curve_2; - typedef std::list Edge_list; - typedef typename Edge_list::iterator Std_edge_iterator; + using Edge_list = std::list; + using Std_edge_iterator = typename Edge_list::iterator; //---------------------------------------------------------- // Triangulation Types //---------------------------------------------------------- - typedef Triangulation_vertex_base_with_info_2 - Vbb; - typedef Triangulation_hierarchy_vertex_base_2 Vb; + using Vbb = Triangulation_vertex_base_with_info_2; + using Vb = Triangulation_hierarchy_vertex_base_2; //typedef Triangulation_face_base_with_info_2 Fbt; - typedef Constrained_triangulation_face_base_2 Fb; - typedef Triangulation_data_structure_2 TDS; - typedef Exact_predicates_tag Itag; + using Fb = Constrained_triangulation_face_base_2; + using TDS = Triangulation_data_structure_2; + using Itag = Exact_predicates_tag; //typedef Constrained_Delaunay_triangulation_2 CDT; - typedef Constrained_Delaunay_triangulation_2 CDT_t; - typedef Triangulation_hierarchy_2 CDTH; - typedef Constrained_triangulation_plus_2 CDT; + using CDT_t = Constrained_Delaunay_triangulation_2; + using CDTH = Triangulation_hierarchy_2; + using CDT = Constrained_triangulation_plus_2; - typedef typename CDT::Point CDT_Point; - typedef typename CDT::Edge CDT_Edge; - typedef typename CDT::Face_handle CDT_Face_handle; - typedef typename CDT::Vertex_handle CDT_Vertex_handle; - typedef typename CDT::Finite_faces_iterator CDT_Finite_faces_iterator; - typedef typename CDT::Finite_vertices_iterator CDT_Finite_vertices_iterator; - typedef typename CDT::Finite_edges_iterator CDT_Finite_edges_iterator; - typedef typename CDT::Locate_type CDT_Locate_type; + using CDT_Point = typename CDT::Point; + using CDT_Edge = typename CDT::Edge; + using CDT_Face_handle = typename CDT::Face_handle; + using CDT_Vertex_handle = typename CDT::Vertex_handle; + using CDT_Finite_faces_iterator = typename CDT::Finite_faces_iterator; + using CDT_Finite_vertices_iterator = typename CDT::Finite_vertices_iterator; + using CDT_Finite_edges_iterator = typename CDT::Finite_edges_iterator; + using CDT_Locate_type = typename CDT::Locate_type; - typedef Arr_point_location_result Result; - typedef typename Result::Type Result_type; + using Result = Arr_point_location_result; + using Result_type = typename Result::Type; // Support cpp11::result_of - typedef Result_type result_type; + using result_type = Result_type; protected: - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; + using Traits_adaptor_2 = Arr_traits_basic_adaptor_2; // Data members: const Traits_adaptor_2* m_traits; // Its associated traits object. @@ -126,8 +124,8 @@ public: /*! Constructor from an arrangement. * \param arr (in) The arrangement. */ - Arr_triangulation_point_location(const Arrangement_2& arr) : - Arrangement_2::Observer(const_cast(arr)), + Arr_triangulation_point_location(const Base_aos& arr) : + Base_aos::Observer(const_cast(arr)), m_traits(static_cast(arr.geometry_traits())), m_ignore_notifications(false), m_ignore_remove_edge(false) @@ -147,12 +145,12 @@ public: /*! Attach an arrangement. * \param arr (in) The arrangement. */ - virtual void before_attach(const Arrangement_2& arr) + virtual void before_attach(const Base_aos& arr) override { m_traits = static_cast(arr.geometry_traits()); } - virtual void after_attach() { build_triangulation(); } + virtual void after_attach() override { build_triangulation(); } - virtual void before_detach() { clear_triangulation(); } + virtual void before_detach() override { clear_triangulation(); } /// \name Overloaded observer functions on global changes. //@{ @@ -160,32 +158,28 @@ public: /*! Notification after the arrangement has been assigned with another * arrangement. */ - virtual void after_assign() - { + virtual void after_assign() override { clear_triangulation(); build_triangulation(); } /*! Notification after the arrangement is cleared. */ - virtual void after_clear() - { + virtual void after_clear() override { clear_triangulation(); build_triangulation(); } /*! Notification before a global operation modifies the arrangement. */ - virtual void before_global_change() - { + virtual void before_global_change() override { clear_triangulation(); m_ignore_notifications = true; } /*! Notification after a global operation is completed. */ - virtual void after_global_change() - { + virtual void after_global_change() override { build_triangulation(); m_ignore_notifications = false; } @@ -197,14 +191,13 @@ public: /*! Notification before the removal of an edge. * \param e (in) A handle to one of the twin halfedges to be removed. */ - virtual void before_remove_edge(Halfedge_handle /* e */) + virtual void before_remove_edge(Halfedge_handle /* e */) override { m_ignore_remove_edge = true; } /*! Notification after the creation of a new vertex. * \param v (in) A handle to the created vertex. */ - virtual void after_create_vertex(Vertex_handle /* v */) - { + virtual void after_create_vertex(Vertex_handle /* v */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -214,8 +207,7 @@ public: /*! Notification after the creation of a new edge. * \param e (in) A handle to one of the twin halfedges that were created. */ - virtual void after_create_edge(Halfedge_handle /* e */) - { + virtual void after_create_edge(Halfedge_handle /* e */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -227,8 +219,7 @@ public: * \param e2 (in) A handle to one of the twin halfedges forming the second edge. */ virtual void after_split_edge(Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - { + Halfedge_handle /* e2 */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -242,8 +233,7 @@ public: */ virtual void after_split_face(Face_handle /* f */, Face_handle /* new_f */, - bool /* is_hole */) - { + bool /* is_hole */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -253,8 +243,7 @@ public: /*! Notification after an outer CCB was created inside a face. * \param h (in) A circulator representing the boundary of the new outer CCB. */ - virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) - { + virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -264,8 +253,7 @@ public: /*! Notification after an edge was merged. * \param e (in) A handle to one of the twin halfedges forming the merged edge. */ - virtual void after_merge_edge(Halfedge_handle /* e */) - { + virtual void after_merge_edge(Halfedge_handle /* e */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -275,8 +263,7 @@ public: /*! Notification after a face was merged. * \param f (in) A handle to the merged face. */ - virtual void after_merge_face(Face_handle /* f */) - { + virtual void after_merge_face(Face_handle /* f */) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_triangulation(); build_triangulation(); @@ -286,8 +273,7 @@ public: /*! Notification after an outer CCB is moved from one face to another. * \param h (in) A circulator representing the boundary of the component. */ - virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) - { + virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -297,8 +283,7 @@ public: /*! Notificaion before the removal of a vertex. * \param v (in) A handle to the vertex to be deleted. */ - virtual void after_remove_vertex() - { + virtual void after_remove_vertex() override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_triangulation(); build_triangulation(); @@ -308,8 +293,7 @@ public: /*! Notification before the removal of an edge. * \param e (in) A handle to one of the twin halfedges to be deleted. */ - virtual void after_remove_edge() - { + virtual void after_remove_edge() override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -320,8 +304,7 @@ public: /*! Notification before the removal of an outer CCB. * \param f (in) The face that used to own the outer CCB. */ - virtual void after_remove_outer_ccb(Face_handle /* f */) - { + virtual void after_remove_outer_ccb(Face_handle /* f */) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_triangulation(); build_triangulation(); @@ -331,8 +314,7 @@ public: /*! Notification after an inner CCB was created inside a face. * \param h (in) A circulator representing the boundary of the new inner CCB. */ - virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) - { + virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -342,8 +324,7 @@ public: /*! Notification after an inner CCB is moved from one face to another. * \param h (in) A circulator representing the boundary of the component. */ - virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) - { + virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) override { if (! m_ignore_notifications) { clear_triangulation(); build_triangulation(); @@ -353,8 +334,7 @@ public: /*! Notificaion after the removal of an inner CCB. * \param f (in) The face that used to contain the inner CCB. */ - virtual void after_remove_inner_ccb(Face_handle /* f */) - { + virtual void after_remove_inner_ccb(Face_handle /* f */) override { if (! m_ignore_notifications && ! m_ignore_remove_edge) { clear_triangulation(); build_triangulation(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h index 92f412d2495..a9682dc5bad 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h @@ -34,135 +34,120 @@ namespace CGAL { * arrangement vertices to the indices 0, ..., (n -1), where n is the number * of vertices in the arrangement. */ -template +template class Arr_vertex_index_map : public Arrangement_::Observer { public: + using Arrangement_2 = Arrangement_; + using Base_aos = typename Arrangement_2::Base_aos; - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; + using Vertex_handle = typename Base_aos::Vertex_handle; // Boost property type definitions: - typedef boost::readable_property_map_tag category; - typedef unsigned int value_type; - typedef value_type reference; - typedef Vertex_handle key_type; + using category = boost::readable_property_map_tag; + using value_type = unsigned int; + using reference = value_type; + using key_type = Vertex_handle; private: + using Self = Arr_vertex_index_map; + using Base = typename Arrangement_2::Observer; - typedef Arr_vertex_index_map Self; - typedef typename Arrangement_2::Observer Base; - - typedef Unique_hash_map Index_map; + using Index_map = Unique_hash_map; // Data members: - unsigned int n_vertices; // The current number of vertices. - Index_map index_map; // Mapping vertices to indices. - std::vector rev_map; // Mapping indices to vertices. + unsigned int n_vertices; // The current number of vertices. + Index_map index_map; // Mapping vertices to indices. + std::vector rev_map; // Mapping indices to vertices. enum {MIN_REV_MAP_SIZE = 32}; public: - /*! Default constructor. */ - Arr_vertex_index_map () : + Arr_vertex_index_map() : Base(), - n_vertices (0), - rev_map (MIN_REV_MAP_SIZE) + n_vertices(0), + rev_map(MIN_REV_MAP_SIZE) {} /*! Constructor with an associated arrangement. */ - Arr_vertex_index_map (const Arrangement_2& arr) : - Base(const_cast(arr)) - { - _init(); - } + Arr_vertex_index_map(const Base_aos& arr) : + Base(const_cast(arr)) + { _init(); } /*! Copy constructor. */ - Arr_vertex_index_map (const Self& other) : - Base(const_cast (*(other.arrangement()))) - { - _init(); - } + Arr_vertex_index_map(const Self& other) : + Base(const_cast(*(other.arrangement()))) + { _init(); } /*! Assignment operator. */ - Self& operator= (const Self& other) - { - if (this == &other) - return (*this); + Self& operator= (const Self& other) { + if (this == &other) return (*this); this->detach(); - this->attach (const_cast (*(other.arrangement()))); + this->attach(const_cast(*(other.arrangement()))); return (*this); } - /*! - * Get the index of a given vertex. + /*! Get the index of a given vertex. * \param v A handle to the vertex. * \pre v is a valid vertex in the arrangement. */ - unsigned int operator[] (Vertex_handle v) const - { - return index_map[v]; - } + unsigned int operator[](Vertex_handle v) const { return index_map[v]; } - /*! - * Get the vertex given its index. + /*! Get the vertex given its index. * \param i The index of the vertex. * \pre i is less than the number of vertices in the graph. */ - Vertex_handle vertex (const int i) const - { - CGAL_precondition (i < n_vertices); - + Vertex_handle vertex(const int i) const { + CGAL_precondition(i < n_vertices); return rev_map[i]; } /// \name Notification functions, to keep the mapping up-to-date. //@{ - /*! - * Update the mapping after the arrangement has been assigned with another + /*! Update the mapping after the arrangement has been assigned with another * arrangement. */ - virtual void after_assign () - { - _init(); - } + virtual void after_assign() override { _init(); } - /*! - * Update the mapping after the arrangement is cleared. + /*! Update the mapping after the arrangement is cleared. */ - virtual void after_clear () - { - _init(); - } + virtual void after_clear() override { _init(); } - /*! - * Update the mapping after attaching to a new arrangement. + /*! Update the mapping after attaching to a new arrangement. */ - virtual void after_attach () - { - _init(); - } + virtual void after_attach() override { _init(); } - /*! - * Update the mapping after detaching the arrangement. + /*! Update the mapping after detaching the arrangement. */ - virtual void after_detach () - { + virtual void after_detach() override { n_vertices = 0; index_map.clear(); } - /*! - * Update the mapping after the creation of a new vertex. + /*! Update the mapping after the creation of a new vertex. * \param v A handle to the created vertex. */ - virtual void after_create_vertex (Vertex_handle v) - { + virtual void after_create_vertex(Vertex_handle v) override { // Update the number of vertices. - n_vertices++; + ++n_vertices; + + // If necessary, allocate memory for the reverse mapping. + if (rev_map.size() < n_vertices) rev_map.resize(2 * n_vertices); + + // Update the mapping of the newly created vertex. + index_map[v] = n_vertices - 1; + rev_map[n_vertices - 1] = v; + } + + /*! Update the mapping after the creation of a new boundary vertex. + * \param v A handle to the created vertex. + */ + virtual void after_create_boundary_vertex(Vertex_handle v) override { + // Update the number of vertices. + ++n_vertices; // If necessary, allocate memory for the reverse mapping. if (rev_map.size() < n_vertices) @@ -173,49 +158,28 @@ public: rev_map[n_vertices - 1] = v; } - /*! - * Update the mapping after the creation of a new boundary vertex. - * \param v A handle to the created vertex. - */ - virtual void after_create_boundary_vertex (Vertex_handle v) - { - // Update the number of vertices. - n_vertices++; - - // If necessary, allocate memory for the reverse mapping. - if (rev_map.size() < n_vertices) - rev_map.resize (2 * n_vertices); - - // Update the mapping of the newly created vertex. - index_map[v] = n_vertices - 1; - rev_map[n_vertices - 1] = v; - } - - /*! - * Update the mapping before the removal of a vertex. + /*! Update the mapping before the removal of a vertex. * \param v A handle to the vertex to be removed. */ - virtual void before_remove_vertex (Vertex_handle v) - { + virtual void before_remove_vertex(Vertex_handle v) override { // Update the number of vertices. - n_vertices--; + --n_vertices; // Reduce memory consumption in case the number of vertices has // drastically decreased. if (2*n_vertices+1 < rev_map.size() && rev_map.size() / 2 >= MIN_REV_MAP_SIZE) { - rev_map.resize (rev_map.size() / 2); + rev_map.resize(rev_map.size() / 2); } // Get the current vertex index, and assign this index to the vertex // currently indexed (n - 1). - unsigned int index = index_map[v]; + unsigned int index = index_map[v]; - if (index == n_vertices) - return; + if (index == n_vertices) return; - Vertex_handle last_v = rev_map[n_vertices]; + Vertex_handle last_v = rev_map[n_vertices]; index_map[last_v] = index; rev_map[index] = last_v; @@ -225,51 +189,42 @@ public: //@} private: - /*! Initialize the map for the given arrangement. */ - void _init () - { + void _init() { // Get the number of vertices and allocate the reverse map accordingly. - n_vertices = static_cast(this->arrangement()->number_of_vertices()); + n_vertices = + static_cast(this->arrangement()->number_of_vertices()); - if (n_vertices < MIN_REV_MAP_SIZE) - rev_map.resize (MIN_REV_MAP_SIZE); - else - rev_map.resize (n_vertices); + if (n_vertices < MIN_REV_MAP_SIZE) rev_map.resize (MIN_REV_MAP_SIZE); + else rev_map.resize (n_vertices); // Clear the current mapping. index_map.clear(); // Create the initial mapping. - typename Arrangement_2::Vertex_iterator vit; - Vertex_handle vh; - unsigned int index = 0; + Vertex_handle vh; + unsigned int index = 0; - for (vit = this->arrangement()->vertices_begin(); - vit != this->arrangement()->vertices_end(); ++vit, ++index) - { + for (auto vit = this->arrangement()->vertices_begin(); + vit != this->arrangement()->vertices_end(); ++vit, ++index) { // Map the current vertex to the current index. vh = vit; index_map[vh] = index; rev_map[index] = vh; } } - }; -/*! - * Get the index property-map function. Provided so that boost is able to +/*! Get the index property-map function. Provided so that boost is able to * access the Arr_vertex_index_map above. * \param index_map The index map. * \param v A vertex handle. * \return The vertex index. */ -template -unsigned int get (const CGAL::Arr_vertex_index_map& index_map, - typename Arrangement::Vertex_handle v) -{ - return index_map[v]; -} +template +unsigned int get(const CGAL::Arr_vertex_index_map& index_map, + typename Arrangement::Vertex_handle v) +{ return index_map[v]; } } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h index 6b59905c8d7..0c1cb425cf8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_with_history_2.h @@ -274,109 +274,85 @@ protected: */ class Curve_halfedges_observer : public Base_arr_2::Observer { public: + using Base_aos = typename Base_arr_2::Base_aos; - typedef typename Base_arr_2::Halfedge_handle Halfedge_handle; - typedef typename Base_arr_2::Vertex_handle Vertex_handle; - typedef typename Base_arr_2::X_monotone_curve_2 X_monotone_curve_2; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2; - /*! - * Notification after the creation of a new edge. + /*! Notification after the creation of a new edge. * \param e A handle to one of the twin halfedges that were created. */ - virtual void after_create_edge (Halfedge_handle e) - { - _register_edge(e); - } + virtual void after_create_edge(Halfedge_handle e) override + { _register_edge(e); } /*! * Notification before the modification of an existing edge. * \param e A handle to one of the twin halfedges to be updated. * \param c The x-monotone curve to be associated with the edge. */ - virtual void before_modify_edge (Halfedge_handle e, - const X_monotone_curve_2& /* c */) - { - _unregister_edge(e); - } + virtual void before_modify_edge(Halfedge_handle e, + const X_monotone_curve_2& /* c */) override + { _unregister_edge(e); } - /*! - * Notification after an edge was modified. + /*! Notification after an edge was modified. * \param e A handle to one of the twin halfedges that were updated. */ - virtual void after_modify_edge (Halfedge_handle e) - { - _register_edge(e); - } + virtual void after_modify_edge(Halfedge_handle e) override + { _register_edge(e); } - /*! - * Notification before the splitting of an edge into two. + /*! Notification before the splitting of an edge into two. * \param e A handle to one of the existing halfedges. * \param c1 The x-monotone curve to be associated with the first edge. * \param c2 The x-monotone curve to be associated with the second edge. */ - virtual void before_split_edge (Halfedge_handle e, - Vertex_handle /* v */, - const X_monotone_curve_2& /* c1 */, - const X_monotone_curve_2& /* c2 */) - { - _unregister_edge(e); - } + virtual void before_split_edge(Halfedge_handle e, + Vertex_handle /* v */, + const X_monotone_curve_2& /* c1 */, + const X_monotone_curve_2& /* c2 */) override + { _unregister_edge(e); } - /*! - * Notification after an edge was split. + /*! Notification after an edge was split. * \param e1 A handle to one of the twin halfedges forming the first edge. * \param e2 A handle to one of the twin halfedges forming the second edge. */ - virtual void after_split_edge (Halfedge_handle e1, Halfedge_handle e2) - { + virtual void after_split_edge(Halfedge_handle e1, Halfedge_handle e2) + override { _register_edge(e1); _register_edge(e2); } - /*! - * Notification before the merging of two edges. + /*! Notification before the merging of two edges. * \param e1 A handle to one of the halfedges forming the first edge. * \param e2 A handle to one of the halfedges forming the second edge. * \param c The x-monotone curve to be associated with the merged edge. */ - virtual void before_merge_edge (Halfedge_handle e1, Halfedge_handle e2, - const X_monotone_curve_2& /* c */) - { + virtual void before_merge_edge(Halfedge_handle e1, Halfedge_handle e2, + const X_monotone_curve_2& /* c */) override { _unregister_edge(e1); _unregister_edge(e2); } - /*! - * Notification after an edge was merged. + /*! Notification after an edge was merged. * \param e A handle to one of the twin halfedges forming the merged edge. */ - virtual void after_merge_edge (Halfedge_handle e) - { - _register_edge(e); - } + virtual void after_merge_edge(Halfedge_handle e) override + { _register_edge(e); } - /*! - * Notification before the removal of an edge. + /*! Notification before the removal of an edge. * \param e A handle to one of the twin halfedges to be deleted. */ - virtual void before_remove_edge (Halfedge_handle e) - { - _unregister_edge(e); - } + virtual void before_remove_edge(Halfedge_handle e) override + { _unregister_edge(e); } private: - /*! - * Register the given halfedge in the set(s) associated with its curve. + /*! Register the given halfedge in the set(s) associated with its curve. */ - void _register_edge (Halfedge_handle e) - { - Curve_halfedges *curve_halfedges; - Data_iterator di; - - for (di = e->curve().data().begin(); di != e->curve().data().end(); ++di) - { - curve_halfedges = static_cast(*di); + void _register_edge(Halfedge_handle e) { + for (auto di = e->curve().data().begin(); di != e->curve().data().end(); + ++di) { + Curve_halfedges* curve_halfedges = static_cast(*di); curve_halfedges->_insert(e); } } @@ -384,14 +360,10 @@ protected: /*! * Unregister the given halfedge from the set(s) associated with its curve. */ - void _unregister_edge (Halfedge_handle e) - { - Curve_halfedges *curve_halfedges; - Data_iterator di; - - for (di = e->curve().data().begin(); di != e->curve().data().end(); ++di) - { - curve_halfedges = static_cast(*di); + void _unregister_edge(Halfedge_handle e) { + for (auto di = e->curve().data().begin(); di != e->curve().data().end(); + ++di) { + Curve_halfedges* curve_halfedges = static_cast(*di); curve_halfedges->_erase(e); } } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp index c095d9c2507..5156fde017b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp @@ -33,684 +33,509 @@ typedef Traits_2::Point_2 Point_2; typedef Traits_2::X_monotone_curve_2 Segment_2; typedef CGAL::Arrangement_2 Arrangement_2; -void skip_comments(std::ifstream & is, char * line) -{ +void skip_comments(std::ifstream & is, char* line) { while (!is.eof()) { is.getline(line, 128); if (line[0] != '#') break; } } -void compare_results(std::string str) -{ - skip_comments(global_input_file, one_line); - std::istringstream str_stream(one_line); - str_stream.getline(buff, 128, ' '); - if (std::string(buff)!=str) - { - std::cout << "Expected " << std::string(buff) << " obtained " - << str << std::endl; - ok=-1; - } +void compare_results(std::string str) { + skip_comments(global_input_file, one_line); + std::istringstream str_stream(one_line); + str_stream.getline(buff, 128, ' '); + if (std::string(buff) != str) { + std::cout << "Expected " << std::string(buff) << " obtained " + << str << std::endl; + ok = -1; + } } // An arrangement observer, used to receive notifications of face splits and // face mergers. class Test_observer : public Arrangement_2::Observer { - public: - using Base_aos = typename Arrangement_2::Base_aos; + using Observer = Arrangement_2::Observer; + using Base_aos = Arrangement_2::Base_aos; - Test_observer(Arrangement_2& arr) : Arrangement_2::Observer(arr) {} + using Vertex_handle = Base_aos::Vertex_handle; + using Halfedge_handle = Base_aos::Halfedge_handle; + using Face_handle = Base_aos::Face_handle; + using Ccb_halfedge_circulator = Base_aos::Ccb_halfedge_circulator; + using Point_2 = Base_aos::Point_2; + using X_monotone_curve_2 = Base_aos::X_monotone_curve_2; + + Test_observer(Base_aos& arr) : Observer(arr) {} /// \name Notification functions on global arrangement operations. //@{ - /*! Notification before the arrangement is assigned with the content of another - * arrangement. - * \param arr The other arrangement. Notice that the arrangement type is the type used to - * instantiate the observer, which is conveniently defined as - * `Arrangement_2::Base_aos`. + /*! Notification before the arrangement is assigned with the content of + * another arrangement. + * \param arr The other arrangement. Notice that the arrangement type is the + * type used to instantiate the observer, which is conveniently + * defined as `Arrangement_2::Base_aos`. */ - virtual void before_assign (const Base_aos& /* arr */) + virtual void before_assign(const Base_aos& /* arr */) override { compare_results("before_assign"); } /*! * Notification after the arrangement has been assigned with another * arrangement. */ - virtual void after_assign () - { - compare_results("after_assign"); - } + virtual void after_assign() override { compare_results("after_assign"); } /*! Notification before the arrangement is cleared. */ - virtual void before_clear () - { - compare_results("before_clear"); - } + virtual void before_clear() override { compare_results("before_clear"); } /*! * Notification after the arrangement is cleared. */ - virtual void after_clear () - { - compare_results("after_clear"); - } + virtual void after_clear() override { compare_results("after_clear"); } /*! Notification before a global operation modifies the arrangement. */ - virtual void before_global_change () - { - compare_results("before_global_change"); - } + virtual void before_global_change() override + { compare_results("before_global_change"); } /*! Notification after a global operation is completed. */ - virtual void after_global_change () - { - compare_results("after_global_change"); - } + virtual void after_global_change() override + { compare_results("after_global_change"); } //@} /// \name Notification functions on observer attachment or detachment. //@{ - /*! - * Notification before the observer is attached to an arrangement. + /*! Notification before the observer is attached to an arrangement. * \param arr The arrangement we are about to attach the observer to. */ - virtual void before_attach (const Base_aos& /* arr */) - { - compare_results("before_attach"); - } + virtual void before_attach(const Base_aos& /* arr */) override + { compare_results("before_attach"); } - /*! - * Notification after the observer has been attached to an arrangement. + /*! Notification after the observer has been attached to an arrangement. */ - virtual void after_attach () - { - compare_results("after_attach"); - } + virtual void after_attach() override { compare_results("after_attach"); } - /*! - * Notification before the observer is detached from the arrangement. + /*! Notification before the observer is detached from the arrangement. */ - virtual void before_detach () - { - compare_results("before_detach"); - } + virtual void before_detach() override { compare_results("before_detach"); } - /*! - * Notification after the observer has been detached to the arrangement. + /*! Notification after the observer has been detached to the arrangement. */ - virtual void after_detach () - - { - compare_results("after_detach"); - } + virtual void after_detach() override { compare_results("after_detach"); } //@} /// \name Notification functions on local changes in the arrangement. //@{ - /*! - * Notification before the creation of a new vertex. + /*! Notification before the creation of a new vertex. * \param p The point to be associated with the vertex. * This point cannot lies on the surface boundaries. */ - virtual void before_create_vertex (const Point_2& /* p */) - { - compare_results("before_create_vertex"); - } + virtual void before_create_vertex(const Point_2& /* p */) override + { compare_results("before_create_vertex"); } - /*! - * Notification after the creation of a new vertex. + /*! Notification after the creation of a new vertex. * \param v A handle to the created vertex. */ - virtual void after_create_vertex (Vertex_handle /* v */) - { - compare_results("after_create_vertex"); - } + virtual void after_create_vertex(Vertex_handle /* v */) override + { compare_results("after_create_vertex"); } - /*! - * Notification before the creation of a new boundary vertex. + /*! Notification before the creation of a new boundary vertex. * \param cv The curve incident to the surface boundary. * \param ind The relevant curve-end. * \param bound_x The boundary condition of the vertex in x. * \param bound_y The boundary condition of the vertex in y. */ - virtual void before_create_boundary_vertex (const X_monotone_curve_2& /*cv*/, - CGAL::Arr_curve_end /* ind */, - CGAL::Arr_parameter_space /* bound_x */, - CGAL::Arr_parameter_space /* bound_y */) - { - compare_results("before_create_boundary_vertex"); - } + virtual void + before_create_boundary_vertex(const X_monotone_curve_2& /*cv*/, + CGAL::Arr_curve_end /* ind */, + CGAL::Arr_parameter_space /* bound_x */, + CGAL::Arr_parameter_space /* bound_y */) + override + { compare_results("before_create_boundary_vertex"); } - /*! - * Notification after the creation of a new vertex at infinity. + /*! Notification after the creation of a new vertex at infinity. * \param v A handle to the created vertex. */ - virtual void after_create_boundary_vertex (Vertex_handle /* v */) - { - compare_results("after_create_boundary_vertex"); - } + virtual void after_create_boundary_vertex(Vertex_handle /* v */) override + { compare_results("after_create_boundary_vertex"); } - /*! - * Notification before the creation of a new edge. + /*! Notification before the creation of a new edge. * \param c The x-monotone curve to be associated with the edge. * \param v1 A handle to the first end-vertex of the edge. * \param v2 A handle to the second end-vertex of the edge. */ - virtual void before_create_edge (const X_monotone_curve_2& /* c */, - Vertex_handle /* v1 */, - Vertex_handle /* v2 */) - { - compare_results("before_create_edge"); - } + virtual void before_create_edge(const X_monotone_curve_2& /* c */, + Vertex_handle /* v1 */, + Vertex_handle /* v2 */) override + { compare_results("before_create_edge"); } - /*! - * Notification after the creation of a new edge. + /*! Notification after the creation of a new edge. * \param e A handle to one of the twin halfedges that were created. */ - virtual void after_create_edge (Halfedge_handle /* e */) - { - compare_results("after_create_edge"); - } + virtual void after_create_edge(Halfedge_handle /* e */) override + { compare_results("after_create_edge"); } - /*! - * Notification before the modification of an existing vertex. + /*! Notification before the modification of an existing vertex. * \param v A handle to the vertex to be updated. * \param p The point to be associated with the vertex. */ - virtual void before_modify_vertex (Vertex_handle /* v */, - const Point_2& /* p */) - { - compare_results("before_modify_vertex"); - } + virtual void before_modify_vertex(Vertex_handle /* v */, + const Point_2& /* p */) override + { compare_results("before_modify_vertex"); } - /*! - * Notification after a vertex was modified. + /*! Notification after a vertex was modified. * \param v A handle to the updated vertex. */ - virtual void after_modify_vertex (Vertex_handle /* v */) - { - compare_results("after_modify_vertex"); - } + virtual void after_modify_vertex(Vertex_handle /* v */) override + { compare_results("after_modify_vertex"); } - /*! - * Notification before the modification of an existing edge. + /*! Notification before the modification of an existing edge. * \param e A handle to one of the twin halfedges to be updated. * \param c The x-monotone curve to be associated with the edge. */ - virtual void before_modify_edge (Halfedge_handle /* e */, - const X_monotone_curve_2& /* c */) - { - compare_results("before_modify_edge"); - } + virtual void before_modify_edge(Halfedge_handle /* e */, + const X_monotone_curve_2& /* c */) override + { compare_results("before_modify_edge"); } - /*! - * Notification after an edge was modified. + /*! Notification after an edge was modified. * \param e A handle to one of the twin halfedges that were updated. */ - virtual void after_modify_edge (Halfedge_handle /* e */) - { - compare_results("after_modify_edge"); - } + virtual void after_modify_edge(Halfedge_handle /* e */) override + { compare_results("after_modify_edge"); } - /*! - * Notification before the splitting of an edge into two. + /*! Notification before the splitting of an edge into two. * \param e A handle to one of the existing halfedges. * \param v A vertex representing the split point. * \param c1 The x-monotone curve to be associated with the first edge. * \param c2 The x-monotone curve to be associated with the second edge. */ - virtual void before_split_edge (Halfedge_handle /* e */, - Vertex_handle /* v */, - const X_monotone_curve_2& /* c1 */, - const X_monotone_curve_2& /* c2 */) - { - compare_results("before_split_edge"); - } + virtual void before_split_edge(Halfedge_handle /* e */, + Vertex_handle /* v */, + const X_monotone_curve_2& /* c1 */, + const X_monotone_curve_2& /* c2 */) override + { compare_results("before_split_edge"); } - /*! - * Notification after an edge was split. + /*! Notification after an edge was split. * \param e1 A handle to one of the twin halfedges forming the first edge. * \param e2 A handle to one of the twin halfedges forming the second edge. */ - virtual void after_split_edge (Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - { - compare_results("after_split_edge"); - } + virtual void after_split_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) override + { compare_results("after_split_edge"); } - /*! - * Notification before the splitting of a fictitious edge into two. + /*! Notification before the splitting of a fictitious edge into two. * \param e A handle to one of the existing halfedges. * \param v A vertex representing the unbounded split point. */ - virtual void before_split_fictitious_edge (Halfedge_handle /* e */, - Vertex_handle /* v */) - { - compare_results("before_split_fictitious_edge"); - } + virtual void before_split_fictitious_edge(Halfedge_handle /* e */, + Vertex_handle /* v */) override + { compare_results("before_split_fictitious_edge"); } - /*! - * Notification after a fictitious edge was split. + /*! Notification after a fictitious edge was split. * \param e1 A handle to one of the twin halfedges forming the first edge. * \param e2 A handle to one of the twin halfedges forming the second edge. */ - virtual void after_split_fictitious_edge (Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - { - compare_results("after_split_fictitious_edge"); - } + virtual void after_split_fictitious_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) override + { compare_results("after_split_fictitious_edge"); } - /*! - * Notification before the splitting of a face into two. + /*! Notification before the splitting of a face into two. * \param f A handle to the existing face. * \param e The new edge whose insertion causes the face to split. */ - virtual void before_split_face (Face_handle /* f */, - Halfedge_handle /* e */) - { - compare_results("before_split_face"); - } + virtual void before_split_face(Face_handle /* f */, + Halfedge_handle /* e */) override + { compare_results("before_split_face"); } - /*! - * Notification after a face was split. + /*! Notification after a face was split. * \param f A handle to the face we have just split. * \param new_f A handle to the new face that has been created. * \param is_hole Whether the new face forms a hole inside f. */ virtual void after_split_face (Face_handle /* f */, Face_handle /* new_f */, - bool /* is_hole */) - { - compare_results("after_split_face"); - } + bool /* is_hole */) override + { compare_results("after_split_face"); } - /*! - * Notification before the splitting of an outer CCB into two. + /*! Notification before the splitting of an outer CCB into two. * \param f A handle to the face that owns the outer CCB. * \param h A circulator representing the component boundary. * \param e The new edge whose removal causes the outer CCB to split. */ - virtual void before_split_outer_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */, - Halfedge_handle /* e */) - { - compare_results("before_split_outer_ccb"); - } + virtual void before_split_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */, + Halfedge_handle /* e */) override + { compare_results("before_split_outer_ccb"); } - /*! - * Notification after an outer CCB was split. + /*! Notification after an outer CCB was split. * \param f A handle to the face that owns the outer CCBs. * \param h1 A circulator representing the boundary of the first component. * \param h2 A circulator representing the boundary of the second component. */ - virtual void after_split_outer_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */) - { - compare_results("after_split_outer_ccb"); - } + virtual void after_split_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */) override + { compare_results("after_split_outer_ccb"); } - /*! - * Notification before the splitting of an inner CCB into two. + /*! Notification before the splitting of an inner CCB into two. * \param f A handle to the face containing the inner CCB. * \param h A circulator representing the component boundary. * \param e The new edge whose removal causes the inner CCB to split. */ - virtual void before_split_inner_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */, - Halfedge_handle /* e */) - { - compare_results("before_split_inner_ccb"); - } + virtual void before_split_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */, + Halfedge_handle /* e */) override + { compare_results("before_split_inner_ccb"); } - /*! - * Notification after an inner CCB was split. + /*! Notification after an inner CCB was split. * \param f A handle to the face containing the inner CCBs. * \param h1 A circulator representing the boundary of the first component. * \param h2 A circulator representing the boundary of the second component. */ - virtual void after_split_inner_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */) - { - compare_results("after_split_inner_ccb"); - } + virtual void after_split_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */) override + { compare_results("after_split_inner_ccb"); } - /*! - * Notification before the creation of a new outer CCB of a face. + /*! Notification before the creation of a new outer CCB of a face. * \param f A handle to the face that owns the outer CCB. * \param e A halfedge along the new outer CCB. */ - virtual void before_add_outer_ccb (Face_handle /* f */, - Halfedge_handle /* e */) - { - compare_results("before_add_outer_ccb"); - } + virtual void before_add_outer_ccb(Face_handle /* f */, + Halfedge_handle /* e */) override + { compare_results("before_add_outer_ccb"); } - /*! - * Notification after an outer CCB was added to a face. + /*! Notification after an outer CCB was added to a face. * \param h A circulator representing the boundary of the new outer CCB. */ - virtual void after_add_outer_ccb (Ccb_halfedge_circulator /* h */) - { - compare_results("after_add_outer_ccb"); - } + virtual void after_add_outer_ccb(Ccb_halfedge_circulator /* h */) override + { compare_results("after_add_outer_ccb"); } - /*! - * Notification before the creation of a new inner CCB inside a face. + /*! Notification before the creation of a new inner CCB inside a face. * \param f A handle to the face containing the inner CCB. * \param e The new halfedge that forms the new inner CCB. */ - virtual void before_add_inner_ccb (Face_handle /* f */, - Halfedge_handle /* e */) - { - compare_results("before_add_inner_ccb"); - } + virtual void before_add_inner_ccb(Face_handle /* f */, + Halfedge_handle /* e */) override + { compare_results("before_add_inner_ccb"); } - /*! - * Notification after an inner CCB was created inside a face. + /*! Notification after an inner CCB was created inside a face. * \param h A circulator representing the boundary of the new inner CCB. */ - virtual void after_add_inner_ccb (Ccb_halfedge_circulator /* h */) - { - compare_results("after_add_inner_ccb"); - } + virtual void after_add_inner_ccb(Ccb_halfedge_circulator /* h */) override + { compare_results("after_add_inner_ccb"); } - /*! - * Notification before the creation of a new isolated vertex inside a face. + /*! Notification before the creation of a new isolated vertex inside a face. * \param f A handle to the face containing the isolated vertex. * \param v The isolated vertex. */ - virtual void before_add_isolated_vertex (Face_handle /* f */, - Vertex_handle /* v */) - { - compare_results("before_add_isolated_vertex"); - } + virtual void before_add_isolated_vertex(Face_handle /* f */, + Vertex_handle /* v */) override + { compare_results("before_add_isolated_vertex"); } - /*! - * Notification after an isolated vertex was created inside a face. + /*! Notification after an isolated vertex was created inside a face. * \param v The isolated vertex. */ - virtual void after_add_isolated_vertex (Vertex_handle /* v */) - { - compare_results("after_add_isolated_vertex"); - } + virtual void after_add_isolated_vertex(Vertex_handle /* v */) override + { compare_results("after_add_isolated_vertex"); } - /*! - * Notification before the merging of two edges. + /*! Notification before the merging of two edges. * \param e1 A handle to one of the halfedges forming the first edge. * \param e2 A handle to one of the halfedges forming the second edge. * \param c The x-monotone curve to be associated with the merged edge. */ - virtual void before_merge_edge (Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */, - const X_monotone_curve_2& /* c */) - { - compare_results("before_merge_edge"); - } + virtual void before_merge_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */, + const X_monotone_curve_2& /* c */) override + { compare_results("before_merge_edge"); } - /*! - * Notification after an edge was merged. + /*! Notification after an edge was merged. * \param e A handle to one of the twin halfedges forming the merged edge. */ - virtual void after_merge_edge (Halfedge_handle /* e */) - { - compare_results("after_merge_edge"); - } + virtual void after_merge_edge(Halfedge_handle /* e */) override + { compare_results("after_merge_edge"); } /*! * Notification before the merging of two fictitious edges. * \param e1 A handle to one of the halfedges forming the first edge. * \param e2 A handle to one of the halfedges forming the second edge. */ - virtual void before_merge_fictitious_edge (Halfedge_handle /* e1 */, - Halfedge_handle /* e2 */) - { - compare_results("before_merge_fictitious_edge"); - } + virtual void before_merge_fictitious_edge(Halfedge_handle /* e1 */, + Halfedge_handle /* e2 */) override + { compare_results("before_merge_fictitious_edge"); } - /*! - * Notification after a fictitious edge was merged. + /*! Notification after a fictitious edge was merged. * \param e A handle to one of the twin halfedges forming the merged edge. */ - virtual void after_merge_fictitious_edge (Halfedge_handle /* e */) - { - compare_results("after_merge_fictitious_edge"); - } + virtual void after_merge_fictitious_edge (Halfedge_handle /* e */) override + { compare_results("after_merge_fictitious_edge"); } - /*! - * Notification before the merging of two faces. + /*! Notification before the merging of two faces. * \param f1 A handle to the first face. * \param f2 A handle to the second face. * \param e The edge whose removal causes the faces to merge. */ - virtual void before_merge_face (Face_handle /* f1 */, - Face_handle /* f2 */, - Halfedge_handle /* e */) - { - compare_results("before_merge_face"); - } + virtual void before_merge_face(Face_handle /* f1 */, + Face_handle /* f2 */, + Halfedge_handle /* e */) override + { compare_results("before_merge_face"); } - /*! - * Notification after a face was merged. + /*! Notification after a face was merged. * \param f A handle to the merged face. */ - virtual void after_merge_face (Face_handle /* f */) - { - compare_results("after_merge_face"); - } + virtual void after_merge_face(Face_handle /* f */) override + { compare_results("after_merge_face"); } - /*! - * Notification before the merging of two outer CCBs. + /*! Notification before the merging of two outer CCBs. * \param f A handle to the face that owns the outer CCBs. * \param h1 A circulator representing the boundary of the first component. * \param h2 A circulator representing the boundary of the second component. * \param e The edge whose insertion or removal causes the CCBs to merge. */ - virtual void before_merge_outer_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */, - Halfedge_handle /* e */) - { - compare_results("before_merge_outer_ccb"); - } + virtual void before_merge_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */, + Halfedge_handle /* e */) override + { compare_results("before_merge_outer_ccb"); } - /*! - * Notification after an outer CCB was merged. + /*! Notification after an outer CCB was merged. * \param f A handle to the face that owns the outer CCBs. * \param h A circulator representing the boundary of the merged component. */ - virtual void after_merge_outer_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("after_merge_outer_ccb"); - } + virtual void after_merge_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) + { compare_results("after_merge_outer_ccb"); } - /*! - * Notification before the merging of two inner CCBs (holes). + /*! Notification before the merging of two inner CCBs (holes). * \param f A handle to the face that contains the inner CCBs. * \param h1 A circulator representing the boundary of the first component. * \param h2 A circulator representing the boundary of the second component. * \param e The edge whose insertion causes the inner CCBs to merge. */ - virtual void before_merge_inner_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h1 */, - Ccb_halfedge_circulator /* h2 */, - Halfedge_handle /* e */) - { - compare_results("before_merge_inner_ccb"); - } + virtual void before_merge_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h1 */, + Ccb_halfedge_circulator /* h2 */, + Halfedge_handle /* e */) override + { compare_results("before_merge_inner_ccb"); } - /*! - * Notification after an inner CCB was merged. + /*! Notification after an inner CCB was merged. * \param f A handle to the face that contains the inner CCBs. * \param h A circulator representing the boundary of the merged component. */ - virtual void after_merge_inner_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("after_merge_inner_ccb"); - } + virtual void after_merge_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) override + { compare_results("after_merge_inner_ccb"); } - /*! - * Notification before an outer CCB is moved from one face to another. + /*! Notification before an outer CCB is moved from one face to another. * \param from_f A handle to the face that currently owns the outer CCB. * \param to_f A handle to the face that should own the outer CCB. * \param h A circulator representing the boundary of the component. */ - virtual void before_move_outer_ccb (Face_handle /* from_f */, - Face_handle /* to_f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("before_move_outer_ccb"); - } + virtual void before_move_outer_ccb(Face_handle /* from_f */, + Face_handle /* to_f */, + Ccb_halfedge_circulator /* h */) override + { compare_results("before_move_outer_ccb"); } - /*! - * Notification after an outer CCB is moved from one face to another. + /*! Notification after an outer CCB is moved from one face to another. * \param h A circulator representing the boundary of the component. */ - virtual void after_move_outer_ccb (Ccb_halfedge_circulator /* h */) - { - compare_results("after_move_outer_ccb"); - } + virtual void after_move_outer_ccb(Ccb_halfedge_circulator /* h */) override + { compare_results("after_move_outer_ccb"); } - /*! - * Notification before an inner CCB is moved from one face to another. + /*! Notification before an inner CCB is moved from one face to another. * \param from_f A handle to the face currently containing the inner CCB. * \param to_f A handle to the face that should contain the inner CCB. * \param h A circulator representing the boundary of the component. */ - virtual void before_move_inner_ccb (Face_handle /* from_f */, - Face_handle /* to_f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("before_move_inner_ccb"); - } + virtual void before_move_inner_ccb(Face_handle /* from_f */, + Face_handle /* to_f */, + Ccb_halfedge_circulator /* h */) override + { compare_results("before_move_inner_ccb"); } - /*! - * Notification after an inner CCB is moved from one face to another. + /*! Notification after an inner CCB is moved from one face to another. * \param h A circulator representing the boundary of the component. */ - virtual void after_move_inner_ccb (Ccb_halfedge_circulator /* h */) - { - compare_results("after_move_inner_ccb"); - } + virtual void after_move_inner_ccb(Ccb_halfedge_circulator /* h */) override + { compare_results("after_move_inner_ccb"); } - /*! - * Notification before an isolated vertex is moved from one face to another. + /*! Notification before an isolated vertex is moved from one face to another. * \param from_f A handle to the face currently containing the vertex. * \param to_f A handle to the face that should contain the vertex. * \param v The isolated vertex. */ - virtual void before_move_isolated_vertex (Face_handle /* from_f */, - Face_handle /* to_f */, - Vertex_handle /* v */) - { - compare_results("before_move_isolated_vertex"); - } + virtual void before_move_isolated_vertex(Face_handle /* from_f */, + Face_handle /* to_f */, + Vertex_handle /* v */) override + { compare_results("before_move_isolated_vertex"); } - /*! - * Notification after an isolated vertex is moved from one face to another. + /*! Notification after an isolated vertex is moved from one face to another. * \param v The isolated vertex. */ - virtual void after_move_isolated_vertex (Vertex_handle /* v */) - { - compare_results("after_move_isolated_vertex"); - } + virtual void after_move_isolated_vertex(Vertex_handle /* v */) override + { compare_results("after_move_isolated_vertex"); } - /*! - * Notificaion before the removal of a vertex. + /*! Notificaion before the removal of a vertex. * \param v A handle to the vertex to be deleted. */ - virtual void before_remove_vertex (Vertex_handle /* v */) - { - compare_results("before_remove_vertex"); - } + virtual void before_remove_vertex(Vertex_handle /* v */) override + { compare_results("before_remove_vertex"); } - /*! - * Notificaion after the removal of a vertex. + /*! Notificaion after the removal of a vertex. */ - virtual void after_remove_vertex () - { - compare_results("after_remove_vertex"); - } + virtual void after_remove_vertex() override + { compare_results("after_remove_vertex"); } - /*! - * Notification before the removal of an edge. + /*! Notification before the removal of an edge. * \param e A handle to one of the twin halfedges to be deleted. */ - virtual void before_remove_edge (Halfedge_handle /* e */) - { - compare_results("before_remove_edge"); - } + virtual void before_remove_edge(Halfedge_handle /* e */) override + { compare_results("before_remove_edge"); } - /*! - * Notificaion after the removal of an edge. + /*! Notificaion after the removal of an edge. */ - virtual void after_remove_edge () - { - compare_results("after_remove_edge"); - } + virtual void after_remove_edge() override + { compare_results("after_remove_edge"); } - /*! - * Notification before the removal of an outer CCB. + /*! Notification before the removal of an outer CCB. * \param f The face that owns the outer CCB. * \param h A circulator representing the boundary of the component. */ - virtual void before_remove_outer_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("before_remove_outer_ccb"); - } + virtual void before_remove_outer_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) override + { compare_results("before_remove_outer_ccb"); } - /*! - * Notificaion after the removal of an outer CCB. + /*! Notificaion after the removal of an outer CCB. * \param f The face that used to own the outer CCB. */ - virtual void after_remove_outer_ccb (Face_handle /* f */) - { - compare_results("after_remove_outer_ccb"); - } + virtual void after_remove_outer_ccb(Face_handle /* f */) override + { compare_results("after_remove_outer_ccb"); } - /*! - * Notification before the removal of an inner CCB. + /*! Notification before the removal of an inner CCB. * \param f The face containing the inner CCB. * \param h A circulator representing the boundary of the component. */ - virtual void before_remove_inner_ccb (Face_handle /* f */, - Ccb_halfedge_circulator /* h */) - { - compare_results("before_remove_inner_ccb"); - } + virtual void before_remove_inner_ccb(Face_handle /* f */, + Ccb_halfedge_circulator /* h */) override + { compare_results("before_remove_inner_ccb"); } - /*! - * Notificaion after the removal of an inner CCB. + /*! Notificaion after the removal of an inner CCB. * \param f The face that used to contain the inner CCB. */ - virtual void after_remove_inner_ccb (Face_handle /* f */) - { - compare_results("after_remove_inner_ccb"); - } + virtual void after_remove_inner_ccb(Face_handle /* f */) override + { compare_results("after_remove_inner_ccb"); } //@} }; -int main (int argc, char * argv[]) -{ - if (argc != 2) - { +int main (int argc, char* argv[]) { + if (argc != 2) { std::cout << "Usage: " << argv[0] << " inputfile" << std::endl; CGAL_error(); } - else - { + else { // Construct the arrangement containing one diamond-shaped face. Arrangement_2 arr; global_input_file.open(argv[1]); @@ -721,55 +546,48 @@ int main (int argc, char * argv[]) int i_vh = 0, i_heh = 0; std::vector heh_vec; std::vector vh_vec; - while (!global_input_file.eof()) - { + while (! global_input_file.eof()) { skip_comments(global_input_file, one_line); std::istringstream str_stream(one_line); char c; str_stream >> c; if (!global_input_file.gcount()) break; - if (c=='s') - { + if (c=='s') { str_stream >> c; //read segment str_stream >> s; - if (c=='i') - { + if (c=='i') { // si means insert intersecting segment insert(arr,s); std::cout << "intersecting segment insert " << s << std::endl; } - else if (c=='n') - { + else if (c=='n') { // sn means insert non intersecting segment heh_vec.push_back(insert_non_intersecting_curve (arr, s)); std::cout << "non intersecting segment insert " << s << std::endl; } } - else if (c=='p') - { + else if (c=='p') { // p means read point str_stream >> p ; - std::cout << "point insert " << p << " index " << vh_vec.size() << std::endl; + std::cout << "point insert " << p << " index " << vh_vec.size() + << std::endl; vh_vec.push_back(insert_point(arr,p)); } - else if (c=='e') - { + else if (c=='e') { // e means read edge index to be removed str_stream >> i_heh ; std::cout << "remove edge " << heh_vec[i_heh]->curve() << std::endl; remove_edge(arr,heh_vec[i_heh]); } - else if (c=='v') - { + else if (c=='v') { // v means read point index to be removed str_stream >> i_vh ; std::cout << "remove point " << vh_vec[i_vh]->point() << std::endl; remove_vertex(arr,vh_vec[i_vh]); } - else - { + else { //error std::cout << "error, unknowen command" << std::endl; return -1; diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h index 757ef127412..2934d17f189 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h @@ -1584,19 +1584,16 @@ protected: // observer for the minimization diagram // keeps the relevant data in the new faces - class Keep_face_data_observer : public Md_observer - { + class Keep_face_data_observer : public Md_observer { public: - typedef typename Minimization_diagram_2::Face_handle Face_handle; + using Base_aos = typename Minimization_diagram_2::Base_aos; + using Face_handle = typename Base_aos::Face_handle; - Keep_face_data_observer(Minimization_diagram_2& arr) : - Md_observer(arr) - {} + Keep_face_data_observer(Base_aos& arr) : Md_observer(arr) {} virtual void after_split_face(Face_handle org_f, Face_handle new_f, - bool /* is_hole*/) - { + bool /* is_hole*/) override { // update data in the new face from the original face if (org_f->get_aux_is_set(0)) new_f->set_aux_source(0, org_f->get_aux_source(0)); @@ -1610,34 +1607,30 @@ protected: // observer for the minimization diagram // keeps the relevant data in the new edges & vertices - class Keep_edge_data_observer : public Md_observer - { + class Keep_edge_data_observer : public Md_observer { public: - typedef typename Minimization_diagram_2::Halfedge_handle Halfedge_handle; - typedef typename Minimization_diagram_2::Vertex_handle Vertex_handle; - typedef typename Minimization_diagram_2::X_monotone_curve_2 - X_monotone_curve_2; + using Base_aos = typename Minimization_diagram_2::Base_aos; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2; - typedef typename Envelope_divide_and_conquer_3::Self Self; - Keep_edge_data_observer(Minimization_diagram_2& arr, - Self* b) : + using Self = typename Envelope_divide_and_conquer_3::Self; + Keep_edge_data_observer(Base_aos& arr, Self* b) : Md_observer(arr), base(b) - { - CGAL_assertion(base != nullptr); - } + { CGAL_assertion(base != nullptr); } - /* virtual void before_split_edge (Halfedge_handle e, - * Vertex_handle v, - * const X_monotone_curve_2& c1, - * const X_monotone_curve_2& c2) + /* virtual void before_split_edge(Halfedge_handle e, + * Vertex_handle v, + * const X_monotone_curve_2& c1, + * const X_monotone_curve_2& c2) * {} */ virtual void after_split_edge(Halfedge_handle he1, Halfedge_handle he2) - { + override { // update data of the new vertex, which is the common vertex of he1 and // he2, and of the new edge according to the data in the original edge CGAL_assertion(he2->source() == he1->target()); @@ -1657,20 +1650,17 @@ protected: // the second halfedge Halfedge_handle org_he = he1, new_he = he2; - if (org_he->is_decision_set()) - { + if (org_he->is_decision_set()) { new_he->set_decision(org_he->get_decision()); new_he->twin()->set_decision(org_he->get_decision()); new_vertex->set_decision(org_he->get_decision()); } - if (org_he->get_aux_is_set(0)) - { + if (org_he->get_aux_is_set(0)) { new_vertex->set_aux_source(0, org_he->get_aux_source(0)); new_he->set_aux_source(0, org_he->get_aux_source(0)); new_he->twin()->set_aux_source(0, org_he->twin()->get_aux_source(0)); } - if (org_he->get_aux_is_set(1)) - { + if (org_he->get_aux_is_set(1)) { new_vertex->set_aux_source(1, org_he->get_aux_source(1)); new_he->set_aux_source(1, org_he->get_aux_source(1)); new_he->twin()->set_aux_source(1, org_he->twin()->get_aux_source(1)); diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index 413559ace7e..5a20790628e 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -1978,14 +1978,13 @@ protected: // so we can later identify all the faces that form the original given face // it also should remember the edges of the face, that are also projected // intersections - class Copied_face_observer : public Md_observer - - { + class Copied_face_observer : public Md_observer { public: - typedef typename Minimization_diagram_2::Face_handle Face_handle; - typedef typename Minimization_diagram_2::Halfedge_handle Halfedge_handle; - typedef typename Minimization_diagram_2::X_monotone_curve_2 - X_monotone_curve_2; + using Base_aos = typename Minimization_diagram_2::Base_aos; + + using Face_handle = typename Base_aos::Face_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2; Copied_face_observer(Halfedges_map& map_h) : map_halfedges(map_h) {} @@ -1997,8 +1996,7 @@ protected: Faces_hash& parts, Vertices_hash& boundaryv, Vertices_hash& specialv, - Vertices_to_edges_map& v_to_h) - { + Vertices_to_edges_map& v_to_h) { boundary_halfedges = &boundary; special_edges = &specialh; new_edges = &newh; @@ -2009,20 +2007,16 @@ protected: } virtual void after_split_face(Face_handle org_f, - Face_handle new_f, bool) - { + Face_handle new_f, bool) override { // keep track of the face parts if (face_parts->is_defined(org_f)) (*face_parts)[new_f] = face_parts->default_value(); } virtual void after_split_edge(Halfedge_handle org_he, - Halfedge_handle new_he) - { + Halfedge_handle new_he) override { // take care of special edges that were split - if (special_edges->is_defined(org_he)) - - { + if (special_edges->is_defined(org_he)) { // if original edge was in the set, then now both split parts should // be in the set (*special_edges)[new_he] = special_edges->default_value(); @@ -2030,15 +2024,13 @@ protected: } // take care of new edges that were split - if (new_edges->is_defined(org_he)) - { + if (new_edges->is_defined(org_he)) { (*new_edges)[new_he] = (*new_edges)[org_he]; (*new_edges)[new_he->twin()] = (*new_edges)[org_he]; } // take care for boundary edges - if (boundary_halfedges->is_defined(org_he)) - { + if (boundary_halfedges->is_defined(org_he)) { (*boundary_halfedges)[new_he] = boundary_halfedges->default_value(); (*boundary_halfedges)[new_he->twin()] = boundary_halfedges->default_value(); @@ -2065,8 +2057,7 @@ protected: Halfedge_handle correct_side_he; if (face_parts->is_defined(org_he->face())) correct_side_he = org_he; - else - { + else { CGAL_assertion(face_parts->is_defined(new_he->twin()->face())); // new_he->twin() is directed as org_he, so on the boundary pointing // inside the face, and has the new vertex as target @@ -2079,7 +2070,8 @@ protected: //BZBZ /* CGAL_assertion(vertices_to_halfedges->is_defined(correct_side_he->source()) && vertices_to_halfedges->is_defined(correct_side_he->next()->target()));*/ - (*vertices_to_halfedges)[correct_side_he->next()->target()] = correct_side_he->next(); + (*vertices_to_halfedges)[correct_side_he->next()->target()] = + correct_side_he->next(); if (correct_side_he == org_he && face_parts->is_defined(org_he->twin()->face())) @@ -2099,46 +2091,42 @@ protected: Halfedges_map& map_halfedges; }; - // this observer is used in the process of resolving a face // it listens to what happens in the copied arrangement, and copies back // the actions to result arrangements very efficiently - class Copy_observer : public Md_observer - { + class Copy_observer : public Md_observer { public: - typedef typename Minimization_diagram_2::Face_handle Face_handle; - typedef typename Minimization_diagram_2::Halfedge_handle Halfedge_handle; - typedef typename Minimization_diagram_2::Vertex_handle Vertex_handle; - typedef typename Minimization_diagram_2::Point_2 Point_2; - typedef typename Minimization_diagram_2::X_monotone_curve_2 - X_monotone_curve_2; - typedef typename Minimization_diagram_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; + using Base_aos = typename Minimization_diagram_2::Base_aos; - typedef typename Traits::Left_side_category Left_side_category; - typedef typename Traits::Right_side_category Right_side_category; - typedef typename Traits::Top_side_category Top_side_category; - typedef typename Traits::Bottom_side_category Bottom_side_category; + using Face_handle = typename Base_aos::Face_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Point_2 = typename Base_aos::Point_2; + using X_monotone_curve_2 = typename Base_aos::X_monotone_curve_2; + using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator; + + using Left_side_category = typename Traits::Left_side_category; + using Right_side_category = typename Traits::Right_side_category; + using Top_side_category = typename Traits::Top_side_category; + using Bottom_side_category = typename Traits::Bottom_side_category; Copy_observer(Minimization_diagram_2& small_, Minimization_diagram_2& big, Halfedges_map& map_h, - Vertices_map& map_v, - Faces_map& map_f) - : small_arr(small_), big_arr(big), - big_arr_accessor(big_arr), - map_halfedges(map_h), - map_vertices(map_v), - map_faces(map_f) + Vertices_map& map_v, + Faces_map& map_f) : + small_arr(small_), big_arr(big), + big_arr_accessor(big_arr), + map_halfedges(map_h), + map_vertices(map_v), + map_faces(map_f) {} virtual ~Copy_observer() {} - virtual void before_create_vertex (const Point_2& /* p */) - {} + virtual void before_create_vertex (const Point_2& /* p */) override {} - virtual void after_create_vertex (Vertex_handle v) - { + virtual void after_create_vertex (Vertex_handle v) override { // should create a new vertex with v->point() inside Vertex_handle new_v = big_arr_accessor.create_vertex(v->point()); @@ -2149,11 +2137,11 @@ protected: new_vertices.push_back(v); } - void before_create_boundary_vertex (const X_monotone_curve_2& cv, - Arr_curve_end ind, - Arr_parameter_space in_ps_x, - Arr_parameter_space in_ps_y) - { + virtual void before_create_boundary_vertex(const X_monotone_curve_2& cv, + Arr_curve_end ind, + Arr_parameter_space in_ps_x, + Arr_parameter_space in_ps_y) + override { boundary_vertex_cv = cv; boundary_vertex_ind = ind; ps_x = in_ps_x; @@ -2163,8 +2151,7 @@ protected: bool is_bounded_impl(Arr_open_side_tag) { return false; } bool is_bounded_impl(Arr_boundary_side_tag) { return true; } - bool is_bounded() - { + bool is_bounded() { // This is the case of create boundary vertex. CGAL_assertion((ps_x != ARR_INTERIOR) || (ps_y != ARR_INTERIOR)); @@ -2184,8 +2171,7 @@ protected: return true; } - void after_create_boundary_vertex(Vertex_handle v) - { + virtual void after_create_boundary_vertex(Vertex_handle v) override { CGAL_assertion(big_arr.is_valid()); Vertex_handle new_v = big_arr_accessor.create_boundary_vertex(boundary_vertex_cv, @@ -2199,16 +2185,15 @@ protected: map_vertices[v] = new_v; } - void before_split_fictitious_edge(Halfedge_handle e, - Vertex_handle v) - { + virtual void + before_split_fictitious_edge(Halfedge_handle e, Vertex_handle v) override { split_fict_v = v; split_fict_e = e; } - void after_split_fictitious_edge(Halfedge_handle e1, - Halfedge_handle e2) - { + virtual void + after_split_fictitious_edge(Halfedge_handle e1, Halfedge_handle e2) + override { // find the corresponding split vertex in big_arr CGAL_assertion(map_vertices.is_defined(split_fict_v)); Vertex_handle big_v = map_vertices[split_fict_v]; @@ -2235,8 +2220,7 @@ protected: virtual void before_create_edge(const X_monotone_curve_2& /* c */, Vertex_handle v1, - Vertex_handle v2) - { + Vertex_handle v2) override { // save state for after_create_edge event create_edge_v1 = v1; create_edge_v2 = v2; @@ -2244,9 +2228,7 @@ protected: is_in_relocate = false; } - virtual void after_create_edge(Halfedge_handle e) - - { + virtual void after_create_edge(Halfedge_handle e) override { // a new edge e was created in small_arr, we should create a corresponding // edge in big_arr CGAL_assertion(map_vertices.is_defined(create_edge_v1)); @@ -2260,18 +2242,14 @@ protected: // if we have 2 new vertices, they must be new. // if we have only one, we should check which is new bool v1_is_new = false, v2_is_new = false; - if (new_vertices.size() == 1) - { - if (new_vertices.back() == create_edge_v1) - v1_is_new = true; - else - { + if (new_vertices.size() == 1) { + if (new_vertices.back() == create_edge_v1) v1_is_new = true; + else { CGAL_assertion(new_vertices.back() == create_edge_v2); v2_is_new = true; } } - if (new_vertices.size() == 2) - { + if (new_vertices.size() == 2) { v1_is_new = true; v2_is_new = true; } @@ -2285,15 +2263,13 @@ protected: // if an endpoint is not new, but is isolated, we should remove it from // its face's isolated vertices list, and treat it as new - if (!v1_is_new && big_v1->is_isolated()) - { + if (!v1_is_new && big_v1->is_isolated()) { //Face_handle f = big_v1->face(); //big_arr.incident_face(big_v1); //big_arr_accessor.find_and_erase_isolated_vertex(f, big_v1); big_arr_accessor.remove_isolated_vertex_ex(big_v1); v1_is_new = true; } - if (!v2_is_new && big_v2->is_isolated()) - { + if (! v2_is_new && big_v2->is_isolated()) { //Face_handle f = big_v2->face(); //big_arr.incident_face(big_v2); //big_arr_accessor.find_and_erase_isolated_vertex(f, big_v2); big_arr_accessor.remove_isolated_vertex_ex(big_v2); @@ -2301,8 +2277,7 @@ protected: } // now use the approppriate method to insert the new edge - if (v1_is_new && v2_is_new) - { + if (v1_is_new && v2_is_new) { // if both vertices are new - use the O(1) operation // _insert_in_face_interior (in the face mapped to by he->face()) CGAL_assertion(map_faces.is_defined(he->face())); @@ -2319,8 +2294,7 @@ protected: map_halfedges[he] = new_he; map_halfedges[he->twin()] = new_he->twin(); } - else if (!v1_is_new && !v2_is_new) - { + else if (! v1_is_new && !v2_is_new) { // if both vertices are old - use _insert_at_vertices // this is a linear action by the size of the faces involved // we can get relevant prev halfedges from he @@ -2360,8 +2334,7 @@ protected: // if a new face was created update its mapping too // the new face is the incident face of he - if (new_face) - { + if (new_face) { map_faces[he->face()] = new_he->face(); // save state for move_hole/move_isolated_vertex events is_in_relocate = true; @@ -2372,16 +2345,14 @@ protected: CGAL_assertion(map_faces.is_defined(he->face()) && map_faces[he->face()] == new_he->face()); } - else - { + else { // only one vertex is new - use the O(1) operation _insert_from_vertex // we can get the relevant prev halfedge from e Halfedge_handle prev = he->prev(); CGAL_assertion(map_halfedges.is_defined(prev)); Halfedge_handle big_prev = map_halfedges[prev]; Halfedge_handle new_he; - if (!v1_is_new) - { + if (!v1_is_new) { new_he = big_arr_accessor.insert_from_vertex_ex(big_prev, he->curve(), (HE_COMP_RES(he) == SMALLER ? ARR_LEFT_TO_RIGHT : ARR_RIGHT_TO_LEFT), big_v2); @@ -2391,8 +2362,7 @@ protected: map_halfedges[he] = new_he; map_halfedges[he->twin()] = new_he->twin(); } - else - { + else { new_he = big_arr_accessor.insert_from_vertex_ex(big_prev, he->curve(), (HE_COMP_RES(he->twin()) == SMALLER ? ARR_LEFT_TO_RIGHT : ARR_RIGHT_TO_LEFT), @@ -2410,14 +2380,13 @@ protected: Vertex_handle v, const X_monotone_curve_2& /* c1 */, const X_monotone_curve_2& /* c2 */) - { + override { // save state info for using _split_edge in after event split_v = v; split_e = e; } - virtual void after_split_edge (Halfedge_handle e1, - Halfedge_handle e2) - { + virtual void after_split_edge(Halfedge_handle e1, + Halfedge_handle e2) override { // find the corresponding split vertex in big_arr CGAL_assertion(map_vertices.is_defined(split_v)); Vertex_handle big_v = map_vertices[split_v]; @@ -2448,11 +2417,10 @@ protected: } virtual void before_add_isolated_vertex(Face_handle f, - Vertex_handle /* v */) - { - saved_face = f; - } - virtual void after_add_isolated_vertex(Vertex_handle v) + Vertex_handle /* v */) override + { saved_face = f; } + + virtual void after_add_isolated_vertex(Vertex_handle v) override { // make sure it is the only new vertex right now CGAL_assertion(new_vertices.size() == 1 && @@ -2475,15 +2443,14 @@ protected: virtual void before_move_inner_ccb(Face_handle from_f, Face_handle to_f, - Ccb_halfedge_circulator ) - { + Ccb_halfedge_circulator) override { // should be used after insert_at_vertices which creates a new face CGAL_assertion(is_in_relocate); move_from = from_f; move_to = to_f; } - virtual void after_move_inner_ccb(Ccb_halfedge_circulator h) - { + + virtual void after_move_inner_ccb(Ccb_halfedge_circulator h) override { CGAL_assertion(map_faces.is_defined(move_from)); CGAL_assertion(map_faces.is_defined(move_to)); CGAL_assertion(map_halfedges.is_defined(h)); @@ -2500,16 +2467,14 @@ protected: virtual void before_move_isolated_vertex(Face_handle from_f, Face_handle to_f, - Vertex_handle ) - { + Vertex_handle) override { // should be used after insert_at_vertices which creates a new face CGAL_assertion(is_in_relocate); move_from = from_f; move_to = to_f; } - virtual void after_move_isolated_vertex(Vertex_handle v) - { + virtual void after_move_isolated_vertex(Vertex_handle v) override { CGAL_assertion(map_faces.is_defined(move_from)); CGAL_assertion(map_faces.is_defined(move_to)); CGAL_assertion(map_vertices.is_defined(v)); @@ -2524,12 +2489,12 @@ protected: protected: Minimization_diagram_2& small_arr; Minimization_diagram_2& big_arr; - Md_accessor big_arr_accessor; + Md_accessor big_arr_accessor; // mappings between small_arr features to big_arr features Halfedges_map& map_halfedges; - Vertices_map& map_vertices; - Faces_map& map_faces; + Vertices_map& map_vertices; + Faces_map& map_faces; std::deque new_vertices; // state for actions @@ -2537,25 +2502,23 @@ protected: Vertex_handle create_edge_v2; Vertex_handle split_v, split_fict_v; Halfedge_handle split_e, split_fict_e; - Face_handle saved_face; - Face_handle move_from; - Face_handle move_to; + Face_handle saved_face; + Face_handle move_from; + Face_handle move_to; // for the create_vertex call-back - X_monotone_curve_2 boundary_vertex_cv; - Arr_curve_end boundary_vertex_ind; + X_monotone_curve_2 boundary_vertex_cv; + Arr_curve_end boundary_vertex_ind; Arr_parameter_space ps_x; Arr_parameter_space ps_y; bool is_in_relocate; - }; // A zone visitor for the Minimization Diagram which only inserts // parts of the curve which are inside a given face // it also remembers those parts which overlap the boundary of the original // face - class Copied_face_zone_visitor - { + class Copied_face_zone_visitor { public: typedef typename Minimization_diagram_2::Vertex_handle Vertex_handle; typedef typename Minimization_diagram_2::Halfedge_handle Halfedge_handle; @@ -2639,7 +2602,7 @@ protected: // the zone visitor functions /*! Initialize the visitor with an arrangement object. */ - void init (Minimization_diagram_2* arr) + void init(Minimization_diagram_2* arr) { CGAL_assertion(&copied_arr == arr); insert_visitor.init(arr); @@ -2821,8 +2784,7 @@ protected: result_new_he->twin()->set_has_equal_aux_data_in_target_and_face(1, flag); } } - else - { + else { result_new_he->twin()->set_is_equal_aux_data_in_target(0, true); result_new_he->twin()->set_is_equal_aux_data_in_target(1, true); result_new_he->twin()->set_has_equal_aux_data_in_target(0, true); @@ -2833,8 +2795,7 @@ protected: return base_result; } - else - { + else { // we don't insert the subcurve, but it might touch a vertex of the // face's boundary - we need to check it and identify special vertices if (left_v != Vertex_handle(nullptr) && @@ -2852,8 +2813,7 @@ protected: } } - /*! - * Handle the a subcurve that overlaps a given edge. + /*! Handle the a subcurve that overlaps a given edge. * \param cv The overlapping subcurve. * \param he The overlapped halfedge (directed from left to right). * \param left_v The vertex that corresponds to the left endpoint of cv @@ -2906,7 +2866,6 @@ protected: } /*! - * Handle point that lies inside a given face. * \param p The point. * \param face The face inside which the point lies. @@ -3134,18 +3093,18 @@ protected: Vertices_list& result_special_vertices; // helper collections (for copied_arr features) - Halfedges_hash copied_arr_boundary_halfedges; - Vertices_hash copied_arr_orig_vertices; - Vertices_hash copied_arr_new_boundary_vertices; + Halfedges_hash copied_arr_boundary_halfedges; + Vertices_hash copied_arr_orig_vertices; + Vertices_hash copied_arr_new_boundary_vertices; Vertices_to_edges_map copied_vertices_to_halfedges; - Halfedges_hash copied_arr_special_edges; + Halfedges_hash copied_arr_special_edges; Halfedges_hash_w_type copied_arr_new_edges; - Faces_hash copied_face_parts; - Vertices_hash copied_arr_special_vertices; + Faces_hash copied_face_parts; + Vertices_hash copied_arr_special_vertices; // this observer will take care of the result arrangegment - Copy_observer md_copy_observer; + Copy_observer md_copy_observer; // this observer will keep all our information in the helper collections // during the insert process @@ -3160,26 +3119,23 @@ protected: }; // this minimization diagram observer updates data in new faces created - class New_faces_observer : public Md_observer - { + class New_faces_observer : public Md_observer { public: - typedef typename Minimization_diagram_2::Face_handle Face_handle; + using Base_aos = typename Minimization_diagram_2::Base_aos; + using Face_handle = typename Base_aos::Face_handle; - New_faces_observer(Minimization_diagram_2& arr) : Md_observer(arr) {} + New_faces_observer(Base_aos& arr) : Md_observer(arr) {} virtual ~New_faces_observer() {} - virtual void after_split_face(Face_handle org_f, - Face_handle new_f, - bool) - { + virtual void after_split_face(Face_handle org_f, Face_handle new_f, bool) + override { // update the new face's aux_data from original face if (org_f->get_aux_is_set(0)) new_f->set_aux_source(0, org_f->get_aux_source(0)); if (org_f->get_aux_is_set(1)) new_f->set_aux_source(1, org_f->get_aux_source(1)); } - }; //! The geometry traits object. diff --git a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h index d040ccb7158..28a13dd4dcd 100644 --- a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h +++ b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h @@ -79,10 +79,13 @@ private: // face mergers. class My_observer : public Arrangement_2::Observer { public: - My_observer(Arrangement_2& arr) : Arrangement_2::Observer(arr) {} + using Base_aos = typename Arrangement_2::Base_aos; + using Face_handle = typename Base_aos::Face_handle; + + My_observer(Base_aos& arr) : Arrangement_2::Observer(arr) {} virtual void after_split_face(Face_handle f, Face_handle new_f, - bool /* is_hole */) + bool /* is_hole */) override { if (f->contained()) new_f->set_contained(true); } }; diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index 63f59bba6ec..b1b552a0290 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -87,61 +87,81 @@ private: // Observer to track any changes of the attached arrangement. class Observer : public Arrangement_2::Observer { - - typedef typename Arrangement_2::Observer Base; - typedef Observer Self; - + using Base = typename Arrangement_2::Observer; + using Self = Observer; public: + using Base_aos = typename Arrangement_2::Base_aos; + using Vertex_handle = typename Base_aos::Vertex_handle; + using Halfedge_handle = typename Base_aos::Halfedge_handle; + using Face_handle = typename Base_aos::Face_handle; + using Ccb_halfedge_circulator = typename Base_aos::Ccb_halfedge_circulator; + bool has_changed; - Observer() : Base(), has_changed(false) - {} + Observer() : Base(), has_changed(false) {} - Observer(const Arrangement_2& arr) - : Base(const_cast(arr)), has_changed(false) + Observer(const Base_aos& arr) : + Base(const_cast(arr)), has_changed(false) {} // Aos_observer interface - void after_attach() { has_changed = false; } + virtual void after_attach() override { has_changed = false; } - - void after_global_change() { has_changed = true; } - void after_create_vertex(Vertex_handle) { has_changed = true; } - void after_create_boundary_vertex(Vertex_handle) { has_changed = true; } - void after_create_edge(Halfedge_handle) { has_changed = true; } - void after_modify_vertex(Vertex_handle) { has_changed = true; } - void after_modify_edge(Halfedge_handle) { has_changed = true; } - void after_split_edge(Halfedge_handle, Halfedge_handle) { - has_changed = true; } - void after_split_fictitious_edge(Halfedge_handle, Halfedge_handle) { - has_changed = true; } - void after_split_face(Face_handle, Face_handle, bool) { - has_changed = true; } - void after_split_outer_ccb(Face_handle, Ccb_halfedge_circulator, - Ccb_halfedge_circulator) { - has_changed = true; } - void after_split_inner_ccb(Face_handle, Ccb_halfedge_circulator, - Ccb_halfedge_circulator) { - has_changed = true; } - void after_add_outer_ccb(Ccb_halfedge_circulator) { has_changed = true; } - void after_add_inner_ccb(Ccb_halfedge_circulator) { has_changed = true; } - void after_add_isolated_vertex(Vertex_handle) { has_changed = true; } - void after_merge_edge(Halfedge_handle) { has_changed = true; } - void after_merge_fictitious_edge(Halfedge_handle) { has_changed = true; } - void after_merge_face(Face_handle) { has_changed = true; } - void after_merge_outer_ccb(Face_handle, Ccb_halfedge_circulator) { - has_changed = true; } - void after_merge_inner_ccb(Face_handle, Ccb_halfedge_circulator) { - has_changed = true; } - void after_move_outer_ccb(Ccb_halfedge_circulator) { has_changed = true; } - void after_move_inner_ccb(Ccb_halfedge_circulator) { has_changed = true; } - void after_move_isolated_vertex(Vertex_handle) { has_changed = true; } - void after_remove_vertex() { has_changed = true; } - void after_remove_edge() { has_changed = true; } - void after_remove_outer_ccb(Face_handle) { has_changed = true; } - void after_remove_inner_ccb(Face_handle) { has_changed = true; } + virtual void after_global_change() override { has_changed = true; } + virtual void after_create_vertex(Vertex_handle) override + { has_changed = true; } + virtual void after_create_boundary_vertex(Vertex_handle) override + { has_changed = true; } + virtual void after_create_edge(Halfedge_handle) override + { has_changed = true; } + virtual void after_modify_vertex(Vertex_handle) override + { has_changed = true; } + virtual void after_modify_edge(Halfedge_handle) override + { has_changed = true; } + virtual void after_split_edge(Halfedge_handle, Halfedge_handle) override + { has_changed = true; } + virtual void after_split_fictitious_edge(Halfedge_handle, Halfedge_handle) + override + { has_changed = true; } + virtual void after_split_face(Face_handle, Face_handle, bool) override + { has_changed = true; } + virtual void after_split_outer_ccb(Face_handle, Ccb_halfedge_circulator, + Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_split_inner_ccb(Face_handle, Ccb_halfedge_circulator, + Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_add_outer_ccb(Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_add_inner_ccb(Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_add_isolated_vertex(Vertex_handle) override + { has_changed = true; } + virtual void after_merge_edge(Halfedge_handle) override + { has_changed = true; } + virtual void after_merge_fictitious_edge(Halfedge_handle) override + { has_changed = true; } + virtual void after_merge_face(Face_handle) override { has_changed = true; } + virtual void after_merge_outer_ccb(Face_handle, Ccb_halfedge_circulator) + override + { has_changed = true; } + virtual void after_merge_inner_ccb(Face_handle, Ccb_halfedge_circulator) + override + { has_changed = true; } + virtual void after_move_outer_ccb(Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_move_inner_ccb(Ccb_halfedge_circulator) override + { has_changed = true; } + virtual void after_move_isolated_vertex(Vertex_handle) override + { has_changed = true; } + virtual void after_remove_vertex() override { has_changed = true; } + virtual void after_remove_edge() override { has_changed = true; } + virtual void after_remove_outer_ccb(Face_handle) override + { has_changed = true; } + virtual void after_remove_inner_ccb(Face_handle) override + { has_changed = true; } }; From bd915f7a167b4a9210593de40ec542cabd330bab Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Fri, 22 Dec 2023 15:15:44 +0300 Subject: [PATCH 19/95] added a comment about ball radius to user doc --- .../Polygon_mesh_processing/Polygon_mesh_processing.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 578fda8cec7..beeadb4516e 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -998,8 +998,13 @@ solver. The interpolated curvature measures are then computed for each vertex \f$ v \f$ as the sum of the curvature measures of the faces in a ball around \f$ v \f$ weighted by the inclusion ratio of the -triangle in the ball. If the ball radius is not specified (or negative), the sum is instead computed over the incident faces -of \f$ v \f$. +triangle in the ball. This ball radius is an optional (named) parameter of the function. There are 3 +cases for the ball radius passed value: +- A positive value is passed: it is naturally used as the radius of the ball. +- 0 is passed, a small epsilon (`average_edge_length * 1e-6`) is used +(to account for the convergence of curvatures at infinitely small balls). +- It is not specified (or negative), the sum is instead computed over the incident faces +of the vertex \f$ v \f$. To get the final curvature value for a vertex \f$ v \f$, the respective interpolated curvature measure is divided by the interpolated area measure. From 74c89a16b93417b9d8584cd450f7d6b27f08d18b Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Wed, 27 Dec 2023 23:34:49 +0200 Subject: [PATCH 20/95] Added missing "override" --- .../test/Arrangement_on_surface_2/test_observer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp index 5156fde017b..6c5d646c62e 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cpp @@ -404,7 +404,7 @@ public: * \param h A circulator representing the boundary of the merged component. */ virtual void after_merge_outer_ccb(Face_handle /* f */, - Ccb_halfedge_circulator /* h */) + Ccb_halfedge_circulator /* h */) override { compare_results("after_merge_outer_ccb"); } /*! Notification before the merging of two inner CCBs (holes). From e23b535f7c30e957d0252596505e661cc4c7ec67 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 2 Jan 2024 15:33:44 +0100 Subject: [PATCH 21/95] Treeview missing due to missing setting in header.html The PR #7946 was withdraw because the `$cookie` was not necessary anymore in the `header...` files as it was part of the of the `$treeview`. In `header_package.html` the `$treeview` has been disables and as such the `cookie.js` is not added/ Adding the `cookie.js` explicitly. The effect was that there was a divider between the treeniew and the textual documentation but it was on the far left (and thus invisible), ith could be moved but after a refresh it was "gone" again. --- Documentation/doc/resources/1.10.0/header_package.html | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/doc/resources/1.10.0/header_package.html b/Documentation/doc/resources/1.10.0/header_package.html index 827e05a9663..f2309e17bcd 100644 --- a/Documentation/doc/resources/1.10.0/header_package.html +++ b/Documentation/doc/resources/1.10.0/header_package.html @@ -26,6 +26,7 @@ + From a2e3f9be0db01fbe1ebe10999160496293195a72 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 2 Jan 2024 16:57:45 +0000 Subject: [PATCH 22/95] Triangulation_2: Make IO save by changing file names --- .../_test_cls_constrained_triangulation_2.h | 26 +++++++++---------- .../CGAL/_test_cls_regular_triangulation_2.h | 8 +++--- .../CGAL/_test_cls_triangulation_short_2.h | 8 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h index 558f714c546..b9ff68f77ab 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h @@ -222,52 +222,52 @@ _test_cls_constrained_triangulation(const Triang &) /******** I/O *******/ std::cout << "output to a file" << std::endl; - std::ofstream of0_1("T01.triangulation", std::ios::out); + std::ofstream of0_1("T01ct.triangulation", std::ios::out); CGAL::IO::set_ascii_mode(of0_1); of0_1 << T0_1; of0_1.close(); - std::ofstream of0_2("T02.triangulation"); + std::ofstream of0_2("T02ct.triangulation"); CGAL::IO::set_ascii_mode(of0_2); of0_2 << T0_2; of0_2.close(); - std::ofstream of1_1("T11.triangulation"); + std::ofstream of1_1("T11ct.triangulation"); CGAL::IO::set_ascii_mode(of1_1); of1_1 << T1_1; of1_1.close(); - std::ofstream of1_2("T12.triangulation"); + std::ofstream of1_2("T12ct.triangulation"); CGAL::IO::set_ascii_mode(of1_2); of1_2 << T1_2; of1_2.close(); - std::ofstream of2_1("T21.triangulation"); + std::ofstream of2_1("T21ct.triangulation"); CGAL::IO::set_ascii_mode(of2_1); of2_1 << T2_1; of2_1.close(); - std::ofstream of2_2("T22.triangulation"); + std::ofstream of2_2("T22ct.triangulation"); CGAL::IO::set_ascii_mode(of2_2); of2_2 << T2_2; of2_2.close(); std::cout << "input from a file" << std::endl; - std::ifstream if0_1("T01.triangulation"); CGAL::IO::set_ascii_mode(if0_1); + std::ifstream if0_1("T01ct.triangulation"); CGAL::IO::set_ascii_mode(if0_1); Triang T0_1_copy; if0_1 >> T0_1_copy; - std::ifstream if0_2("T02.triangulation"); CGAL::IO::set_ascii_mode(if0_2); + std::ifstream if0_2("T02ct.triangulation"); CGAL::IO::set_ascii_mode(if0_2); Triang T0_2_copy; if0_2 >> T0_2_copy; - std::ifstream if1_1("T11.triangulation"); CGAL::IO::set_ascii_mode(if1_1); + std::ifstream if1_1("T11ct.triangulation"); CGAL::IO::set_ascii_mode(if1_1); Triang T1_1_copy; if1_1 >> T1_1_copy; - std::ifstream if1_2("T12.triangulation"); CGAL::IO::set_ascii_mode(if1_2); + std::ifstream if1_2("T12ct.triangulation"); CGAL::IO::set_ascii_mode(if1_2); Triang T1_2_copy; if1_2 >> T1_2_copy; - std::ifstream if2_1("T21.triangulation"); CGAL::IO::set_ascii_mode(if2_1); + std::ifstream if2_1("T21ct.triangulation"); CGAL::IO::set_ascii_mode(if2_1); Triang T2_1_copy; if2_1 >> T2_1_copy; - std::ifstream if2_2("T22.triangulation"); CGAL::IO::set_ascii_mode(if2_2); + std::ifstream if2_2("T22ct.triangulation"); CGAL::IO::set_ascii_mode(if2_2); Triang T2_2_copy; if2_2 >> T2_2_copy; // test copy of constrained Triangulation Triang T2_4(T2_2); - std::ofstream of2_2_bis("T22.triangulation"); + std::ofstream of2_2_bis("T22ct.triangulation"); CGAL::IO::set_ascii_mode(of2_2_bis); of2_2_bis << T2_4; of2_2_bis.close(); All_faces_iterator fit2 = T2_2.all_faces_begin(); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h index 2d5656c93b2..762070693ee 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h @@ -749,23 +749,23 @@ _test_cls_regular_triangulation_2( const Triangulation & ) // input output have not yet been overload // so they do not input output hidden vertices std::cout << " output to a file" << std::endl; - std::ofstream of1_5("T15.triangulation"); + std::ofstream of1_5("T15rt.triangulation"); CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); - std::ofstream of2_3("T23.triangulation"); + std::ofstream of2_3("T23rt.triangulation"); CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); // std::cout << " input from a file" << std::endl; -// std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5); +// std::ifstream if1_5("T15rt.triangulation"); CGAL::IO::set_ascii_mode(if1_5); // Cls T1_5_copy; if1_5 >> T1_5_copy; // assert( T1_5_copy.is_valid(verbose) && // T1_5_copy.number_of_vertices() == // T1_5.number_of_vertices() - T1_5.number_of_hidden_vertices()); -// std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3); +// std::ifstream if2_3("T23rt.triangulation"); CGAL::IO::set_ascii_mode(if2_3); // Cls T2_3_copy; if2_3 >> T2_3_copy; // assert( T2_3_copy.is_valid(verbose) && // T2_3_copy.number_of_vertices() == diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h index 61fbb042389..132e487bff2 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h @@ -476,22 +476,22 @@ _test_cls_triangulation_short_2( const Triangul &) /********************/ /******** I/O *******/ std::cout << " output to a file" << std::endl; - std::ofstream of1_5("T15.triangulation"); + std::ofstream of1_5("T15short.triangulation"); CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); - std::ofstream of2_3("T23.triangulation"); + std::ofstream of2_3("T23short.triangulation"); CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); std::cout << " input from a file" << std::endl; - std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5); + std::ifstream if1_5("T15short.triangulation"); CGAL::IO::set_ascii_mode(if1_5); Triangul T1_5_copy; if1_5 >> T1_5_copy; assert( T1_5_copy.is_valid() && T1_5_copy.number_of_vertices() == T1_5.number_of_vertices() ); - std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3); + std::ifstream if2_3("T23short.triangulation"); CGAL::IO::set_ascii_mode(if2_3); Triangul T2_3_copy; if2_3 >> T2_3_copy; assert( T2_3_copy.is_valid() && T2_3_copy.number_of_vertices() == T2_3.number_of_vertices() ); From e610677ee20d4cf9e79c67f42a4918ea1e262012 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 2 Jan 2024 17:09:24 +0000 Subject: [PATCH 23/95] The same for 3D --- .../include/CGAL/_test_cls_delaunay_3.h | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h index 78b8822f598..6df340643f4 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h @@ -295,10 +295,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT1("Test1_triangulation_IO_3",std::ios::out); + std::ofstream oFileT1("Test1_dtriangulation_IO_3",std::ios::out); oFileT1 << T0 << std::endl; } - std::ifstream iFileT1("Test1_triangulation_IO_3",std::ios::in); + std::ifstream iFileT1("Test1_dtriangulation_IO_3",std::ios::in); iFileT1 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == -1); @@ -316,10 +316,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT2("Test2_triangulation_IO_3",std::ios::out); + std::ofstream oFileT2("Test2_dtriangulation_IO_3",std::ios::out); oFileT2 << T0 << std::endl; } - std::ifstream iFileT2("Test2_triangulation_IO_3",std::ios::in); + std::ifstream iFileT2("Test2_dtriangulation_IO_3",std::ios::in); iFileT2 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 0); @@ -338,10 +338,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT3("Test3_triangulation_IO_3",std::ios::out); + std::ofstream oFileT3("Test3_dtriangulation_IO_3",std::ios::out); oFileT3 << T0 << std::endl; } - std::ifstream iFileT3("Test3_triangulation_IO_3",std::ios::in); + std::ifstream iFileT3("Test3_dtriangulation_IO_3",std::ios::in); iFileT3 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 1); @@ -360,10 +360,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT4("Test4_triangulation_IO_3",std::ios::out); + std::ofstream oFileT4("Test4_dtriangulation_IO_3",std::ios::out); oFileT4 << T0; } - std::ifstream iFileT4("Test4_triangulation_IO_3",std::ios::in); + std::ifstream iFileT4("Test4_dtriangulation_IO_3",std::ios::in); iFileT4 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 2); @@ -382,10 +382,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT5("Test5_triangulation_IO_3",std::ios::out); + std::ofstream oFileT5("Test5_dtriangulation_IO_3",std::ios::out); oFileT5 << T0; } - std::ifstream iFileT5("Test5_triangulation_IO_3",std::ios::in); + std::ifstream iFileT5("Test5_dtriangulation_IO_3",std::ios::in); iFileT5 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 3); @@ -465,10 +465,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT6("Test6_triangulation_IO_3",std::ios::out); + std::ofstream oFileT6("Test6_dtriangulation_IO_3",std::ios::out); oFileT6 << T1_2; } - std::ifstream iFileT6("Test6_triangulation_IO_3",std::ios::in); + std::ifstream iFileT6("Test6_dtriangulation_IO_3",std::ios::in); iFileT6 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 1); @@ -512,10 +512,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT7("Test7_triangulation_IO_3",std::ios::out); + std::ofstream oFileT7("Test7_dtriangulation_IO_3",std::ios::out); oFileT7 << T2_0; } - std::ifstream iFileT7("Test7_triangulation_IO_3",std::ios::in); + std::ifstream iFileT7("Test7_dtriangulation_IO_3",std::ios::in); iFileT7 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 2); @@ -588,10 +588,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT8("Test8_triangulation_IO_3",std::ios::out); + std::ofstream oFileT8("Test8_dtriangulation_IO_3",std::ios::out); oFileT8 << T3_1; } - std::ifstream iFileT8("Test8_triangulation_IO_3",std::ios::in); + std::ifstream iFileT8("Test8_dtriangulation_IO_3",std::ios::in); iFileT8 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 3); @@ -679,10 +679,10 @@ _test_cls_delaunay_3(const Triangulation &) Cls Tfromfile; std::cout << " I/O" << std::endl; { - std::ofstream oFileT8("Test13_triangulation_IO_3",std::ios::out); + std::ofstream oFileT8("Test13_dtriangulation_IO_3",std::ios::out); oFileT8 << T3_13; } - std::ifstream iFileT8("Test13_triangulation_IO_3",std::ios::in); + std::ifstream iFileT8("Test13_dtriangulation_IO_3",std::ios::in); iFileT8 >> Tfromfile; assert(Tfromfile.is_valid()); assert(Tfromfile.dimension() == 3); From 4e11df578f2158ac7e84fbb41b0fc02b3a9966a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 3 Jan 2024 15:10:06 +0100 Subject: [PATCH 24/95] Update Installation/README --- Installation/README | 32 -------------------------------- Installation/README.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 32 deletions(-) delete mode 100644 Installation/README create mode 100644 Installation/README.md diff --git a/Installation/README b/Installation/README deleted file mode 100644 index be07977a7c6..00000000000 --- a/Installation/README +++ /dev/null @@ -1,32 +0,0 @@ -README -------------------------------------------------------------------------------- - -This distribution of CGAL includes: - - AUTHORS - current and former authors of CGAL - CHANGES - history of changes for the library - CMakeLists.txt - main script of the build system - INSTALL.md - information about the installation process - LICENSE - describes the license of CGAL - LICENSE.FREE_USE - text of the free use license (see LICENSE file) - LICENSE.GPL - text of GPL v3 license - LICENSE.LGPL - text of LGPL v3 license - README - this file - VERSION - version number of this release - auxiliary/ - directory containing miscellaneous things, currently only - the icons needed for the demos on MacOS X - cmake/ - some scripts needed by the build system - config/ - some test programs used during the configuration process - demo/ - many demo programs for the library's various packages. - These programs produce visual output (see INSTALL for - prerequisites). - doc_html/ - documentation, e.g. the CGAL Installation Guide - examples/ - programs illustrating the library's functionality. - These programs do not produce visual output. - include/ - the include files for the CGAL library (and other small - external libraries as well, see the LICENSE file) - scripts/ - some useful scripts for CGAL programmers - src/ - the source code for building the CGAL libraries - (as well as some external libraries, see the LICENSE file) - -------------------------------------------------------------------------------- diff --git a/Installation/README.md b/Installation/README.md new file mode 100644 index 00000000000..19fe3dd963d --- /dev/null +++ b/Installation/README.md @@ -0,0 +1,29 @@ +README +====== + +This distribution of CGAL includes: + +- `AUTHORS`: current and former authors of CGAL +- `CHANGES.md`: history of changes of CGAL +- `CGALConfig.cmake`: +- `CGALConfigVersion.cmake`: +- `CMakeLists.txt`: main CMake project configuration file +- `INSTALL.md`: information about the installation process +- `LICENSE`: describes the license of CGAL +- `LICENSE.BSL`: text of the Boost Software License (BSL) license +- `LICENSE.COMMERCIAL`: text of the GeometryFactory Commercial license +- `LICENSE.GPL`: text of the GNU General Public License (GPL) v3 license +- `LICENSE.LGPL`: text of the GNU LESSER GENERAL PUBLIC License (LGPL) v3 license +- `LICENSE.RFL`: text of the ETH Zurich Random Forest algorithm License (RFL) license +- `README.md`: this file +- `VERSION`: version number of this release of CGAL +- `auxiliary/`: directory containing miscellaneous things, such as icons needed for the demos on macOS +- `cmake/`: some scripts needed by the CMake build system +- `data/`: directory containing various geometric data used by examples and demos of CGAL +- `demo/`: many demo programs for the various packages of CGAL. These programs produce visual output. +- `doc_html/`: documentation, e.g. the CGAL Installation Guide +- `examples/`: programs illustrating the various packages of CGAL. These programs do not produce visual output. +- `include/`: the include files for the CGAL library (as well as small external libraries, see the file `LICENSE`) +- `lib/`: +- `scripts/`: some useful scripts for CGAL programmers + From 24a009f93339c259ab20b14520b7171110a140db Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 3 Jan 2024 15:43:55 +0100 Subject: [PATCH 25/95] transform to a table, and document CMake files --- Installation/README.md | 49 ++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/Installation/README.md b/Installation/README.md index 19fe3dd963d..47b4058ec3f 100644 --- a/Installation/README.md +++ b/Installation/README.md @@ -3,27 +3,30 @@ README This distribution of CGAL includes: -- `AUTHORS`: current and former authors of CGAL -- `CHANGES.md`: history of changes of CGAL -- `CGALConfig.cmake`: -- `CGALConfigVersion.cmake`: -- `CMakeLists.txt`: main CMake project configuration file -- `INSTALL.md`: information about the installation process -- `LICENSE`: describes the license of CGAL -- `LICENSE.BSL`: text of the Boost Software License (BSL) license -- `LICENSE.COMMERCIAL`: text of the GeometryFactory Commercial license -- `LICENSE.GPL`: text of the GNU General Public License (GPL) v3 license -- `LICENSE.LGPL`: text of the GNU LESSER GENERAL PUBLIC License (LGPL) v3 license -- `LICENSE.RFL`: text of the ETH Zurich Random Forest algorithm License (RFL) license -- `README.md`: this file -- `VERSION`: version number of this release of CGAL -- `auxiliary/`: directory containing miscellaneous things, such as icons needed for the demos on macOS -- `cmake/`: some scripts needed by the CMake build system -- `data/`: directory containing various geometric data used by examples and demos of CGAL -- `demo/`: many demo programs for the various packages of CGAL. These programs produce visual output. -- `doc_html/`: documentation, e.g. the CGAL Installation Guide -- `examples/`: programs illustrating the various packages of CGAL. These programs do not produce visual output. -- `include/`: the include files for the CGAL library (as well as small external libraries, see the file `LICENSE`) -- `lib/`: -- `scripts/`: some useful scripts for CGAL programmers +| File or directory | Description | +|-------------------|--------------------------------------------------------------------------------------------------| +| `AUTHORS` | current and former authors of CGAL | +| `CHANGES.md` | history of changes of CGAL | +| `CGALConfig.cmake`| [CMake package] configuration file for CGAL | +| `CGALConfigVersion.cmake` | [CMake package] version file for CGAL | +| `CMakeLists.txt` | main CMake project configuration file | +| `INSTALL.md` | information about the installation process | +| `LICENSE` | describes the license of CGAL | +| `LICENSE.BSL` | text of the Boost Software License (BSL) license | +| `LICENSE.COMMERCIAL` | text of the GeometryFactory Commercial license | +| `LICENSE.GPL` | text of the GNU General Public License (GPL) v3 license | +| `LICENSE.LGPL` | text of the GNU Lesser General Public License (LGPL) v3 license | +| `LICENSE.RFL` | text of the ETH Zurich Random Forest algorithm License (RFL) license | +| `README.md` | this file | +| `VERSION` | version number of this release of CGAL | +| `auxiliary/` | directory containing miscellaneous things, such as icons needed for the demos on macOS | +| `cmake/` | some scripts needed by the CMake build system | +| `data/` | directory containing various geometric data used by examples and demos of CGAL | +| `demo/` | many demo programs for the various packages of CGAL. These programs produce visual output. | +| `doc_html/` | documentation, such as the CGAL Installation Guide | +| `examples/` | programs illustrating the usage of various packages of CGAL. | +| `include/` | the include files for the CGAL library (as well as small external libraries, see the file `LICENSE`) | +| `lib/` | contains [CMake package] configuration files for CGAL | +| `scripts/` | some useful scripts for CGAL programmers | +[CMake package]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html From 00219bc0169f802fb8d4c015e2e1710df6f14b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 17:38:30 +0100 Subject: [PATCH 26/95] default arithmetic kernel when only boost mp is here --- Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h | 9 +++++++++ .../include/CGAL/BOOST_MP_arithmetic_kernel.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h index a01c7b70240..335d9e19d5d 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h @@ -59,6 +59,15 @@ typedef GMP_arithmetic_kernel Arithmetic_kernel; #endif // CGAL_USE_GMP #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL +#ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL +#include +#if defined(CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL) +namespace CGAL{ +typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel; +}// namespace CGAL +#define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 +#endif // CGAL_USE_BOOST_MP +#endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL // Macro to snap typedefs in Arithmetic_kernel #define CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT) \ diff --git a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h index b1c1b1532e8..597e350bfd1 100644 --- a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h @@ -25,6 +25,8 @@ //#include //#endif +#define CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL + // FIXME: the could be several kernels based on Boost.Multiprecision. namespace CGAL { From 40e624c0ae4dfbc5e6a6b8fcec86bdf584d96939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:04:32 +0100 Subject: [PATCH 27/95] handle when LEDA is not present --- .../Arrangement_on_surface_2/cgal_test.cmake | 25 +++++++++++++------ .../cgal_test_with_cmake | 25 +++++++++++++------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 6ce6ad5b5d3..eb78143e7a9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,13 +72,24 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable. Try to use LEDA instead.") - set(GMPZ_NT ${LEDA_INT_NT}) - set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) - set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) - set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT}) - set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) - set(CGAL_GMPZ_NT ${LEDA_INT_NT}) + message(STATUS "GMP is disable.) + if (CGAL_USE_LEDA) + message(STATUS "Try to use LEDA instead.") + set(GMPZ_NT ${LEDA_INT_NT}) + set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) + set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) + set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT}) + set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) + set(CGAL_GMPZ_NT ${LEDA_INT_NT}) + else() + message(STATUS "Try to use MP float instead.") + set(GMPZ_NT ${MP_FLOAT_NT}) + set(QUOTIENT_CGAL_GMPZ_NT ${QUOTIENT_MP_FLOAT_NT}) + set(CGAL_GMPQ_NT ${QUOTIENT_MP_FLOAT_NT}) + set(LAZY_CGAL_GMPQ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT}) + set(LAZY_GMPZ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT}) + set(CGAL_GMPZ_NT ${MP_FLOAT_NT}) + endif() endif() set(COMPARE 1) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index 4d62ce61777..acf5c73f486 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -78,13 +78,24 @@ CORE_INT_NT=15 CORE_RAT_NT=16 if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. Try to use LEDA instead. - GMPZ_NT=$LEDA_INT_NT - QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT - CGAL_GMPQ_NT=$LEDA_RAT_NT - LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT - LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT - CGAL_GMPZ_NT=$LEDA_INT_NT + echo GMP is disable. + if [ -n "CGAL_USE_LEDA" ]; then + echo Try to use LEDA instead. + GMPZ_NT=$LEDA_INT_NT + QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT + CGAL_GMPQ_NT=$LEDA_RAT_NT + LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT + LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT + CGAL_GMPZ_NT=$LEDA_INT_NT + else + echo Try to use MP float instead. + GMPZ_NT=$MP_FLOAT_NT + QUOTIENT_CGAL_GMPZ_NT=$QUOTIENT_MP_FLOAT_NT + CGAL_GMPQ_NT=$QUOTIENT_MP_FLOAT_NT + LAZY_CGAL_GMPQ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT + LAZY_GMPZ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT + CGAL_GMPZ_NT=$MP_FLOAT_NT + fi fi COMPARE=1 From 4f9791a40b1ed37e06bf3d4515f201d8b7f15436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:11:50 +0100 Subject: [PATCH 28/95] fix dependencies --- .../examples/Cone_spanners_2/CMakeLists.txt | 19 ++++-------------- .../test/Cone_spanners_2/CMakeLists.txt | 20 +++++++++++-------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index ded37dfad08..99442720fc1 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -5,21 +5,10 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(LEDA QUIET) if(CGAL_Core_FOUND OR LEDA_FOUND) - if(MSVC) - # Turn off a boost related warning that appears with VC2015 - # boost_1_65_1\boost\graph\named_function_params.hpp(240) : - # warning C4172: returning address of local variable or temporary - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4172") - endif() - - # 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("compute_cones.cpp") + create_single_source_cgal_program("theta_io.cpp") else() message("NOTICE: This program requires the CGAL_Core library (or LEDA), and will not be compiled.") endif() + +create_single_source_cgal_program("dijkstra_theta.cpp") diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index 462edfc7819..17c47060a82 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -5,12 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -# 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("cones_inexact.cpp") +create_single_source_cgal_program("theta_inexact.cpp") +create_single_source_cgal_program("yao_inexact.cpp") + +if(CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("cones_exact.cpp") + create_single_source_cgal_program("theta_exact.cpp") + create_single_source_cgal_program("yao_exact.cpp") +else() + message("NOTICE: Some tests require the CGAL_Core library (or LEDA), and will not be compiled.") +endif() From 82fbb895098cf584a518de972415ddaecde92942 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 29/95] 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 3a8ced2ec99b6e14d5487d60bb0407ed06938a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:18:42 +0100 Subject: [PATCH 30/95] skip if neither core nor leda are present --- Kernel_23/test/Kernel_23/test_Has_conversion.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/test_Has_conversion.cpp b/Kernel_23/test/Kernel_23/test_Has_conversion.cpp index c6f393a502d..2ef8186000a 100644 --- a/Kernel_23/test/Kernel_23/test_Has_conversion.cpp +++ b/Kernel_23/test/Kernel_23/test_Has_conversion.cpp @@ -14,7 +14,9 @@ #include #include +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) #include +#endif #include #include @@ -36,13 +38,16 @@ int main() typedef CGAL::Simple_homogeneous SH; typedef CGAL::Filtered_kernel FSH; +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) typedef CGAL::Exact_predicates_exact_constructions_kernel_with_kth_root EPECK; + CGAL_USE_TYPE(EPECK); +#endif CGAL_USE_TYPE(ASC); CGAL_USE_TYPE(FSC); CGAL_USE_TYPE(SH); CGAL_USE_TYPE(FSH); - CGAL_USE_TYPE(EPECK); + assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); @@ -55,10 +60,12 @@ int main() assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); assert(!(CGAL::Has_conversion::value)); +#endif assert(!(CGAL::Has_conversion::value)); // below will produce static assert failures From 6decd7abfcd4ffb70854abd34f2b1e8a53e32d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:21:57 +0100 Subject: [PATCH 31/95] use exact integer --- Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp index e429bab74f2..0a63acc5c5c 100644 --- a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp +++ b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp @@ -1,14 +1,9 @@ #include #include #include +#include -#ifdef CGAL_USE_LEDA -#include -typedef leda_integer NT; -#else -#include -typedef CGAL::Gmpz NT; -#endif +typedef CGAL::Exact_integer NT; typedef CGAL::Homogeneous Kernel; typedef CGAL::Nef_polyhedron_S2 Nef_polyhedron; From ed3539f5fe1f3b3d3f76a5d4e4f4b4426d71036d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:33:54 +0100 Subject: [PATCH 32/95] add missing includes --- Number_types/test/Number_types/to_interval_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Number_types/test/Number_types/to_interval_test.cpp b/Number_types/test/Number_types/to_interval_test.cpp index 59752059bf6..553199db0a0 100644 --- a/Number_types/test/Number_types/to_interval_test.cpp +++ b/Number_types/test/Number_types/to_interval_test.cpp @@ -16,6 +16,11 @@ #include #endif + +#include +#include +#include + #if 0 #ifdef CGAL_USE_CLN #include From 1b0447eab7c66e5871ec9858df963d7450e812f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:36:34 +0100 Subject: [PATCH 33/95] EPECK_with_sqrt is actually disabled --- .../Polygon_mesh_processing/pmp_compute_normals_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp index 88a70ee95c0..ef45266f71d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp @@ -15,10 +15,10 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; -typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK; +//typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK; typedef CGAL::Surface_mesh EPICK_SM; -typedef CGAL::Surface_mesh EPECK_SM; +//typedef CGAL::Surface_mesh EPECK_SM; namespace PMP = CGAL::Polygon_mesh_processing; @@ -100,8 +100,8 @@ void test(const Mesh& mesh, { if (PMP::is_degenerate_triangle_face(f, mesh)) { - if (std::is_same()) - assert(get(fnormals, f) == CGAL::NULL_VECTOR); +// if (std::is_same()) +// assert(get(fnormals, f) == CGAL::NULL_VECTOR); } else assert(get(fnormals, f) != CGAL::NULL_VECTOR); From a10f7948319cefb04edf9eadbe1b597ae08ce933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:45:14 +0100 Subject: [PATCH 34/95] encode CORE/LEDA dependency --- .../Straight_skeleton_2/extrude_skeleton.cpp | 2 +- .../test/Straight_skeleton_2/CMakeLists.txt | 35 ++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp index cc73aa7493b..6fb5ad59dd4 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp @@ -1,6 +1,6 @@ #include #include -#include +//#include #include #include diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index 6138c50d054..ed7ce5a1282 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -5,23 +5,34 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 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_Qt6_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_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) +endif() + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("test_sls_offset.cpp") + create_single_source_cgal_program("issue7284.cpp") + create_single_source_cgal_program("test_sls_simple.cpp") + create_single_source_cgal_program("test_sls_weighted_polygons_with_holes.cpp") + create_single_source_cgal_program("issue7149.cpp") + if(CGAL_Qt6_FOUND) + target_link_libraries(issue7149 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(issue7284 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_offset PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) + endif() +else() + message("NOTICE: Some test require CGAL_Core (or LEDA), and will not be compiled.") endif() From 8c17676886e549d3f4a79dea86386c77d0d42ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:47:23 +0100 Subject: [PATCH 35/95] test requires Core or Leda --- .../CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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 8dd920fdf64..bfc26d7ea20 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,15 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_extrusion_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 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_Qt6_FOUND) - target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("test_sls_extrude.cpp") + if(CGAL_Qt6_FOUND) + target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) + endif() +else() + message("NOTICE: Tests require CGAL_Core (or LEDA), and will not be compiled.") endif() From dcc3617c088ffe496e40b8094a0105d66bae1c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:50:34 +0100 Subject: [PATCH 36/95] a test and an example requires Leda or Core --- .../examples/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- .../test/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt index 3d3d7367f53..65ed31daad1 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,9 +3,15 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Examples ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "triang_on_sphere.cpp" ) create_single_source_cgal_program( "triang_on_sphere_range.cpp" ) -create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) create_single_source_cgal_program( "triang_on_sphere_proj.cpp" ) create_single_source_cgal_program( "triang_on_sphere_geo.cpp" ) + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index 6e26394bee1..0353327dfbe 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,14 +3,20 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Tests ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "test_dtos.cpp" ) create_single_source_cgal_program( "test_dtos2_remove.cpp" ) -create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) create_single_source_cgal_program( "test_dtos_traits.cpp" ) +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() + find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) From ded0e2b5e8774b8c17a681144376aa36496e974c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:57:05 +0100 Subject: [PATCH 37/95] typos --- .../test/Arrangement_on_surface_2/cgal_test.cmake | 2 +- Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index eb78143e7a9..80d8fcf3fa9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,7 +72,7 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable.) + message(STATUS "GMP is disable.") if (CGAL_USE_LEDA) message(STATUS "Try to use LEDA instead.") set(GMPZ_NT ${LEDA_INT_NT}) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index ed7ce5a1282..20fdb058a7b 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(LEDA QUIET) include_directories(BEFORE "include") -create_single_source_cgal_program("issue4533.cpp")") +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") From d8ee730a4dae1f909708d51ff496958fd96840ca Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 09:58:55 +0100 Subject: [PATCH 38/95] Revert "default arithmetic kernel when only boost mp is here" This reverts commit 00219bc0169f802fb8d4c015e2e1710df6f14b85. --- Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h | 9 --------- .../include/CGAL/BOOST_MP_arithmetic_kernel.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h index 335d9e19d5d..a01c7b70240 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h @@ -59,15 +59,6 @@ typedef GMP_arithmetic_kernel Arithmetic_kernel; #endif // CGAL_USE_GMP #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL -#ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL -#include -#if defined(CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL) -namespace CGAL{ -typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel; -}// namespace CGAL -#define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 -#endif // CGAL_USE_BOOST_MP -#endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL // Macro to snap typedefs in Arithmetic_kernel #define CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT) \ diff --git a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h index 597e350bfd1..b1c1b1532e8 100644 --- a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h @@ -25,8 +25,6 @@ //#include //#endif -#define CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL - // FIXME: the could be several kernels based on Boost.Multiprecision. namespace CGAL { From 1d7cd990f9f3ed1c6cb6a7041e1685814c651e71 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 10:15:03 +0100 Subject: [PATCH 39/95] more fixes when neither Core nor Leda is present --- Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h | 4 ++-- .../include/CGAL/Cone_spanners_2/Less_by_direction_2.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 74e12a8f4db..7e820e12a76 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -30,7 +30,6 @@ #include #include // CGAL_PI is defined there #include -#include #include namespace CGAL { @@ -111,7 +110,7 @@ public: }; - +#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE) /* The specialised functor for computing the directions of cone boundaries exactly with a given cone number and a given initial direction. @@ -209,6 +208,7 @@ public: } // end of operator() }; // end of functor specialization: Compute_cone_..._2 +#endif } // namespace CGAL diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h index 6ba9f53652e..e36137df8fb 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include From c984905745905627507f62c1aa050483d778c685 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 4 Jan 2024 09:17:40 +0000 Subject: [PATCH 40/95] 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 7139a34f444344c5126a873a42d741e37a795393 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 10:20:16 +0100 Subject: [PATCH 41/95] hide non used header --- .../test/Polygon_mesh_processing/pmp_compute_normals_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp index ef45266f71d..3517709a72a 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp @@ -1,7 +1,7 @@ // #define CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP #include -#include +//#include #include #include From 241e1bf557d459393b1779632c34e17458ab069e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 11:53:18 +0100 Subject: [PATCH 42/95] add missing license include directives --- .../Approximate_min_ellipsoid_d_impl.h | 6 + .../Khachiyan_approximation_impl.h | 7 + .../CGAL/Min_circle_2/Min_circle_2_impl.h | 7 + .../Min_circle_2/Optimisation_circle_2_impl.h | 7 + .../CGAL/Min_ellipse_2/Min_ellipse_2_impl.h | 7 + .../Optimisation_ellipse_2_impl.h | 7 + .../CGAL/Min_sphere_d/Min_sphere_d_impl.h | 7 + .../CGAL/Circular_kernel_2/interface_macros.h | 2 + .../interface_macros.h | 2 + .../CGAL/Circular_kernel_3/interface_macros.h | 2 + .../CGAL/Partition_2/Rotation_tree_2_impl.h | 7 + .../Vertex_visibility_graph_2_impl.h | 7 + .../CGAL/Periodic_2_triangulation_dummy_12.h | 2 + ...riodic_3_regular_triangulation_dummy_288.h | 2 + .../Periodic_3_triangulation_dummy_36.h | 2 + ...Periodic_3_triangulation_dummy_generator.h | 2 + .../experimental/experimental_code.h | 228 ------------------ .../include/CGAL/polygon_mesh_processing.h | 8 + .../include/CGAL/QP_solver/Initialization.h | 7 + .../CGAL/QP_solver/QP__filtered_base_impl.h | 7 + .../CGAL/QP_solver/QP_basis_inverse_impl.h | 7 + .../CGAL/QP_solver/QP_solver_bounds_impl.h | 7 + .../include/CGAL/QP_solver/QP_solver_impl.h | 7 + .../QP_solver_nonstandardform_impl.h | 7 + .../Segment_Delaunay_graph_2_impl.h | 6 + .../Segment_Delaunay_graph_hierarchy_2_impl.h | 5 + .../Segment_Delaunay_graph_Linf_2_impl.h | 7 + .../CGAL/surface_mesh_parameterization.h | 8 +- .../CGAL/make_piecewise_smooth_surface_mesh.h | 7 + 29 files changed, 158 insertions(+), 229 deletions(-) delete mode 100644 Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/experimental/experimental_code.h diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h index b38b7794967..e6c85c192a6 100644 --- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h +++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Approximate_min_ellipsoid_d_impl.h @@ -10,6 +10,10 @@ // // Author(s) : Kaspar Fischer +#ifndef CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H +#define CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H + +#include #include @@ -272,3 +276,5 @@ namespace CGAL { } } + +#endif //CGAL_APPROXIMATE_MIN_ELLIPSOID_D_APPROXIMATE_MIN_ELLIPSOID_D_IMPL_H diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation_impl.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation_impl.h index 90944fd8b7f..c3c5844f273 100644 --- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation_impl.h +++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Kaspar Fischer +#ifndef CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H +#define CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H + +#include + // Note: whenever a comment refers to "Khachiyan's paper" then the // paper "Rounding of polytopes in the real number model of // computation" is meant (Mathematics of Operations Research, Vol. 21, @@ -663,3 +668,5 @@ namespace CGAL { } } + +#endif // CGAL_APPROX_MIN_ELLIPSOID_KHACHIYAN_APPROX_IMPL_H diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h index 114a59a297a..c7f9893103d 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Sven Schoenherr , Bernd Gaertner +#ifndef CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H +#define CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H + +#include + #include namespace CGAL { @@ -98,3 +103,5 @@ operator >> ( std::istream& is, CGAL::Min_circle_2& min_circle) } //namespace CGAL // ===== EOF ================================================================== + +#endif // CGAL_MIN_CIRCLE_2_MIN_CIRCLE_2_IMPL_H diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h index f2e94333b61..04a47b6d2b0 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Sven Schoenherr , Bernd Gaertner +#ifndef CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H +#define CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H + +#include + // includes # include @@ -89,3 +94,5 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2& c) } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_MIN_SPHERE_D_OPTIMISATION_CIRCLE_2_IMPL_H diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h index d7bd821350e..01cc0d2dcf7 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Sven Schoenherr , Bernd Gaertner +#ifndef CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H +#define CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H + +#include + #include namespace CGAL { @@ -98,3 +103,5 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2& min_ellipse) } //namespace CGAL // ===== EOF ================================================================== + +#endif // CGAL_MIN_ELLIPSE_2_MIN_ELLIPSE_2_IMP_H diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h index 4f94bbe4047..4100d9d3de6 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Sven Schoenherr , Bernd Gaertner +#ifndef CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H +#define CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H + +#include + namespace CGAL { // Class implementation (continued) @@ -116,3 +121,5 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) } //namespace CGAL // ===== EOF ================================================================== + +#endif // CGAL_MIN_ELLIPSE_2_OPTIMISATION_ELLIPSE_2_IMPL_H diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h index 17231e575e4..95ebcd1fb31 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h @@ -11,6 +11,11 @@ // Author(s) : Sven Schoenherr // Bernd Gaertner +#ifndef CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H +#define CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H + +#include + #include namespace CGAL { @@ -105,3 +110,5 @@ operator >> ( std::istream& is, Min_sphere_d& min_sphere) } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_MIN_SPHERE_D_MIN_SPHERE_D_IMPL_H diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h index ca10ee63135..544f437b936 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/interface_macros.h @@ -9,6 +9,8 @@ // // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado +#include + // Partially supported by the IST Programme of the EU as a Shared-cost // RTD (FET Open) Project under Contract No IST-2000-26473 // (ECG - Effective Computational Geometry for Curves and Surfaces) diff --git a/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/interface_macros.h b/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/interface_macros.h index 32afcea5df7..73dd6f14b37 100644 --- a/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/interface_macros.h +++ b/Circular_kernel_2/include/CGAL/Filtered_bbox_circular_kernel_2/interface_macros.h @@ -9,6 +9,8 @@ // // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado +#include + // Partially supported by the IST Programme of the EU as a Shared-cost // RTD (FET Open) Project under Contract No IST-2000-26473 // (ECG - Effective Computational Geometry for Curves and Surfaces) diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/interface_macros.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/interface_macros.h index dfb43c31298..17d538869ed 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/interface_macros.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/interface_macros.h @@ -10,6 +10,8 @@ // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado, // Sebastien Loriot, Julien Hazebrouck, Damien Leroy +#include + // Partially supported by the IST Programme of the EU as a // STREP (FET Open) Project under Contract No IST-006413 // (ACS -- Algorithms for Complex Shapes) diff --git a/Partition_2/include/CGAL/Partition_2/Rotation_tree_2_impl.h b/Partition_2/include/CGAL/Partition_2/Rotation_tree_2_impl.h index 7f4b46ffdb7..e55e1b0d4a6 100644 --- a/Partition_2/include/CGAL/Partition_2/Rotation_tree_2_impl.h +++ b/Partition_2/include/CGAL/Partition_2/Rotation_tree_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Susan Hert +#ifndef CGAL_PARTITION_2_ROTATION_TREE_2_IMPL_H +#define CGAL_PARTITION_2_ROTATION_TREE_2_IMPL_H + +#include + #include namespace CGAL { @@ -130,3 +135,5 @@ std::ostream& operator<<(std::ostream& os, const Rotation_tree_2& tree) } } + +#endif // CGAL_PARTITION_2_ROTATION_TREE_2_IMPL_H diff --git a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2_impl.h b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2_impl.h index 9d9c463a994..65bf16ac625 100644 --- a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2_impl.h +++ b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2_impl.h @@ -10,6 +10,11 @@ // // Author(s) : Susan Hert +#ifndef CGAL_PARTITION_2_VERTEX_VISIBILITY_GRAPH_2_IMPL_H +#define CGAL_PARTITION_2_VERTEX_VISIBILITY_GRAPH_2_IMPL_H + +#include + namespace CGAL { @@ -699,3 +704,5 @@ void Vertex_visibility_graph_2::handle(Tree_iterator p, } } + +#endif // CGAL_PARTITION_2_VERTEX_VISIBILITY_GRAPH_2_IMPL_H diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_dummy_12.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_dummy_12.h index 6c6c6e01a0c..465ad8c83b0 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_dummy_12.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_dummy_12.h @@ -9,6 +9,8 @@ // // Author(s) : Nico Kruithof +#include + #ifdef CGAL_INCLUDE_FROM_PERIODIC_2_TRIANGULATION_2_H #include diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_regular_triangulation_dummy_288.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_regular_triangulation_dummy_288.h index f125d86dda0..811d408a654 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_regular_triangulation_dummy_288.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_regular_triangulation_dummy_288.h @@ -10,6 +10,8 @@ // // Author(s) : Manuel Caroli +#include + #ifdef CGAL_INCLUDE_FROM_PERIODIC_3_REGULAR_TRIANGULATION_3_H std::vector dummy_points() diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_36.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_36.h index a2197bb2768..097a6016360 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_36.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_36.h @@ -10,6 +10,8 @@ // // Author(s) : Manuel Caroli +#include + #ifdef CGAL_INCLUDE_FROM_PERIODIC_3_TRIANGULATION_3_H template < class GT, class TDS > diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_generator.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_generator.h index b501d361cc3..1d11a29adc5 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_generator.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_dummy_generator.h @@ -10,6 +10,8 @@ // // Author(s) : Mael Rouxel-Labbé +#include + #ifdef CGAL_INCLUDE_FROM_PERIODIC_3_TRIANGULATION_3_H template < class GT, class TDS > diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/experimental/experimental_code.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/experimental/experimental_code.h deleted file mode 100644 index a33bd8964be..00000000000 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/experimental/experimental_code.h +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) 2015 GeometryFactory (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Ilker O. Yaz - -/************************************************************************ - * Currently not useful code pieces, in case there will be any need in the future. - * Also they might not work when they plugged-in due to recent changes. - ************************************************************************/ - -// It can produce a patch from both complete and incomplete lambda -// WARNING: Not working good for all cases -// For holes, this code first close them then erase them. -// However the algorithm might produce holes which are invalid to close (closing them breaks edge manifoldness, so erasing doesn't work) -template -struct Tracer_polyhedron_incomplete -{ - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Facet_handle Facet_handle; - - Tracer_polyhedron_incomplete(OutputIteratorPatch out, - OutputIteratorHole out_hole, - Polyhedron& polyhedron, - std::vector& P) - : out(out), out_hole(out_hole), polyhedron(polyhedron), P(P) - { } - - template - void - operator()(const LookupTable& lambda, int i, int k) - { - std::vector facets_to_delete; - (*this)(lambda, i, k, facets_to_delete, true); - for(typename std::vector::iterator it = facets_to_delete.begin(); - it != facets_to_delete.end(); ++it) - { - *out_hole++=(*it)->halfedge(); // each deleted facet corresponds to a new hole - polyhedron.erase_facet((*it)->halfedge()); - } - } - -private: - template - Halfedge_handle - operator()(const LookupTable& lambda, - int i, int k, - std::vector& facets_to_delete, - bool last) - { - if(i + 1 == k) { return P[i+1]; } - - Halfedge_handle h, g; - if(i+2 == k){ - - if(last) - { h = polyhedron.fill_hole(P[i+1]); } - else - { h = polyhedron.add_facet_to_border(P[i+1]->prev(), P[i+2/*k*/]); } - - CGAL_assertion(h->facet() != Facet_handle()); - - int la = lambda.get(i, k); - if(la == -1) { - facets_to_delete.push_back(h->facet()); - } - else { - *out++ = h->facet(); - } - return h->opposite(); - } - else - { - int la = lambda.get(i, k); - if(la == -1) { - if(last) - { h = polyhedron.fill_hole(P[i+1]); } - else - { h = polyhedron.add_facet_to_border(P[i+1]->prev(), P[i+2/*k*/]); } - facets_to_delete.push_back(h->facet()); - return h->opposite(); - } - else { - h = operator()(lambda, i, la, facets_to_delete, false); - g = operator()(lambda, la, k, facets_to_delete, false); - - if(last) - { h = polyhedron.fill_hole(g); } - else - { h = polyhedron.add_facet_to_border(h->prev(), g); } - - CGAL_assertion(h->facet() != Facet_handle()); - *out++ = h->facet(); - return h->opposite(); - } - } - } - -public: - OutputIteratorPatch out; - OutputIteratorHole out_hole; - Polyhedron& polyhedron; - std::vector& P; -}; - -// Try closing holes by gathering incomplete patches together (an external approach) -template -OutputIterator -triangulate_hole_polyline_incomplete(InputIterator pbegin, InputIterator pend, - InputIterator qbegin, InputIterator qend, - OutputIterator out) -{ - - typedef typename std::iterator_traits::value_type Point_3; - typedef Weight_incomplete Weight; - typedef Weight_calculator WC; - - typedef std::vector > Facet_vector; /* deliberately not OutputIteratorValueType*/ - typedef std::back_insert_iterator OutIt; - typedef Tracer_polyline_incomplete Tracer; - typedef std::pair Range; - - std::vector P(pbegin, pend); - std::vector Q(qbegin, qend); - - if(P.front() != P.back()){ - P.push_back(P.front()); - if( !Q.empty() && P.size() > Q.size()) { - Q.push_back(Q.front()); - } - } - - std::vector patch_facets; - std::stack remaining_holes; - - remaining_holes.push(Range(0, P.size() -2)); - - while(!remaining_holes.empty()) { - Range h = remaining_holes.top(); - remaining_holes.pop(); - - std::vector P_r(&P[h.first], (&P[h.second]) + 1); - std::vector Q_r; - if(!Q.empty()) { Q_r.insert(Q_r.begin(), &Q[h.first], (&Q[h.second]) + 1); }; - - Facet_vector new_facets; - OutIt new_facets_out(new_facets); - std::vector new_holes; - std::back_insert_iterator > new_holes_out(new_holes); - Tracer tracer(new_facets_out, new_holes_out); - - triangulate_hole_polyline(P_r, Q_r, tracer, WC(), true, true); - - if(new_facets.empty()) { - new_holes.clear(); - //triangulate_hole_polyline(P_r, Q_r, tracer, WC(), false, true); - if(new_facets.empty()) { - // if no patch facets created and also we are using brute force approach, then there is nothing to do, - // leave `out` intact and return - CGAL_warning_msg(false, "Returning no output. Filling hole with incomplete patches is not successful!"); - return out; - } - } - // put new borders to remaining_holes - for(typename std::vector::iterator it = new_holes.begin(); it != new_holes.end(); ++it) { - remaining_holes.push(std::make_pair(it->first + h.first, it->second + h.first)); - } - tracer.remaining_holes.clear(); - for(Facet_vector::iterator it = new_facets.begin(); it != new_facets.end(); ++it) { - patch_facets.push_back( - OutputIteratorValueType(it->get<0>() + h.first, it->get<1>() + h.first, it->get<2>() + h.first)); - } - } - - return std::copy(patch_facets.begin(), patch_facets.end(), out); -} - -// (for Polyhedron_3) Try closing holes by gathering incomplete patches together (an external approach) -template -std::pair -triangulate_hole_Polyhedron_incomplete(Polyhedron& polyhedron, - typename Polyhedron::Halfedge_handle border_halfedge, - OutputIterator out) -{ - typedef typename Polyhedron::Halfedge_handle Halfedge_handle; - typedef typename Polyhedron::Facet_handle Facet_handle; - - Weight_min_max_dihedral_and_area weight_total = Weight_min_max_dihedral_and_area::DEFAULT(); - std::vector patch_facets; - std::stack remaining_holes; - remaining_holes.push(border_halfedge); - - while(!remaining_holes.empty()) { - Halfedge_handle h = remaining_holes.top(); - remaining_holes.pop(); - std::vector holes_h; - - std::size_t patch_facets_before = patch_facets.size(); - Weight_min_max_dihedral_and_area w = - triangulate_hole_Polyhedron(polyhedron, h, back_inserter(patch_facets), back_inserter(holes_h), true); - - if(patch_facets_before == patch_facets.size()) { - holes_h.clear(); - patch_facets_before = patch_facets.size(); - w = triangulate_hole_Polyhedron(polyhedron, h, back_inserter(patch_facets), back_inserter(holes_h), false); - if(patch_facets_before == patch_facets.size()) { - // if no patch facets created and also we are using brute force approach, then there is nothing to do, - // leave `out` intact and return - CGAL_warning_msg(false, "Returning no output. Filling hole with incomplete patches is not successful!"); - return std::make_pair(out, Weight_min_max_dihedral_and_area::NOT_VALID()); - } - } - // put new borders to remaining_holes and update weight - for(typename std::vector::iterator it = holes_h.begin(); it != holes_h.end(); ++it) { - //remaining_holes.push(*it); - } - weight_total = weight_total + w; - } - - out = std::copy(patch_facets.begin(), patch_facets.end(), out); - return std::make_pair(out, weight_total); -} diff --git a/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h b/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h index b9892a67f16..b883e729935 100644 --- a/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h +++ b/Polygon_mesh_processing/include/CGAL/polygon_mesh_processing.h @@ -17,6 +17,11 @@ * the free functions of this package. */ +#ifndef CGAL_POLYGON_MESH_PROCESSING_H +#define CGAL_POLYGON_MESH_PROCESSING_H + +#include + #include #include #include @@ -49,3 +54,6 @@ #include #include #include +#include + +#endif //CGAL_POLYGON_MESH_PROCESSING_H diff --git a/QP_solver/include/CGAL/QP_solver/Initialization.h b/QP_solver/include/CGAL/QP_solver/Initialization.h index 88eb0636fb3..99873022d2d 100644 --- a/QP_solver/include/CGAL/QP_solver/Initialization.h +++ b/QP_solver/include/CGAL/QP_solver/Initialization.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_SOLVER_INITIALIZATION_H +#define CGAL_QP_SOLVER_INITIALIZATION_H + +#include + #include #include @@ -664,3 +669,5 @@ init_additional_data_members() } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_QP_SOLVER_INITIALIZATION_H diff --git a/QP_solver/include/CGAL/QP_solver/QP__filtered_base_impl.h b/QP_solver/include/CGAL/QP_solver/QP__filtered_base_impl.h index 194a7607e64..bffac7ad089 100644 --- a/QP_solver/include/CGAL/QP_solver/QP__filtered_base_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP__filtered_base_impl.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_FILTERED_BASE_IMPL_H +#define CGAL_QP_FILTERED_BASE_IMPL_H + +#include + namespace CGAL { // ============================= @@ -370,3 +375,5 @@ transition( ) } //namespace CGAL // ===== EOF ================================================================== + +#endif // CGAL_QP_FILTERED_BASE_IMPL_H diff --git a/QP_solver/include/CGAL/QP_solver/QP_basis_inverse_impl.h b/QP_solver/include/CGAL/QP_solver/QP_basis_inverse_impl.h index 04e8f3f36d4..890d1ba296b 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_basis_inverse_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_basis_inverse_impl.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_SOLVER_QP_BASIS_INVERSE_IMPL_H +#define CGAL_QP_SOLVER_QP_BASIS_INVERSE_IMPL_H + +#include + namespace CGAL { // ============================= @@ -700,3 +705,5 @@ print( ) } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_QP_SOLVER_QP_BASIS_INVERSE_IMPL_H diff --git a/QP_solver/include/CGAL/QP_solver/QP_solver_bounds_impl.h b/QP_solver/include/CGAL/QP_solver/QP_solver_bounds_impl.h index 1f0a73e1a49..1e67055cbf8 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_solver_bounds_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_solver_bounds_impl.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_SOLVER_QP_SOLVER_BOUNDS_IMPL_H +#define CGAL_QP_SOLVER_QP_SOLVER_BOUNDS_IMPL_H + +#include + namespace CGAL { template < typename Q, typename ET, typename Tags > @@ -89,3 +94,5 @@ QP_solver::upper_bnd(int i) const } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_QP_SOLVER_QP_SOLVER_BOUNDS_IMPL_H diff --git a/QP_solver/include/CGAL/QP_solver/QP_solver_impl.h b/QP_solver/include/CGAL/QP_solver/QP_solver_impl.h index bc62b5ae88f..262e20f1ba7 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_solver_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_solver_impl.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_SOLVER_IMPL_H +#define CGAL_QP_SOLVER_IMPL_H + +#include + #include #include @@ -3393,3 +3398,5 @@ get_l() const } //namespace CGAL // ===== EOF ================================================================== + +#endif //CGAL_QP_SOLVER_IMPL_H diff --git a/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h b/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h index 57118dac1e2..e5f2a0eb5df 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h @@ -13,6 +13,11 @@ // Franz Wessendorp // Kaspar Fischer +#ifndef CGAL_QP_SOLVER_NONSTANDARDFORM_IMPL_H +#define CGAL_QP_SOLVER_NONSTANDARDFORM_IMPL_H + +#include + namespace CGAL { // Looks in x_O_v_i which bound is present for variable i and returns @@ -219,3 +224,5 @@ init_w() } //namespace CGAL // ===== EOF ================================================================== + +#endif CGAL_QP_SOLVER_NONSTANDARDFORM_IMPL_H diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h index 88d634e0324..00c2130c50a 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h @@ -10,6 +10,10 @@ // // Author(s) : Menelaos Karavelas +#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_2_IMPL_H +#define CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_2_IMPL_H + +#include // class implementation continued //================================= @@ -3325,3 +3329,5 @@ file_input(std::istream& is, bool read_handle_vector, } //namespace CGAL // EOF + +#endif // CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_2_IMPL_H diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h index 14697569e3c..1434020ccd9 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h @@ -10,7 +10,10 @@ // // Author(s) : Menelaos Karavelas +#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_HIERARCHY_IMPL_H +#define CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_HIERARCHY_IMPL_H +#include // class implementation continued @@ -1145,3 +1148,5 @@ file_input(std::istream& is) // EOF + +#endif //CGAL_SEGMENT_DELAUNAY_GRAPH_2_SDG_HIERARCHY_IMPL_H diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h index 73a5247879e..4aff29fb69b 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_2_impl.h @@ -11,6 +11,11 @@ // Author(s) : Panagiotis Cheilaris, Sandeep Kumar Dey, Evanthia Papadopoulou //philaris@gmail.com, sandeep.kr.dey@gmail.com, evanthia.papadopoulou@usi.ch +#ifndef CGAL_SEGMENT_DELAUNAY_GRAPH_LINF_2_SDG_LINF_2_IMPL_H +#define CGAL_SEGMENT_DELAUNAY_GRAPH_LINF_2_SDG_LINF_2_IMPL_H + +#include + namespace CGAL { // print face in standard output @@ -759,3 +764,5 @@ insert_point_on_segment(const Storage_site_2& ss, const Site_2& , } //namespace CGAL // EOF + +#endif // CGAL_SEGMENT_DELAUNAY_GRAPH_LINF_2_SDG_LINF_2_IMPL_H diff --git a/Surface_mesh_parameterization/include/CGAL/surface_mesh_parameterization.h b/Surface_mesh_parameterization/include/CGAL/surface_mesh_parameterization.h index 09980d6e6dd..e5b31167532 100644 --- a/Surface_mesh_parameterization/include/CGAL/surface_mesh_parameterization.h +++ b/Surface_mesh_parameterization/include/CGAL/surface_mesh_parameterization.h @@ -10,6 +10,11 @@ // // Author(s) : Mael Rouxel-Labbé +#ifndef CGAL_SURFACE_MESH_PARAMETERIZATION_H +#define CGAL_SURFACE_MESH_PARAMETERIZATION_H + +#include + /** * \ingroup PkgSurfaceMeshParameterizationRef * \file CGAL/surface_mesh_parameterization.h @@ -17,7 +22,6 @@ * the free functions of this package. */ - #include #include #include @@ -34,3 +38,5 @@ #include #include #include + +#endif // CGAL_SURFACE_MESH_PARAMETERIZATION_H diff --git a/Surface_mesher/include/CGAL/make_piecewise_smooth_surface_mesh.h b/Surface_mesher/include/CGAL/make_piecewise_smooth_surface_mesh.h index 33f4683b534..ee7f4c54f0b 100644 --- a/Surface_mesher/include/CGAL/make_piecewise_smooth_surface_mesh.h +++ b/Surface_mesher/include/CGAL/make_piecewise_smooth_surface_mesh.h @@ -9,4 +9,11 @@ // // Author(s) : Laurent Rineau +#ifndef CGAL_MAKE_PIECEWISE_SMOOTH_SURFACE_MESH_H +#define CGAL_MAKE_PIECEWISE_SMOOTH_SURFACE_MESH_H + +#include + #include + +#endif //CGAL_MAKE_PIECEWISE_SMOOTH_SURFACE_MESH_H From 8527509907890170b18392737d501cf2150d1490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 12:58:04 +0100 Subject: [PATCH 43/95] typo --- .../include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h b/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h index e5f2a0eb5df..9b0b230c40a 100644 --- a/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h +++ b/QP_solver/include/CGAL/QP_solver/QP_solver_nonstandardform_impl.h @@ -225,4 +225,4 @@ init_w() // ===== EOF ================================================================== -#endif CGAL_QP_SOLVER_NONSTANDARDFORM_IMPL_H +#endif // CGAL_QP_SOLVER_NONSTANDARDFORM_IMPL_H From e7c26349f286802386824abd7ac0fda1f467f668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 13:36:34 +0100 Subject: [PATCH 44/95] move header in a package to GPL --- .../include/CGAL/Arr_algebraic_segment_traits_2.h | 2 +- .../include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h | 2 +- .../Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h | 2 +- .../Curved_kernel_via_analysis_2_functors.h | 2 +- .../Curved_kernel_via_analysis_2_impl.h | 2 +- .../Filtered_curved_kernel_via_analysis_2_impl.h | 2 +- .../include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h | 2 +- .../include/CGAL/Curved_kernel_via_analysis_2/Point_2.h | 2 +- .../Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h | 2 +- .../gfx/Curve_renderer_internals.h | 2 +- .../Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h | 2 +- .../CGAL/Curved_kernel_via_analysis_2/test/simple_models.h | 2 +- .../include/CGAL/boost/graph/graph_traits_Arrangement_2.h | 2 +- .../CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h | 2 +- Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h | 2 +- Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h | 2 +- Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h | 2 +- Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h | 2 +- Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h | 2 +- .../include/CGAL/Circular_kernel_2/Intersection_traits.h | 4 ++-- .../include/CGAL/Circular_kernel_3/Intersection_traits.h | 2 +- .../include/CGAL/Spherical_kernel_type_equality_wrapper.h | 2 +- Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h | 2 +- GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h | 2 +- GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h | 2 +- GraphicsView/include/CGAL/auto_link/Qt.h | 2 +- GraphicsView/include/CGAL/export/Qt.h | 2 +- Nef_2/include/CGAL/Nef_2/Polynomial.h | 2 +- Nef_2/include/CGAL/Nef_2/Polynomial_impl.h | 2 +- Nef_2/include/CGAL/Nef_2/debug.h | 2 +- Nef_2/include/CGAL/Nef_polynomial_fwd.h | 2 +- Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h | 2 +- .../Periodic_3_power_side_of_oriented_power_sphere_3.h | 2 +- .../internal/alpha_shape_mesh.h | 2 +- Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 2 +- Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h | 2 +- .../include/CGAL/boost/graph/graph_traits_Polyhedron_3.h | 2 +- .../CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h | 2 +- Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h | 2 +- .../CGAL/boost/graph/properties_Polyhedron_3_features.h | 2 +- .../CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h | 2 +- .../include/CGAL/Polytope_distance_d_traits_2.h | 2 +- .../include/CGAL/Polytope_distance_d_traits_3.h | 2 +- .../include/CGAL/Polytope_distance_d_traits_d.h | 2 +- Principal_component_analysis/include/CGAL/Subiterator.h | 2 +- .../include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h | 2 +- .../include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h | 2 +- .../include/CGAL/Straight_skeleton_2/IO/print.h | 2 +- .../include/CGAL/certified_numeric_predicates.h | 2 +- .../include/CGAL/certified_quotient_predicates.h | 2 +- .../include/CGAL/boost/graph/graph_traits_Surface_mesh.h | 2 +- .../include/CGAL/boost/graph/properties_Surface_mesh.h | 2 +- .../CGAL/boost/graph/properties_Surface_mesh_features.h | 2 +- .../CGAL/boost/graph/properties_Surface_mesh_time_stamp.h | 2 +- .../CGAL/Deformation_Eigen_closest_rotation_traits_3.h | 2 +- .../CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h | 2 +- Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h | 2 +- .../boost/graph/graph_traits_Triangulation_data_structure_2.h | 2 +- .../CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h | 2 +- .../boost/graph/properties_Triangulation_data_structure_2.h | 2 +- Triangulation/include/CGAL/IO/Triangulation_off_ostream.h | 2 +- Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h | 2 +- .../CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h | 2 +- Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h | 2 +- .../include/CGAL/Triangulation_face_base_with_id_2.h | 2 +- .../include/CGAL/Triangulation_vertex_base_with_id_2.h | 2 +- Triangulation_2/include/CGAL/apply_to_range.h | 2 +- .../graph/graph_traits_Constrained_Delaunay_triangulation_2.h | 2 +- .../boost/graph/graph_traits_Constrained_triangulation_2.h | 2 +- .../graph/graph_traits_Constrained_triangulation_plus_2.h | 2 +- .../CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h | 2 +- .../CGAL/boost/graph/graph_traits_Regular_triangulation_2.h | 2 +- .../include/CGAL/boost/graph/graph_traits_Triangulation_2.h | 2 +- .../CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h | 2 +- .../CGAL/boost/graph/internal/graph_traits_2D_triangulation.h | 2 +- .../graph/internal/graph_traits_2D_triangulation_helper.h | 2 +- .../CGAL/boost/graph/internal/properties_2D_triangulation.h | 2 +- .../graph/properties_Constrained_Delaunay_triangulation_2.h | 2 +- .../CGAL/boost/graph/properties_Constrained_triangulation_2.h | 2 +- .../boost/graph/properties_Constrained_triangulation_plus_2.h | 2 +- .../CGAL/boost/graph/properties_Delaunay_triangulation_2.h | 2 +- .../CGAL/boost/graph/properties_Regular_triangulation_2.h | 2 +- .../include/CGAL/boost/graph/properties_Triangulation_2.h | 2 +- .../CGAL/boost/graph/properties_Triangulation_hierarchy_2.h | 2 +- Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h | 2 +- Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h | 2 +- 93 files changed, 94 insertions(+), 94 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index af9b28db6f2..ad5dfd4ed55 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s): Michael Kerber diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 8766eac294d..3c56db0f0a3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Eric Berberich // Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h index 7a8cf2840bf..550037a680a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index 3bb749b395c..e7b6055422a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index 8fe1efa48c7..14b983bcf45 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h index 66f20cccf09..7457f4bae23 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h index 45bb19fa558..80a36a22272 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h index 06ec76eb58f..b66255a061d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h index c465cae0300..050ccd7dcf5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h index aae3aea01e9..f5afe7c8a0b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h index d2cae5964bf..8043447ceaa 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index f64c67b70ea..31a98218fbd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Eric Berberich diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 018992c467b..748e05e4094 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index 32d3d4cc849..e6a4a6cc737 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h index c0c62a2ad88..273f40362de 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 32e108b71c0..56465713530 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h index 395b44a9f11..196d7f53bee 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h index 9358316c0b8..7a72d48268b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pavel Emeliyanenko // diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h index 201bfc19b4b..14ef6913281 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Pavel Emeliyanenko diff --git a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h index ad371b4667d..0d3fd5af5c8 100644 --- a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Ron Wein diff --git a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h index 5126f010686..41c102cb65b 100644 --- a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Ron Wein diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h index 76e2eaf3283..ffd6af38c9c 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s): Efi Fogel diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 6eaa81b02f7..58156ed6640 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Guillaume Damiand diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h index 05dd8668050..434368e3ef1 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h index 75c7f038d70..7873d6f4b1a 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h index 8d2f13a56c6..0730222f251 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h index 34ba0ccc386..8896e76c23b 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h @@ -5,11 +5,11 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Philipp Möller and Sebastien Loriot diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index 9612d2ca578..b2319846ecb 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Philipp Möller and Sebastien Loriot diff --git a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h index 5553e556698..432fc6bc635 100644 --- a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h +++ b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h @@ -11,7 +11,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Monique Teillaud // Sylvain Pion diff --git a/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h b/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h index f5aa3fe06d7..b1a7c83210c 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Sebastien Loriot diff --git a/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h b/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h index 6aad119ecc3..c5fdd7c3eff 100644 --- a/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h +++ b/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Laurent Rineau diff --git a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h index 5c37bffe9a0..7099eddc48c 100644 --- a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h +++ b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Laurent Rineau and Maxime Gimeno diff --git a/GraphicsView/include/CGAL/auto_link/Qt.h b/GraphicsView/include/CGAL/auto_link/Qt.h index a08e108e2d3..f8efb5e983a 100644 --- a/GraphicsView/include/CGAL/auto_link/Qt.h +++ b/GraphicsView/include/CGAL/auto_link/Qt.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Laurent Rineau diff --git a/GraphicsView/include/CGAL/export/Qt.h b/GraphicsView/include/CGAL/export/Qt.h index a5b1c82fa19..8722c6d344c 100644 --- a/GraphicsView/include/CGAL/export/Qt.h +++ b/GraphicsView/include/CGAL/export/Qt.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial.h b/Nef_2/include/CGAL/Nef_2/Polynomial.h index a389fd9aae6..1f335f6d387 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Michael Seel diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h b/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h index 66417e9b99a..19d7c064778 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Michael Seel diff --git a/Nef_2/include/CGAL/Nef_2/debug.h b/Nef_2/include/CGAL/Nef_2/debug.h index d4ccc190ddc..2583e37d523 100644 --- a/Nef_2/include/CGAL/Nef_2/debug.h +++ b/Nef_2/include/CGAL/Nef_2/debug.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Michael Seel diff --git a/Nef_2/include/CGAL/Nef_polynomial_fwd.h b/Nef_2/include/CGAL/Nef_polynomial_fwd.h index 6e9af8ea6f9..34a534b0d71 100644 --- a/Nef_2/include/CGAL/Nef_polynomial_fwd.h +++ b/Nef_2/include/CGAL/Nef_polynomial_fwd.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Stefan Schirra, Sylvain Pion diff --git a/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h b/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h index 7973729e89e..2b129cc7ab2 100644 --- a/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h +++ b/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Peter Hachenberger diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h index fa8288872a1..8a1e06c29ba 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Polygonal_surface_reconstruction/include/CGAL/Polygonal_surface_reconstruction/internal/alpha_shape_mesh.h b/Polygonal_surface_reconstruction/include/CGAL/Polygonal_surface_reconstruction/internal/alpha_shape_mesh.h index 99fdcbdab99..20fcb339b2f 100644 --- a/Polygonal_surface_reconstruction/include/CGAL/Polygonal_surface_reconstruction/internal/alpha_shape_mesh.h +++ b/Polygonal_surface_reconstruction/include/CGAL/Polygonal_surface_reconstruction/internal/alpha_shape_mesh.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Liangliang Nan diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index c284f6e60b1..c9b266ebbd6 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand // diff --git a/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h b/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h index e792a2fe3bf..008dae42a64 100644 --- a/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h index 8cff560f0a6..7df39974c10 100644 --- a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h index cd0778ea374..3571d0c3fa2 100644 --- a/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h index 72fdf06ba75..2b35cb02b4d 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h index 70f89908c7f..06a8f4a1514 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h index bd8ad12bc5f..5a2fdc85417 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h index 27c168ffa39..345367b6c11 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h index 459ea4b06df..5f24e083d99 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h index e7de86d3009..b115b610c72 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h @@ -9,7 +9,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Sven Schoenherr diff --git a/Principal_component_analysis/include/CGAL/Subiterator.h b/Principal_component_analysis/include/CGAL/Subiterator.h index 186776918be..0d31b12a8e8 100644 --- a/Principal_component_analysis/include/CGAL/Subiterator.h +++ b/Principal_component_analysis/include/CGAL/Subiterator.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Simon Giraudot // diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h index 6240cdb1a2e..5adc8c897c2 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Fernando Cacciola diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h index 11a41b3a204..e2d3ec5c50a 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Fernando Cacciola diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h index a36df07b51e..a389b96c138 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Fernando Cacciola diff --git a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h index a88aea91d79..5468e8b9699 100644 --- a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h +++ b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Fernando Cacciola // diff --git a/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h b/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h index d6896189349..46ba2d948c2 100644 --- a/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h +++ b/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Fernando Cacciola // diff --git a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h index d044c38a557..b46df17715b 100644 --- a/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/graph_traits_Surface_mesh.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Philipp Moeller diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h index 281c2b37093..785cec65003 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Philipp Möller diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h index b6fbb66f968..68fd42eb79e 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h index d1df35ed90f..06baa03192e 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h index 60c52e52e7f..654560ce419 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Gael Guennebaud and Ilker O. Yaz diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h index a73d8225bdb..b5ba19187ac 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Gael Guennebaud Ilker O. Yaz diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h b/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h index 81f88f84017..32591b23968 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Laurent Rineau diff --git a/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h b/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h index 738013e2489..2ebbf85432b 100644 --- a/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h b/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h index 9b5f303250d..483690396b5 100644 --- a/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h +++ b/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h b/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h index 0beda7ff5e2..151af643059 100644 --- a/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h index 3098d831022..5dbe2895f10 100644 --- a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h +++ b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Clement Jamin diff --git a/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h b/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h index 0274a227cc1..6d96c38bcb9 100644 --- a/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h +++ b/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Clement Jamin diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h index 77e212b9f04..5eab13d4c1e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/CTP2_subconstraint_graph.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Simon Giraudot diff --git a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h index 86d9a71f51e..6f24fd8e50e 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand // diff --git a/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h b/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h index d5d344c8aa8..72fd9fcfba6 100644 --- a/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h b/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h index 290fad8db5f..aca49c503bc 100644 --- a/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/apply_to_range.h b/Triangulation_2/include/CGAL/apply_to_range.h index f09433e7d57..9df2dbd2366 100644 --- a/Triangulation_2/include/CGAL/apply_to_range.h +++ b/Triangulation_2/include/CGAL/apply_to_range.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Radu Ursu diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h index d1d82115ec8..c4a6e7f61bd 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h index 67419f0d761..3f4fa4e9245 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h index 6cb7c45d8b2..85f44168e9a 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h index 26caf574e03..35ac74f22ea 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h index 572bbeaebbb..4595604b503 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h index 99312b8323f..42bbed130b5 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h index e3ae435381b..cd07894b313 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Andreas Fabri, Fernando Cacciola diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h index 27a5994dcaa..e120e7d626f 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé, // Andreas Fabri, diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h index 0c2904243c5..46a904bc1c3 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h b/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h index 7111e237ef6..65516f9f3b3 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h index 8aa35398240..b070a293df1 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h index 7f95526668a..e56fc487b47 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h index 915d45b6519..6e0f16ea086 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h index 000995d9ca9..6367bc5a58b 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h index 5030385656c..7d91b01ae96 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h index 2a076b16cd6..25c60a34d80 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h index f20cef1d9f4..9ed8bbdb193 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h @@ -4,7 +4,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Mael Rouxel-Labbé diff --git a/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h b/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h index d18ffbb7fea..4708dc1b7e1 100644 --- a/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h +++ b/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Clement Jamin diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 14f718f0b13..43079354d0a 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand // From c35a1b15d1dff1fb0b976ae22cb849990aa8e39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 13:42:27 +0100 Subject: [PATCH 45/95] add missing license include directives --- .../include/CGAL/Arr_algebraic_segment_traits_2.h | 9 ++++++--- .../include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h | 3 +++ .../Curve_interval_arcno_cache.h | 3 +++ .../Curved_kernel_via_analysis_2/Curve_renderer_facade.h | 3 +++ .../Curved_kernel_via_analysis_2_functors.h | 3 +++ .../Curved_kernel_via_analysis_2_impl.h | 3 +++ .../Filtered_curved_kernel_via_analysis_2_impl.h | 3 +++ .../CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h | 3 +++ .../CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h | 3 +++ .../Curved_kernel_via_analysis_2/Make_x_monotone_2.h | 3 +++ .../Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h | 3 +++ .../include/CGAL/Curved_kernel_via_analysis_2/Point_2.h | 3 +++ .../Sweep_curves_adapter_2.h | 5 ++++- .../Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h | 3 +++ .../gfx/Curve_renderer_internals.h | 5 ++++- .../gfx/Curve_renderer_traits.h | 3 +++ .../Curved_kernel_via_analysis_2/gfx/Subdivision_1.h | 5 ++++- .../Curved_kernel_via_analysis_2/gfx/Subdivision_2.h | 5 ++++- .../Curved_kernel_via_analysis_2/test/simple_models.h | 3 +++ .../CGAL/boost/graph/graph_traits_Arrangement_2.h | 3 +++ .../CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h | 3 +++ .../include/CGAL/draw_arrangement_2.h | 3 +++ 22 files changed, 73 insertions(+), 7 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index ad5dfd4ed55..03566eaa919 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -12,8 +12,11 @@ // // ============================================================================ -#ifndef CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS -#define CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS +#ifndef CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H +#define CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H + +#include + #include @@ -655,4 +658,4 @@ public: #include -#endif // CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS +#endif // CGAL_ARR_ALGEBRAIC_SEGMENT_TRAITS_H diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 3c56db0f0a3..c7a47a2c1b2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -13,6 +13,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_ARC_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h *\brief defines class \c Arc_2 that represents an arc on a curve that * can be analyzed. diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h index 550037a680a..36152129a94 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h @@ -13,6 +13,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_CURVE_INTERVAL_ARCNO_CACHE_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Curve_interval_arcno_cache.h * \brief defines \c Curve_interval_arcno_cache functor */ diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index e7b6055422a..dc31345cf8c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -21,6 +21,9 @@ #ifndef CGAL_CKVA_CURVE_RENDERER_FACADE_H #define CGAL_CKVA_CURVE_RENDERER_FACADE_H +#include + + // do not compile curve renderer code (for fast debugging) //#define CGAL_CKVA_DUMMY_RENDERER diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index 14b983bcf45..7087285e754 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -14,6 +14,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_FUNCTORS_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h * \brief defines Curved_kernel_via_analysis_2 function objects + class */ diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h index 7457f4bae23..cbc2a9ad81a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h @@ -14,6 +14,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2.h * \brief defines class \c Curved_kernel_via_analysis_2 * diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h index 80a36a22272..34eb19ae4b2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h @@ -15,6 +15,9 @@ #ifndef CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H #define CGAL_FILTERED_CURVED_KERNEL_VIA_ANALYSIS_2_IMPL_H +#include + + /*!\file include/CGAL/Filtered_curved_kernel_via_analysis_2.h * \brief defines class \c Filtered_curved_kernel_via_analysis_2 * diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h index b66255a061d..d0f318f0fa6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h @@ -14,6 +14,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_ARC_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h * \brief defines class \c Generic_arc_2 * diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h index 050ccd7dcf5..b13e3cd0da4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h @@ -13,6 +13,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_GENERIC_POINT_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h * \brief defines class \c Generic_point_2 * diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h index f5afe7c8a0b..0b495e31bc2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h @@ -17,6 +17,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_MAKE_X_MONOTONE_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h * \brief defines \c Make_x_monotone_2 functor */ diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h index 8043447ceaa..9e95d7de5fb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h @@ -13,6 +13,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_NON_X_MONOTONE_ARC_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Non_x_monotone_arc_2.h * \brief defines class \c Non_x_monotone_arc_2 * diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 31a98218fbd..f2c5c1bec8a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -14,6 +14,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_POINT_2_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Point_2.h * \brief defines class \c Point_2 that represents a point on a curve that can * be analyzed. diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 748e05e4094..9576806a1b3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -11,7 +11,10 @@ // Author(s) : Pavel Emeliyanenko #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H -#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H 1 +#define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_SWEEP_CURVES_ADAPTER_2_H + +#include + /*!\file include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h * \brief defines class \c Sweep_curves_adapter_2 diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index e6a4a6cc737..fcf022620d9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -19,6 +19,9 @@ #ifndef CGAL_CKVA_CURVE_RENDERER_2_H #define CGAL_CKVA_CURVE_RENDERER_2_H +#include + + #ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE #define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 1 #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h index 273f40362de..1cbc6be5535 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h @@ -22,7 +22,10 @@ */ #ifndef CGAL_CKVA_CURVE_RENDERER_INTERNALS_H -#define CGAL_CKVA_CURVE_RENDERER_INTERNALS_H 1 +#define CGAL_CKVA_CURVE_RENDERER_INTERNALS_H + +#include + #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 56465713530..5300354df86 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -14,6 +14,9 @@ #ifndef CGAL_CKVA_CURVE_RENDERER_TRAITS_H #define CGAL_CKVA_CURVE_RENDERER_TRAITS_H +#include + + #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h index 196d7f53bee..078b7df5b8e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h @@ -17,7 +17,10 @@ */ #ifndef CGAL_CKVA_SUBDIVISION_1_H -#define CGAL_CKVA_SUBDIVISION_1_H 1 +#define CGAL_CKVA_SUBDIVISION_1_H + +#include + #include #include diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h index 7a72d48268b..5a70721c609 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h @@ -17,7 +17,10 @@ */ #ifndef CGAL_CKVA_SUBDIVISION_2_H -#define CGAL_CKVA_SUBDIVISION_2_H 1 +#define CGAL_CKVA_SUBDIVISION_2_H + +#include + #warning this file is considered obsolete diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h index 14ef6913281..c81fd5b93bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h @@ -13,6 +13,9 @@ #ifndef CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H #define CGAL_CURVED_KERNEL_VIA_ANALYSIS_2_TEST_SIMPLE_MODELS_H +#include + + /*!\file include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h * \brief defines dummy implementations satisfying Curve_kernel_2 * concept requirenments diff --git a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h index 0d3fd5af5c8..aabdea5bb49 100644 --- a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Arrangement_2.h @@ -14,6 +14,9 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H +#include + + #include #endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H diff --git a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h index 41c102cb65b..f46345c3fcc 100644 --- a/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/boost/graph/graph_traits_Dual_Arrangement_2.h @@ -14,6 +14,9 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_ARRANGEMENT_2_H +#include + + #include #endif //CGAL_BOOST_GRAPH_GRAPH_TRAITS_DUAL_ARRANGEMENT_2_H diff --git a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h index ffd6af38c9c..7810ca4e62f 100644 --- a/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/include/CGAL/draw_arrangement_2.h @@ -17,6 +17,9 @@ #ifndef CGAL_DRAW_ARRANGEMENT_2_H #define CGAL_DRAW_ARRANGEMENT_2_H +#include + + #include #include From c99b69a0e7d21df6e2b468936a9f08d47f3dda22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 13:50:15 +0100 Subject: [PATCH 46/95] add missing license headers --- .../include/CGAL/draw_polygon_set_2.h | 3 +++ .../include/CGAL/Min_sphere_annulus_d_traits_2.h | 3 +++ .../include/CGAL/Min_sphere_annulus_d_traits_3.h | 3 +++ .../include/CGAL/Min_sphere_annulus_d_traits_d.h | 3 +++ .../include/CGAL/Circular_kernel_2/Intersection_traits.h | 3 +++ .../include/CGAL/Circular_kernel_3/Intersection_traits.h | 3 +++ .../CGAL/Spherical_kernel_type_equality_wrapper.h | 3 +++ .../include/CGAL/Convex_hull_traits_adapter_2.h | 3 +++ GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h | 3 +++ GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h | 3 +++ GraphicsView/include/CGAL/auto_link/Qt.h | 3 +++ GraphicsView/include/CGAL/export/Qt.h | 3 +++ Nef_2/include/CGAL/Nef_2/Polynomial.h | 3 +++ Nef_2/include/CGAL/Nef_2/Polynomial_impl.h | 7 +++++++ Nef_2/include/CGAL/Nef_2/debug.h | 3 +++ Nef_2/include/CGAL/Nef_polynomial_fwd.h | 3 +++ Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h | 3 +++ .../Periodic_3_power_side_of_oriented_power_sphere_3.h | 3 +++ Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 3 +++ Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h | 5 ++++- .../include/CGAL/boost/graph/graph_traits_Polyhedron_3.h | 3 +++ .../boost/graph/halfedge_graph_traits_Polyhedron_3.h | 3 +++ .../include/CGAL/boost/graph/properties_Polyhedron_3.h | 3 +++ .../CGAL/boost/graph/properties_Polyhedron_3_features.h | 3 +++ .../boost/graph/properties_Polyhedron_3_time_stamp.h | 3 +++ .../include/CGAL/Polytope_distance_d_traits_2.h | 3 +++ .../include/CGAL/Polytope_distance_d_traits_3.h | 3 +++ .../include/CGAL/Polytope_distance_d_traits_d.h | 3 +++ Principal_component_analysis/include/CGAL/Subiterator.h | 3 +++ .../include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h | 3 +++ .../include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h | 3 +++ .../include/CGAL/Straight_skeleton_2/IO/print.h | 3 +++ .../include/CGAL/certified_numeric_predicates.h | 3 +++ .../include/CGAL/certified_quotient_predicates.h | 3 +++ .../CGAL/boost/graph/properties_Surface_mesh_features.h | 3 +++ .../boost/graph/properties_Surface_mesh_time_stamp.h | 3 +++ .../include/CGAL/Surface_mesher/Profile_counter.h | 3 +++ .../graph/graph_traits_Triangulation_data_structure_2.h | 3 +++ .../boost/graph/internal/graph_traits_2D_TDS_helper.h | 9 ++++++--- .../graph/properties_Triangulation_data_structure_2.h | 3 +++ .../include/CGAL/IO/Triangulation_off_ostream.h | 3 +++ .../include/CGAL/IO/Triangulation_off_ostream_2.h | 3 +++ Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h | 3 +++ .../include/CGAL/Triangulation_face_base_with_id_2.h | 3 +++ .../include/CGAL/Triangulation_vertex_base_with_id_2.h | 3 +++ Triangulation_2/include/CGAL/apply_to_range.h | 9 ++++++--- .../graph_traits_Constrained_Delaunay_triangulation_2.h | 3 +++ .../graph/graph_traits_Constrained_triangulation_2.h | 3 +++ .../graph_traits_Constrained_triangulation_plus_2.h | 3 +++ .../boost/graph/graph_traits_Delaunay_triangulation_2.h | 3 +++ .../boost/graph/graph_traits_Regular_triangulation_2.h | 3 +++ .../CGAL/boost/graph/graph_traits_Triangulation_2.h | 3 +++ .../boost/graph/graph_traits_Triangulation_hierarchy_2.h | 3 +++ .../boost/graph/internal/graph_traits_2D_triangulation.h | 2 ++ .../internal/graph_traits_2D_triangulation_helper.h | 9 ++++++--- .../boost/graph/internal/properties_2D_triangulation.h | 3 +++ .../properties_Constrained_Delaunay_triangulation_2.h | 3 +++ .../boost/graph/properties_Constrained_triangulation_2.h | 3 +++ .../graph/properties_Constrained_triangulation_plus_2.h | 3 +++ .../boost/graph/properties_Delaunay_triangulation_2.h | 3 +++ .../boost/graph/properties_Regular_triangulation_2.h | 3 +++ .../CGAL/boost/graph/properties_Triangulation_2.h | 3 +++ .../boost/graph/properties_Triangulation_hierarchy_2.h | 3 +++ .../include/CGAL/IO/Triangulation_off_ostream_3.h | 3 +++ Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h | 3 +++ 65 files changed, 208 insertions(+), 10 deletions(-) diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index 58156ed6640..bd9cfec7f7c 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -17,6 +17,9 @@ #ifndef CGAL_DRAW_POLYGON_SET_2_H #define CGAL_DRAW_POLYGON_SET_2_H +#include + + #include #ifdef DOXYGEN_RUNNING diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h index 434368e3ef1..933212c0c6b 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_2.h @@ -17,6 +17,9 @@ #ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H #define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_2_H +#include + + // includes # include # include diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h index 7873d6f4b1a..a941f4e0b46 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_3.h @@ -17,6 +17,9 @@ #ifndef CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H #define CGAL_MIN_SPHERE_ANNULUS_D_TRAITS_3_H +#include + + // includes # include # include diff --git a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h index 0730222f251..ff1feca70bd 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_annulus_d_traits_d.h @@ -17,6 +17,9 @@ #ifndef CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H #define CGAL_MIN_SPHERE_ANULUS_D_TRAITS_D_H +#include + + // includes # include # include diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h index 8896e76c23b..bab7cfadfc1 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Intersection_traits.h @@ -17,6 +17,9 @@ #ifndef CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H #define CGAL_CIRCULAR_KERNEL_2_INTERSECTION_TRAITS_H +#include + + #include #include diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h index b2319846ecb..ed6ac62628f 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Intersection_traits.h @@ -13,6 +13,9 @@ #ifndef CGAL_CIRCULAR_KERNEL_3_INTERSECTION_TRAITS_H #define CGAL_CIRCULAR_KERNEL_3_INTERSECTION_TRAITS_H +#include + + #include #include diff --git a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h index 432fc6bc635..7e3e82c822d 100644 --- a/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h +++ b/Circular_kernel_3/include/CGAL/Spherical_kernel_type_equality_wrapper.h @@ -22,6 +22,9 @@ #ifndef CGAL_SPHERICAL_KERNEL_TYPE_EQUALITY_WRAPPER_H #define CGAL_SPHERICAL_KERNEL_TYPE_EQUALITY_WRAPPER_H +#include + + #include #include #include diff --git a/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h b/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h index b1a7c83210c..eb7f87c96ea 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_traits_adapter_2.h @@ -13,6 +13,9 @@ #ifndef CGAL_CONVEX_HULL_TRAITS_ADAPTER_2_H #define CGAL_CONVEX_HULL_TRAITS_ADAPTER_2_H +#include + + #include #include diff --git a/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h b/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h index c5fdd7c3eff..a617735b67e 100644 --- a/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h +++ b/GraphicsView/include/CGAL/Qt/CGAL_Qt_config.h @@ -12,6 +12,9 @@ #ifndef CGAL_QT_CONFIG_H #define CGAL_QT_CONFIG_H +#include + + #include #if defined(CGAL_Qt6_DLL) diff --git a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h index 7099eddc48c..c984b85a5d2 100644 --- a/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h +++ b/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h @@ -12,6 +12,9 @@ #ifndef CGAL_QT_CREATE_OPENGL_CONTEXT_H #define CGAL_QT_CREATE_OPENGL_CONTEXT_H +#include + + #include namespace CGAL{ diff --git a/GraphicsView/include/CGAL/auto_link/Qt.h b/GraphicsView/include/CGAL/auto_link/Qt.h index f8efb5e983a..a27bb073b2b 100644 --- a/GraphicsView/include/CGAL/auto_link/Qt.h +++ b/GraphicsView/include/CGAL/auto_link/Qt.h @@ -12,6 +12,9 @@ #ifndef CGAL_AUTO_LINK_QT_H #define CGAL_AUTO_LINK_QT_H +#include + + #include #include diff --git a/GraphicsView/include/CGAL/export/Qt.h b/GraphicsView/include/CGAL/export/Qt.h index 8722c6d344c..14ea46c6380 100644 --- a/GraphicsView/include/CGAL/export/Qt.h +++ b/GraphicsView/include/CGAL/export/Qt.h @@ -12,6 +12,9 @@ #ifndef CGAL_QT_EXPORT_H #define CGAL_QT_EXPORT_H +#include + + #include #include diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial.h b/Nef_2/include/CGAL/Nef_2/Polynomial.h index 1f335f6d387..ef494741b98 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial.h @@ -14,6 +14,9 @@ #ifndef CGAL_NEF_2_POLYNOMIAL_H #define CGAL_NEF_2_POLYNOMIAL_H +#include + + #include #include #include diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h b/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h index 19d7c064778..0e39b126b4d 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial_impl.h @@ -11,6 +11,11 @@ // Author(s) : Michael Seel // Andreas Fabri +#ifndef CGAL_NEF_2_POLYNOMIAL_IMPL_H +#define CGAL_NEF_2_POLYNOMIAL_IMPL_H + +#include + namespace CGAL{ @@ -202,3 +207,5 @@ Polynomial Polynomial::gcd( } // end namespace Nef }//end namespace CGAL + +#endif //CGAL_NEF_2_POLYNOMIAL_IMPL_H diff --git a/Nef_2/include/CGAL/Nef_2/debug.h b/Nef_2/include/CGAL/Nef_2/debug.h index 2583e37d523..001eaeaa1ef 100644 --- a/Nef_2/include/CGAL/Nef_2/debug.h +++ b/Nef_2/include/CGAL/Nef_2/debug.h @@ -13,6 +13,9 @@ #ifndef CGAL_NEF_2_DEBUG_H #define CGAL_NEF_2_DEBUG_H +#include + + #include #ifdef NDEBUG diff --git a/Nef_2/include/CGAL/Nef_polynomial_fwd.h b/Nef_2/include/CGAL/Nef_polynomial_fwd.h index 34a534b0d71..17cc9df36f9 100644 --- a/Nef_2/include/CGAL/Nef_polynomial_fwd.h +++ b/Nef_2/include/CGAL/Nef_polynomial_fwd.h @@ -13,6 +13,9 @@ #ifndef CGAL_NEF_POLYNOMIAL_FWD_H #define CGAL_NEF_POLYNOMIAL_FWD_H +#include + + #include // Forward declarations of functions over Polynomial and Nef_polynomial diff --git a/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h b/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h index 2b129cc7ab2..f813b7dc9f4 100644 --- a/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h +++ b/Nef_S2/include/CGAL/Nef_S2/OGL_base_object.h @@ -13,6 +13,9 @@ #ifndef CGAL_OGL_BASE_OBJECT_H #define CGAL_OGL_BASE_OBJECT_H +#include + + #include namespace CGAL { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h index 8a1e06c29ba..748034a41ab 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Static_filters/Periodic_3_power_side_of_oriented_power_sphere_3.h @@ -12,6 +12,9 @@ #ifndef CGAL_INTERNAL_STATIC_FILTERS_PERIODIC_3_POWER_TEST_3_H #define CGAL_INTERNAL_STATIC_FILTERS_PERIODIC_3_POWER_TEST_3_H +#include + + #include #include #include diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index c9b266ebbd6..18db0dc8e34 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -13,6 +13,9 @@ #ifndef CGAL_POLYHEDRON_3_TO_LCC_H #define CGAL_POLYHEDRON_3_TO_LCC_H +#include + + #include #include #include diff --git a/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h b/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h index 008dae42a64..2bbea002775 100644 --- a/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_items_with_id_3.h @@ -10,7 +10,10 @@ // Author(s) : Andreas Fabri, Fernando Cacciola #ifndef CGAL_POLYHEDRON_ITEMS_WITH_ID_3_H -#define CGAL_POLYHEDRON_ITEMS_WITH_ID_3_H 1 +#define CGAL_POLYHEDRON_ITEMS_WITH_ID_3_H + +#include + #include #include diff --git a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h index 7df39974c10..f8e6e9a21ca 100644 --- a/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h @@ -12,6 +12,9 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYHEDRON_3_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYHEDRON_3_H +#include + + #include #include diff --git a/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h index 3571d0c3fa2..6d7bf94b3fb 100644 --- a/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h @@ -13,6 +13,9 @@ #ifndef CGAL_BOOST_GRAPH_HALFEDGE_GRAPH_TRAITS_POLYHEDRON_3_H #define CGAL_BOOST_GRAPH_HALFEDGE_GRAPH_TRAITS_POLYHEDRON_3_H +#include + + #define CGAL_DEPRECATED_HEADER "" #define CGAL_REPLACEMENT_HEADER "" #include diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h index 2b35cb02b4d..b66e213400d 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -12,6 +12,9 @@ #ifndef CGAL_BOOST_GRAPH_PROPERTIES_POLYHEDRON_3_H #define CGAL_BOOST_GRAPH_PROPERTIES_POLYHEDRON_3_H +#include + + #define CGAL_HDS_TMPLT Gt, class I, CGAL_HDS_PARAM_, class A #define CGAL_HDS_CLASS CGAL::Polyhedron_3 diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h index 06a8f4a1514..d047937ec83 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_features.h @@ -12,6 +12,9 @@ #ifndef CGAL_PROPERTIES_POLYHEDRON_3_FEATURES_H #define CGAL_PROPERTIES_POLYHEDRON_3_FEATURES_H +#include + + #include #include diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h index 5a2fdc85417..8d88c8fd895 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3_time_stamp.h @@ -12,6 +12,9 @@ #ifndef CGAL_PROPERTIES_POLYHEDRON_3_TIME_STAMP_H #define CGAL_PROPERTIES_POLYHEDRON_3_TIME_STAMP_H +#include + + #include #define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h index 345367b6c11..c051cf033b3 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_2.h @@ -17,6 +17,9 @@ #ifndef CGAL_POLYTOPE_DISTANCE_D_TRAITS_2_H #define CGAL_POLYTOPE_DISTANCE_D_TRAITS_2_H +#include + + // includes # include # include diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h index 5f24e083d99..fefc27f69ee 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_3.h @@ -17,6 +17,9 @@ #ifndef CGAL_POLYTOPE_DISTANCE_D_TRAITS_3_H #define CGAL_POLYTOPE_DISTANCE_D_TRAITS_3_H +#include + + // includes # include # include diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h index b115b610c72..1c88c7ee567 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d_traits_d.h @@ -17,6 +17,9 @@ #ifndef CGAL_POLYTOPE_DISTANCE_D_TRAITS_D_H #define CGAL_POLYTOPE_DISTANCE_D_TRAITS_D_H +#include + + // includes # include # include diff --git a/Principal_component_analysis/include/CGAL/Subiterator.h b/Principal_component_analysis/include/CGAL/Subiterator.h index 0d31b12a8e8..c860be7a361 100644 --- a/Principal_component_analysis/include/CGAL/Subiterator.h +++ b/Principal_component_analysis/include/CGAL/Subiterator.h @@ -13,6 +13,9 @@ #ifndef CGAL_PCA_SUBITERATOR_H #define CGAL_PCA_SUBITERATOR_H +#include + + #include namespace CGAL diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h index 5adc8c897c2..61b3eed75b2 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_stream.h @@ -15,6 +15,9 @@ #ifndef CGAL_DXF_STREAM_H #define CGAL_DXF_STREAM_H +#include + + #include #include diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h index e2d3ec5c50a..2251dbe09e2 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/Dxf_writer.h @@ -15,6 +15,9 @@ #ifndef CGAL_IO_DXF_WRITER_H #define CGAL_IO_DXF_WRITER_H +#include + + #include #include diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h index a389b96c138..6c9c493ae87 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/IO/print.h @@ -12,6 +12,9 @@ #ifndef CGAL_SLS_IO_PRINT_H #define CGAL_SLS_IO_PRINT_H +#include + + #include #include #include diff --git a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h index 5468e8b9699..f7d82b3c093 100644 --- a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h +++ b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h @@ -11,6 +11,9 @@ #ifndef CGAL_CERTIFIED_NUMERIC_PREDICATES_H #define CGAL_CERTIFIED_NUMERIC_PREDICATES_H +#include + + #include #include #include diff --git a/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h b/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h index 46ba2d948c2..5ecf764b5d8 100644 --- a/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h +++ b/Straight_skeleton_2/include/CGAL/certified_quotient_predicates.h @@ -11,6 +11,9 @@ #ifndef CGAL_CERTIFIED_QUOTIENT_PREDICATES_H #define CGAL_CERTIFIED_QUOTIENT_PREDICATES_H +#include + + #include #include diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h index 68fd42eb79e..1484943f078 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_features.h @@ -12,6 +12,9 @@ #ifndef CGAL_PROPERTIES_SURFACE_MESH_FEATURES_H #define CGAL_PROPERTIES_SURFACE_MESH_FEATURES_H +#include + + #ifndef DOXYGEN_RUNNING #include diff --git a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h index 06baa03192e..de779d13a28 100644 --- a/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h +++ b/Surface_mesh/include/CGAL/boost/graph/properties_Surface_mesh_time_stamp.h @@ -12,6 +12,9 @@ #ifndef CGAL_PROPERTIES_SURFACE_MESH_TIME_STAMP_H #define CGAL_PROPERTIES_SURFACE_MESH_TIME_STAMP_H +#include + + #ifndef DOXYGEN_RUNNING #include diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h b/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h index 32591b23968..12a0c01cc94 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Profile_counter.h @@ -16,6 +16,9 @@ #ifndef CGAL_SURFACE_MESHER_PROFILE_COUNTER_H #define CGAL_SURFACE_MESHER_PROFILE_COUNTER_H +#include + + #include #ifdef CGAL_SURFACE_MESHER_PROFILE diff --git a/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h b/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h index 2ebbf85432b..55ff0388bcf 100644 --- a/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_TRIANGULATION_DATA_STRUCTURE_2_H #define CGAL_GRAPH_TRAITS_TRIANGULATION_DATA_STRUCTURE_2_H +#include + + // include this to avoid a VC15 warning #include #include diff --git a/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h b/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h index 483690396b5..1c0b1ae4b40 100644 --- a/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h +++ b/TDS_2/include/CGAL/boost/graph/internal/graph_traits_2D_TDS_helper.h @@ -19,8 +19,11 @@ #include #include -#ifndef CGAL_GRAPH_TRAITS_2D_TDS_HELPERS -#define CGAL_GRAPH_TRAITS_2D_TDS_HELPERS +#ifndef CGAL_GRAPH_TRAITS_2D_TDS_HELPERS_H +#define CGAL_GRAPH_TRAITS_2D_TDS_HELPERS_H + +#include + namespace CGAL { namespace internal { @@ -319,4 +322,4 @@ struct hash > } // namespace std -#endif // CGAL_GRAPH_TRAITS_2D_TDS_HELPERS +#endif // CGAL_GRAPH_TRAITS_2D_TDS_HELPERS_H diff --git a/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h b/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h index 151af643059..91ba969bd6d 100644 --- a/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/boost/graph/properties_Triangulation_data_structure_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_TRIANGULATION_DATA_STRUCTURE_2_H #define CGAL_PROPERTIES_TRIANGULATION_DATA_STRUCTURE_2_H +#include + + #include #include #include diff --git a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h index 5dbe2895f10..36fc501daf0 100644 --- a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h +++ b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h @@ -13,6 +13,9 @@ #ifndef CGAL_TRIANGULATION_IO_H #define CGAL_TRIANGULATION_IO_H +#include + + #include #include #include diff --git a/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h b/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h index 6d96c38bcb9..6fdcb5b03c4 100644 --- a/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h +++ b/Triangulation_2/include/CGAL/IO/Triangulation_off_ostream_2.h @@ -13,6 +13,9 @@ #ifndef CGAL_TRIANGULATION_OFF_OSTREAM_2_H #define CGAL_TRIANGULATION_OFF_OSTREAM_2_H +#include + + #include #include #include diff --git a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h index 6f24fd8e50e..21607148403 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h @@ -13,6 +13,9 @@ #ifndef CGAL_TRIANGULATION_2_TO_LCC_H #define CGAL_TRIANGULATION_2_TO_LCC_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h b/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h index 72fd9fcfba6..eec9abb65c3 100644 --- a/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_face_base_with_id_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_TRIANGULATION_FACE_BASE_WITH_ID_2_H #define CGAL_TRIANGULATION_FACE_BASE_WITH_ID_2_H +#include + + #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h b/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h index aca49c503bc..310d3c158e4 100644 --- a/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_vertex_base_with_id_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_TRIANGULATION_VERTEX_BASE_WITH_ID_2_H #define CGAL_TRIANGULATION_VERTEX_BASE_WITH_ID_2_H +#include + + #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/apply_to_range.h b/Triangulation_2/include/CGAL/apply_to_range.h index 9df2dbd2366..fc235d47a48 100644 --- a/Triangulation_2/include/CGAL/apply_to_range.h +++ b/Triangulation_2/include/CGAL/apply_to_range.h @@ -10,8 +10,11 @@ // // Author(s) : Radu Ursu -#ifndef CGAL_apply_to_range_h -#define CGAL_apply_to_range_h +#ifndef CGAL_APPLY_TO_RANGE_H +#define CGAL_APPLY_TO_RANGE_H + +#include + #include #include @@ -151,4 +154,4 @@ void apply_to_range(const Tr &t, }//end namespace -#endif +#endif //CGAL_APPLY_TO_RANGE_H diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h index c4a6e7f61bd..ae3cdba64d3 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_Delaunay_triangulation_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_CONSTRAINED_DELAUNAY_TRIANGULATION_2_H #define CGAL_GRAPH_TRAITS_CONSTRAINED_DELAUNAY_TRIANGULATION_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h index 3f4fa4e9245..50b31a0d05f 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_CONSTRAINED_TRIANGULATION_2_H #define CGAL_GRAPH_TRAITS_CONSTRAINED_TRIANGULATION_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h index 85f44168e9a..fb21cff567a 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Constrained_triangulation_plus_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_CONSTRAINED_TRIANGULATION_PLUS_2_H #define CGAL_GRAPH_TRAITS_CONSTRAINED_TRIANGULATION_PLUS_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h index 35ac74f22ea..22b95fd4cfd 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_DELAUNAY_TRIANGULATION_2_H #define CGAL_GRAPH_TRAITS_DELAUNAY_TRIANGULATION_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h index 4595604b503..127a345a9e2 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Regular_triangulation_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_REGULAR_TRIANGULATION_2_H #define CGAL_GRAPH_TRAITS_REGULAR_TRIANGULATION_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h index 42bbed130b5..8a50f96e3df 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_TRIANGULATION_2_H #define CGAL_GRAPH_TRAITS_TRIANGULATION_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h index cd07894b313..eae9f93cefe 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_hierarchy_2.h @@ -12,6 +12,9 @@ #ifndef CGAL_GRAPH_TRAITS_TRIANGULATION_HIERARCHY_2_H #define CGAL_GRAPH_TRAITS_TRIANGULATION_HIERARCHY_2_H +#include + + #include #include diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h index e120e7d626f..976c6741e63 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation.h @@ -10,6 +10,8 @@ // Andreas Fabri, // Fernando Cacciola +#include + #ifndef CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS #error CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS is not defined #endif diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h index 46a904bc1c3..22a4a4c2f3c 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/graph_traits_2D_triangulation_helper.h @@ -17,8 +17,11 @@ #include -#ifndef CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS -#define CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS +#ifndef CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS_H +#define CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS_H + +#include + namespace CGAL { namespace internal { @@ -181,4 +184,4 @@ private: } // namespace internal } // namespace CGAL -#endif // CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS +#endif // CGAL_GRAPH_TRAITS_2D_TRIANGULATION_HELPERS_H diff --git a/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h b/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h index 65516f9f3b3..2ac267ebcf8 100644 --- a/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h +++ b/Triangulation_2/include/CGAL/boost/graph/internal/properties_2D_triangulation.h @@ -26,6 +26,9 @@ #ifndef CGAL_BOOST_GRAPH_PROPERTIES_2D_TRIANGULATION_H #define CGAL_BOOST_GRAPH_PROPERTIES_2D_TRIANGULATION_H +#include + + namespace CGAL { namespace internal { diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h index b070a293df1..e3ee3e3bb67 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_Delaunay_triangulation_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_CONSTRAINED_DELAUNAY_TRIANGULATION_2_H #define CGAL_PROPERTIES_CONSTRAINED_DELAUNAY_TRIANGULATION_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename GT, typename TDS, typename Itag diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h index e56fc487b47..0fdc55290c2 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_CONSTRAINED_TRIANGULATION_2_H #define CGAL_PROPERTIES_CONSTRAINED_TRIANGULATION_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename GT, typename TDS, typename Itag diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h index 6e0f16ea086..8d2df8776c9 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Constrained_triangulation_plus_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_CONSTRAINED_TRIANGULATION_PLUS_2_H #define CGAL_PROPERTIES_CONSTRAINED_TRIANGULATION_PLUS_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename Tr diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h index 6367bc5a58b..a040184b4b8 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Delaunay_triangulation_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_DELAUNAY_TRIANGULATION_2_H #define CGAL_PROPERTIES_DELAUNAY_TRIANGULATION_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename GT, typename TDS diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h index 7d91b01ae96..a4d0f9a4acc 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Regular_triangulation_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_REGULAR_TRIANGULATION_2_H #define CGAL_PROPERTIES_REGULAR_TRIANGULATION_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename GT, typename TDS diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h index 25c60a34d80..6c111297bfa 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_TRIANGULATION_2_H #define CGAL_PROPERTIES_TRIANGULATION_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename GT, typename TDS diff --git a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h index 9ed8bbdb193..830c4f8f6b5 100644 --- a/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/properties_Triangulation_hierarchy_2.h @@ -11,6 +11,9 @@ #ifndef CGAL_PROPERTIES_TRIANGULATION_HIERARCHY_2_H #define CGAL_PROPERTIES_TRIANGULATION_HIERARCHY_2_H +#include + + #include #define CGAL_2D_TRIANGULATION_TEMPLATE_PARAMETERS typename Tr diff --git a/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h b/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h index 4708dc1b7e1..55f1b953a5d 100644 --- a/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h +++ b/Triangulation_3/include/CGAL/IO/Triangulation_off_ostream_3.h @@ -13,6 +13,9 @@ #ifndef CGAL_TRIANGULATION_OFF_OSTREAM_3_H #define CGAL_TRIANGULATION_OFF_OSTREAM_3_H +#include + + #include #include #include diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index 43079354d0a..19f495dbfbe 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -13,6 +13,9 @@ #ifndef CGAL_TRIANGULATION_3_TO_LCC_H #define CGAL_TRIANGULATION_3_TO_LCC_H +#include + + #include #include #include From cc3278e0a1f0a43d8e63a26879465131db009921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 13:53:38 +0100 Subject: [PATCH 47/95] update license --- GraphicsView/package_info/GraphicsView/license.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/GraphicsView/package_info/GraphicsView/license.txt b/GraphicsView/package_info/GraphicsView/license.txt index 3ca1763d670..b75100428a6 100644 --- a/GraphicsView/package_info/GraphicsView/license.txt +++ b/GraphicsView/package_info/GraphicsView/license.txt @@ -1,3 +1,2 @@ GPL (v3 or later) -LGPL (v3 or later) UNKNOWN From e214d40c0e58922825703379ca91e86591fc5b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 13:55:35 +0100 Subject: [PATCH 48/95] add missing license header --- .../include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h | 2 ++ .../CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h index 654560ce419..ae1085f0686 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h @@ -13,6 +13,8 @@ #ifndef CGAL_DEFORMATION_EIGEN_CLOSEST_ROTATION_TRAITS_3_H #define CGAL_DEFORMATION_EIGEN_CLOSEST_ROTATION_TRAITS_3_H +#include + #include #include diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h index b5ba19187ac..4ca1c5d54e1 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h @@ -13,6 +13,8 @@ #ifndef CGAL_DEFORMATION_EIGEN_POLAR_CLOSEST_ROTATION_TRAITS_3_H #define CGAL_DEFORMATION_EIGEN_POLAR_CLOSEST_ROTATION_TRAITS_3_H +#include + #include #include #include From 6f1b34fa6ed441c392a9900f1e0b98eae3a32437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 14:05:52 +0100 Subject: [PATCH 49/95] restore LGPL for file from another institute than the package owner --- Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h | 2 +- .../include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h | 2 +- .../CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h index 18db0dc8e34..bda362a0d2d 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h +++ b/Polyhedron/include/CGAL/Polyhedron_3_to_lcc.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Guillaume Damiand // diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h index ae1085f0686..b74261b1250 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_closest_rotation_traits_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Gael Guennebaud and Ilker O. Yaz diff --git a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h index 4ca1c5d54e1..9a94375100e 100644 --- a/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h +++ b/Surface_mesh_deformation/include/CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h @@ -5,7 +5,7 @@ // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Gael Guennebaud Ilker O. Yaz From 0ab6971ede29fe469b5ee1aefa8ef79c3ed744fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 14:30:40 +0100 Subject: [PATCH 50/95] use execute_process that is recommanded over exec_command since 3.0 --- Installation/CMakeLists.txt | 6 ++---- Installation/cmake/modules/CGAL_Common.cmake | 3 ++- .../cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 3 ++- cmake_uninstall.cmake.in | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index aa09f590126..1a213f551d5 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -592,10 +592,8 @@ set(CGAL_INSTALL_LIB_DIR ) if(CGAL_WIN32_CMAKE_ON_CYGWIN) - exec_program( - cygpath ARGS - -w "${CMAKE_INSTALL_PREFIX}" - OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2) + execute_process(COMMAND cygpath -w ${CMAKE_INSTALL_PREFIX} + OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2) file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX) endif() diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index ce99da6489e..c576785c7cd 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -20,7 +20,8 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) if ( WIN32 ) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) if(CMAKE_UNAME) - exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2) + execute_process(COMMAND uname -s + OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2) if ( CMAKE_SYSTEM_NAME2 MATCHES "CYGWIN" ) message( STATUS "This is the Windows CMake running within the cygwin platform." ) set( CGAL_WIN32_CMAKE_ON_CYGWIN TRUE CACHE INTERNAL "This is the cygwin platform." ) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index e70370b2c31..08f68eeb315 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -39,7 +39,8 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) # From james Bigler, in the cmake users list. IF (APPLE) - exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION) + execute_process(COMMAND uname -v + OUTPUT_VARIABLE DARWIN_VERSION) string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) message(STATUS "Running in macOS DARWIN_VERSION=${DARWIN_VERSION}") endif() diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index d00a5166581..d2baa65da87 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -12,10 +12,10 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + execute_process( + COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval + RESULT_VARIABLE rm_retval ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") From b59250bfeb5e1a7ea1e05a7563331c0aca03b95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 14:44:27 +0100 Subject: [PATCH 51/95] conditional compilation --- Envelope_3/test/Envelope_3/CMakeLists.txt | 15 +++++++-------- Envelope_3/test/Envelope_3/spheres_test.cpp | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Envelope_3/test/Envelope_3/CMakeLists.txt b/Envelope_3/test/Envelope_3/CMakeLists.txt index b087dba97ef..c5eb08f87fa 100644 --- a/Envelope_3/test/Envelope_3/CMakeLists.txt +++ b/Envelope_3/test/Envelope_3/CMakeLists.txt @@ -6,11 +6,10 @@ project(Envelope_3_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -# 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("triangles_test.cpp") + +if (CGAL_Core_FOUND) + create_single_source_cgal_program("spheres_test.cpp") +else() + message("NOTICE: A test requires CGAL_Core, and will not be compiled.") +endif() diff --git a/Envelope_3/test/Envelope_3/spheres_test.cpp b/Envelope_3/test/Envelope_3/spheres_test.cpp index 7fd2634e1a9..2d45e12526a 100644 --- a/Envelope_3/test/Envelope_3/spheres_test.cpp +++ b/Envelope_3/test/Envelope_3/spheres_test.cpp @@ -5,7 +5,7 @@ int main () { - bool UNTESTED_TRAITS_AS_CORE_IS_NOT_ISTALLED; + bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl << "WARNING: Core is not installed, " << "skipping the test ..." From 336a8f39dc77f7667681a65a35a83909231c12b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 15:15:23 +0100 Subject: [PATCH 52/95] please CI --- Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 7e820e12a76..4256fd0dc17 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -30,6 +30,9 @@ #include #include // CGAL_PI is defined there #include +#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE) +#include +#endif #include namespace CGAL { From 8242a407b2427cb433acb69f414d476a62d4e059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 16:34:06 +0100 Subject: [PATCH 53/95] remove useless anchor --- .../doc/Arrangement_on_surface_2/CGAL/Arr_observer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h index a248556f650..99abf22396f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_observer.h @@ -1,8 +1,6 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Ref - * - * \anchor arr_refarr_obs * * `Arr_observer` is an alias for * Aos_observer`, From c6eed472fd610c3ec1d2f0c315d02b8caec09da4 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 17:19:47 +0100 Subject: [PATCH 54/95] fix warning --- Polyhedron/demo/Polyhedron/triangulate_primitive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index 4fd4afa6a00..5f84f6e0a89 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -125,7 +125,7 @@ private: std::vector skip(idPoints.size(), false); for (std::size_t i = 0; i < idPoints.size(); i++) { - int prev = (i - 1 + idPoints.size()) % idPoints.size(); + std::size_t prev = (i - 1 + idPoints.size()) % idPoints.size(); if (idPoints[i].first < idPoints[prev].first) { auto it = edge_map.emplace(std::make_pair(idPoints[i].first, idPoints[prev].first), i); if (!it.second) { From 4a2d0704fc7aefcd44f85f8321053085967c0312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 17:27:10 +0100 Subject: [PATCH 55/95] fix warnings --- Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp | 2 +- Polyhedron/demo/Polyhedron/triangulate_primitive.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 688cf858745..23aeffc3795 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -1371,7 +1371,7 @@ QList Scene_surface_mesh_item_priv::triangulate_primitive(fac //iterates on the internal faces to add the vertices to the positions //and the normals to the appropriate vectors - auto f = [&](auto &ffit, auto& v2v) { + auto f = [&](auto &ffit, auto&) { if (ffit.info().is_external) return; diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index 5f84f6e0a89..4b0d0f13770 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -143,7 +143,6 @@ private: } Vertex_handle previous, first, last_inserted; - std::size_t previd, firstid, lastid; // Iterate the points of the facet and decide if they must be inserted in the CDT typename Kernel::FT x(0), y(0), z(0); @@ -163,7 +162,6 @@ private: v2v[vh] = idPoint.second; if (first == Vertex_handle()) { first = vh; - firstid = idPoint.second; } if(previous != nullptr && previous != vh) @@ -171,10 +169,8 @@ private: if (!skip[i]) cdt->insert_constraint(previous, vh); last_inserted = previous; - lastid = previd; } previous = vh; - previd = idPoint.second; } } From 526700057a68a3a96824a42adbe22f4bbef5e41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 5 Jan 2024 12:55:10 +0100 Subject: [PATCH 56/95] Add missing GPL packages in the gpl_package_list.txt collection --- Installation/include/CGAL/license/gpl_package_list.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/include/CGAL/license/gpl_package_list.txt b/Installation/include/CGAL/license/gpl_package_list.txt index 41612d5b9fc..393265b883f 100644 --- a/Installation/include/CGAL/license/gpl_package_list.txt +++ b/Installation/include/CGAL/license/gpl_package_list.txt @@ -20,6 +20,7 @@ Convex_hull_d dD Convex Hulls and Delaunay Triangulations Envelope_2 2D Envelopes Envelope_3 3D Envelopes GraphicsView CGAL and the Qt Graphics View Framework +Heat_method_3 The Heat Method Hyperbolic_triangulation_2 2D Hyperbolic Delaunay Triangulations Inscribed_areas Inscribed Areas Interpolation 2D and Surface Function Interpolation @@ -45,6 +46,7 @@ Point_set_2 2D Range and Neighbor Search Point_set_3 3D Point Set Point_set_processing_3 Point Set Processing Poisson_surface_reconstruction_3 Poisson Surface Reconstruction +Polygonal_surface_reconstruction Polygonal Surface Reconstruction Polygon_mesh_processing Polygon Mesh Processing Polygon_mesh_processing/Compute_normal Polygon Mesh Processing - Normal Computation Polygon_mesh_processing/connected_components Polygon Mesh Processing - Connected Components @@ -52,6 +54,7 @@ Polygon_mesh_processing/corefinement Polygon Mesh Processing - Corefinement Polygon_mesh_processing/core Polygon Mesh Processing - Core Polygon_mesh_processing/distance Polygon Mesh Processing - Distance Polygon_mesh_processing/interpolated_corrected_curvatures Polygon Mesh Processing - Interpolated Corrected Curvatures +Polygon_mesh_processing/locate Polygon Mesh Processing - Locate Polygon_mesh_processing/measure Polygon Mesh Processing - Geometric Measure Polygon_mesh_processing/meshing_hole_filling Polygon Mesh Processing - Meshing and Hole Filling Polygon_mesh_processing/orientation Polygon Mesh Processing - Orientation From b2919c7bd7d907befee0946ceea8a11af7a3039f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 5 Jan 2024 12:55:42 +0100 Subject: [PATCH 57/95] Re-order some package names to follow alphabetical order --- Installation/include/CGAL/license/gpl_package_list.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Installation/include/CGAL/license/gpl_package_list.txt b/Installation/include/CGAL/license/gpl_package_list.txt index 393265b883f..36e2d1a2904 100644 --- a/Installation/include/CGAL/license/gpl_package_list.txt +++ b/Installation/include/CGAL/license/gpl_package_list.txt @@ -34,9 +34,9 @@ Minkowski_sum_3 3D Minkowski Sum of Polyhedra Nef_2 2D Boolean Operations on Nef Polygons Nef_3 3D Boolean Operations on Nef Polyhedra Nef_S2 2D Boolean Operations on Nef Polygons Embedded on the Sphere -Orthtree Quadtrees, Octrees, and Orthtrees Optimal_bounding_box Optimal Bounding Box Optimal_transportation_reconstruction_2 Optimal Transportation Curve Reconstruction +Orthtree Quadtrees, Octrees, and Orthtrees Partition_2 2D Polygon Partitioning Periodic_2_triangulation_2 2D Periodic Triangulations Periodic_3_mesh_3 3D Periodic Mesh Generation @@ -78,15 +78,16 @@ Set_movable_separability_2 2D Movable Separability of Sets Shape_detection Shape Detection Shape_regularization Shape Regularization Skin_surface_3 3D Skin Surface Meshing +SMDS_3 3D Simplicial Mesh Data Structure Snap_rounding_2 2D Snap Rounding Spatial_searching dD Spatial Searching Straight_skeleton_2 2D Straight Skeleton and Polygon Offsetting Straight_skeleton_extrusion_2 2D Straight Skeleton Extrusion Stream_lines_2 2D Placement of Streamlines +Surface_mesh_approximation Triangulated Surface Mesh Approximation Surface_mesh_deformation Triangulated Surface Mesh Deformation Surface_mesher 3D Surface Mesh Generation Surface_mesh Surface Mesh -Surface_mesh_approximation Triangulated Surface Mesh Approximation Surface_mesh_parameterization Triangulated Surface Mesh Parameterization Surface_mesh_segmentation Triangulated Surface Mesh Segmentation Surface_mesh_shortest_path Triangulated Surface Mesh Shortest Paths @@ -96,12 +97,11 @@ Surface_mesh_topology Surface Mesh Topology Surface_sweep_2 2D Intersection of Curves TDS_2 2D Triangulation Data Structure TDS_3 3D Triangulation Data Structure +Tetrahedral_remeshing Tetrahedral Remeshing Three Three -SMDS_3 3D Simplicial Mesh Data Structure Triangulation_2 2D Triangulation -Triangulation_on_sphere_2 2D Triangulation on Sphere Triangulation_3 3D Triangulations Triangulation dD Triangulations +Triangulation_on_sphere_2 2D Triangulation on Sphere Visibility_2 2D Visibility Computation Voronoi_diagram_2 2D Voronoi Diagram Adaptor -Tetrahedral_remeshing Tetrahedral Remeshing From f970b9bba488c4cc47532ce1ca651fe8edd77ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 5 Jan 2024 14:08:32 +0100 Subject: [PATCH 58/95] add option to remove extra newline --- Installation/CMakeLists.txt | 1 + Installation/cmake/modules/CGAL_Common.cmake | 1 + Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 1 + cmake_uninstall.cmake.in | 1 + 4 files changed, 4 insertions(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 1a213f551d5..058e4c70744 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -593,6 +593,7 @@ set(CGAL_INSTALL_LIB_DIR if(CGAL_WIN32_CMAKE_ON_CYGWIN) execute_process(COMMAND cygpath -w ${CMAKE_INSTALL_PREFIX} + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2) file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX) endif() diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index c576785c7cd..df6446c92ae 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -21,6 +21,7 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) if(CMAKE_UNAME) execute_process(COMMAND uname -s + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2) if ( CMAKE_SYSTEM_NAME2 MATCHES "CYGWIN" ) message( STATUS "This is the Windows CMake running within the cygwin platform." ) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index 08f68eeb315..7d35835f7db 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -40,6 +40,7 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) # From james Bigler, in the cmake users list. IF (APPLE) execute_process(COMMAND uname -v + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE DARWIN_VERSION) string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION}) message(STATUS "Running in macOS DARWIN_VERSION=${DARWIN_VERSION}") diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index d2baa65da87..62bd37f80fd 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -14,6 +14,7 @@ foreach(file ${files}) if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") execute_process( COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE rm_out RESULT_VARIABLE rm_retval ) From c60403165633cac69207f3a1b6dd18717ea3d386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 5 Jan 2024 15:46:03 +0100 Subject: [PATCH 59/95] Add another missing GPL license to gpl_package_list.txt --- Installation/include/CGAL/license/gpl_package_list.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/include/CGAL/license/gpl_package_list.txt b/Installation/include/CGAL/license/gpl_package_list.txt index 36e2d1a2904..98f2204a361 100644 --- a/Installation/include/CGAL/license/gpl_package_list.txt +++ b/Installation/include/CGAL/license/gpl_package_list.txt @@ -58,6 +58,7 @@ Polygon_mesh_processing/locate Polygon Mesh Processing - Locate Polygon_mesh_processing/measure Polygon Mesh Processing - Geometric Measure Polygon_mesh_processing/meshing_hole_filling Polygon Mesh Processing - Meshing and Hole Filling Polygon_mesh_processing/orientation Polygon Mesh Processing - Orientation +Polygon_mesh_processing/Polyhedral_envelope Polygon Mesh Processing - Polyhedral Envelope Polygon_mesh_processing/predicate Polygon Mesh Processing - Predicate Polygon_mesh_processing/combinatorial_repair Polygon Mesh Processing - Combinatorial Repair Polygon_mesh_processing/geometric_repair Polygon Mesh Processing - Geometric Repair From 6b6d55d03ad3b1e495bf0dcddb6cd6ec5f0eee4c Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 12:36:44 +0300 Subject: [PATCH 60/95] note about jet fitting package in user man --- .../Polygon_mesh_processing/Polygon_mesh_processing.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index beeadb4516e..afe829f6490 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -960,6 +960,11 @@ quad meshes, and meshes with n-gon faces (for n-gons, the centroid must be insid The algorithms used prove to work well in general. Also, on meshes with noise on vertex positions, they give accurate results, under the condition that the correct vertex normals are provided. +It is worth noting that the Principal Curvatures and Directions can also be estimated using the +\ref PkgJetFitting3 package, which estimates the local differential quantities of a surface at a point +using a local polynomial fitting (fitting a d-jet). Unlike the Interpolated Corrected Curvatures, +the Jet Fitting method discards topological information and thus can be used on point clouds as well. + \subsection ICCBackground Brief Background Surface curvatures are quantities that describe the local geometry of a surface. They are important in many @@ -1301,7 +1306,7 @@ available on 7th of October 2020. It only uses the high level algorithm of chec is covered by a set of prisms, where each prism is an offset for an input triangle. That is, the implementation in \cgal does not use indirect predicates. -The interpolated corrected curvatures were implemented during GSoC 2022. This was implemented by Hossam Saeed and under +The interpolated corrected curvatures were implemented during GSoC 2022. This was implemented by Hossam Saeed and under the supervision of David Coeurjolly, Jaques-Olivier Lachaud, and Sébastien Loriot. The implementation is based on \cgalCite{cgal:lrtc-iccmps-20}. DGtal's implementation was also used as a reference during the project. From df09c6894e02c238f23da6564f46e1fe5db11c51 Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 15:43:19 +0300 Subject: [PATCH 61/95] Performance --- .../Polygon_mesh_processing.txt | 127 +++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index afe829f6490..f851c2098cb 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1027,7 +1027,7 @@ These computations are performed using (on all vertices of the mesh) `CGAL::Poly where function named parameters are used to select the curvatures (and possibly directions) to be computed. An overload function with the same name but taking a given vertex is also available in case the computation should be done only for that vertex. -\subsection ICCResults Results & Performance +\subsection ICCResults Results First, \cgalFigureRef{icc_measures} illustrates various curvature measures on a triangular mesh. @@ -1072,6 +1072,131 @@ When changing the integration ball radius, we obtain a scale space of curvature \cgalFigureCaptionEnd +\subsection ICCPerformance Performance + +The implemented algorithms exhibit a linear complexity in the number of faces of the mesh. It is worth noting that +we pre-computed the vertex normals and passed them as a named parameter to the function to better estimate the +performance of the curvature computation. For the data reported in the following table, we used a machine with an +Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compiled with Visual Studio 2019. + +\cgalFigureAnchor{icc_performance_table} + ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Ball
      Radius
      ComputationSpot
      (6k faces)
      Bunny
      (144K faces)
      Stanford Dragon
      (871K faces)
      Old Age or Winter
      (6M faces)
      vertex
      1-ring faces
      (default)
      Mean   Curvature < 0.001 s0.019 s0.11 s2.68 s
      Gaussian Curvature < 0.001 s0.017 s0.10 s2.77 s
      Principal Curvature & Directions0.002 s0.044 s0.25 s3.98 s
      All (optimized for shared computations)0.003 s0.049 s0.28 s4.52 s
      r = 0.1
      * avg_edge_length
      Mean Curvature0.017 s0.401 s2.66 s22.29 s
      Gaussian Curvature0.018 s0.406 s2.63 s21.61 s
      Principal Curvature & Directions0.019 s0.430 s2.85 s23.55 s
      All (optimized for shared computations)0.017 s0.428 s2.89 s24.16 s
      r = 0.5
      * avg_edge_length
      Mean Curvature0.024 s0.388 s3.18 s22.79 s
      Gaussian Curvature0.024 s0.392 s3.21 s23.58 s
      Principal Curvature & Directions0.027 s0.428 s3.41 s24.44 s
      All (optimized for shared computations)0.025 s0.417 s3.44 s23.93 s
      +\cgalFigureCaptionBegin{icc_performance_table} +Performance of the curvature computation on various meshes (in seconds). The first row shows the performance of the default value for the ball radius, +which is using the 1-ring of neighboring faces around each vertex, instead of actually approximating the inclusion ratio of the faces in the ball. +The other rows show a ball radius of 0.1 (and 0.5) scaled by the average edge length of the mesh. It is clear that using the 1-ring of faces +is much faster, but it might not be as effective when used on a noisy input mesh. +\cgalFigureCaptionEnd + + \ref BGLPropertyMaps are used to record the computed curvatures as shown in examples. In the following examples, for each property map, we associate a curvature value to each vertex. From 5cf55e5df693c6b79a08b35718193e74419ca1a0 Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 16:06:12 +0300 Subject: [PATCH 62/95] unsupported tags fix --- .../Polygon_mesh_processing.txt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index f851c2098cb..4ee207ab90c 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1080,16 +1080,8 @@ performance of the curvature computation. For the data reported in the following Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compiled with Visual Studio 2019. \cgalFigureAnchor{icc_performance_table} +
      -------- - @@ -1098,8 +1090,6 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi - - @@ -1187,8 +1177,9 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi -
      Ball
      Radius
      ComputationStanford Dragon
      (871K faces)
      Old Age or Winter
      (6M faces)
      vertex
      1-ring faces
      (default)
      Mean   Curvature3.44 s 23.93 s
      +
      + \cgalFigureCaptionBegin{icc_performance_table} Performance of the curvature computation on various meshes (in seconds). The first row shows the performance of the default value for the ball radius, which is using the 1-ring of neighboring faces around each vertex, instead of actually approximating the inclusion ratio of the faces in the ball. From 389b4c1809ce1f21c4ecc00227e56063ffe7b45b Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 19:29:05 +0300 Subject: [PATCH 63/95] table classes removed --- .../Polygon_mesh_processing.txt | 141 +++++++++--------- 1 file changed, 70 insertions(+), 71 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 4ee207ab90c..b89df53fb69 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1081,105 +1081,104 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi \cgalFigureAnchor{icc_performance_table}
      - +
      - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +
      Ball
      Radius
      ComputationSpot
      (6k faces)
      Bunny
      (144K faces)
      Stanford Dragon
      (871K faces)
      Old Age or Winter
      (6M faces)
      Ball
      Radius
      ComputationSpot
      (6k faces)
      Bunny
      (144K faces)
      Stanford Dragon
      (871K faces)
      Old Age or Winter
      (6M faces)
      vertex
      1-ring faces
      (default)
      Mean   Curvature < 0.001 s0.019 s0.11 s2.68 svertex
      1-ring faces
      (default)
      Mean   Curvature < 0.001 s0.019 s0.11 s2.68 s
      Gaussian Curvature < 0.001 s0.017 s0.10 s2.77 sGaussian Curvature < 0.001 s0.017 s0.10 s2.77 s
      Principal Curvature & Directions0.002 s0.044 s0.25 s3.98 sPrincipal Curvature & Directions0.002 s0.044 s0.25 s3.98 s
      All (optimized for shared computations)0.003 s0.049 s0.28 s4.52 sAll (optimized for shared computations)0.003 s0.049 s0.28 s4.52 s
      r = 0.1
      * avg_edge_length
      Mean Curvature0.017 s0.401 s2.66 s22.29 sr = 0.1
      * avg_edge_length
      Mean Curvature0.017 s0.401 s2.66 s22.29 s
      Gaussian Curvature0.018 s0.406 s2.63 s21.61 sGaussian Curvature0.018 s0.406 s2.63 s21.61 s
      Principal Curvature & Directions0.019 s0.430 s2.85 s23.55 sPrincipal Curvature & Directions0.019 s0.430 s2.85 s23.55 s
      All (optimized for shared computations)0.017 s0.428 s2.89 s24.16 sAll (optimized for shared computations)0.017 s0.428 s2.89 s24.16 s
      r = 0.5
      * avg_edge_length
      Mean Curvature0.024 s0.388 s3.18 s22.79 sr = 0.5
      * avg_edge_length
      Mean Curvature0.024 s0.388 s3.18 s22.79 s
      Gaussian Curvature0.024 s0.392 s3.21 s23.58 sGaussian Curvature0.024 s0.392 s3.21 s23.58 s
      Principal Curvature & Directions0.027 s0.428 s3.41 s24.44 sPrincipal Curvature & Directions0.027 s0.428 s3.41 s24.44 s
      All (optimized for shared computations)0.025 s0.417 s3.44 s23.93 sAll (optimized for shared computations)
      - \cgalFigureCaptionBegin{icc_performance_table} Performance of the curvature computation on various meshes (in seconds). The first row shows the performance of the default value for the ball radius, which is using the 1-ring of neighboring faces around each vertex, instead of actually approximating the inclusion ratio of the faces in the ball. From 4f809743f6954068228fa4cadf664f52d493c2cf Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 19:44:37 +0300 Subject: [PATCH 64/95] user man table typo --- .../Polygon_mesh_processing.txt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index b89df53fb69..89684c84ab1 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1085,10 +1085,10 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi Ball
      Radius Computation - Spot
      (6k faces) - Bunny
      (144K faces) - Stanford Dragon
      (871K faces) - Old Age or Winter
      (6M faces) + Spot
      (6k faces) + Bunny
      (144K faces) + Stanford Dragon
      (871K faces) + Old Age or Winter
      (6M faces) vertex
      1-ring faces
      (default) @@ -1172,16 +1172,16 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi All (optimized for shared computations) - - - - + 0.025 s + 0.417 s + 3.44 s + 23.93 s \cgalFigureCaptionBegin{icc_performance_table} -Performance of the curvature computation on various meshes (in seconds). The first row shows the performance of the default value for the ball radius, -which is using the 1-ring of neighboring faces around each vertex, instead of actually approximating the inclusion ratio of the faces in the ball. +Performance of the curvature computation on various meshes (in seconds). The first 4 rows show the performance of the default value for the ball radius, +which is using the 1-ring of neighboring faces around each vertex, instead of actually approximating the inclusion ratio of the faces in a ball of certain radius. The other rows show a ball radius of 0.1 (and 0.5) scaled by the average edge length of the mesh. It is clear that using the 1-ring of faces is much faster, but it might not be as effective when used on a noisy input mesh. \cgalFigureCaptionEnd From a18b2586248f90a24dc724a87fb3f6ba5218db76 Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Sat, 6 Jan 2024 21:00:10 +0300 Subject: [PATCH 65/95] typo --- .../Polygon_mesh_processing.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 89684c84ab1..7fb46b51e05 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -1092,7 +1092,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi vertex
      1-ring faces
      (default) - Mean   Curvature + Mean Curvature < 0.001 s 0.019 s 0.11 s @@ -1106,7 +1106,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi 2.77 s - Principal Curvature & Directions + Principal Curvatures & Directions 0.002 s 0.044 s 0.25 s @@ -1121,7 +1121,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi r = 0.1
      * avg_edge_length - Mean Curvature + Mean Curvature 0.017 s 0.401 s 2.66 s @@ -1135,7 +1135,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi 21.61 s - Principal Curvature & Directions + Principal Curvatures & Directions 0.019 s 0.430 s 2.85 s @@ -1150,7 +1150,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi r = 0.5
      * avg_edge_length - Mean Curvature + Mean Curvature 0.024 s 0.388 s 3.18 s @@ -1164,7 +1164,7 @@ Intel Core i7-8750H CPU @ 2.20GHz, 16GB of RAM, on Windows 11, 64 bits and compi 23.58 s - Principal Curvature & Directions + Principal Curvatures & Directions 0.027 s 0.428 s 3.41 s From 468f4530d08cdb62d1be08b8e95a19e618c18692 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 8 Jan 2024 12:13:22 +0000 Subject: [PATCH 66/95] 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 182b2c779214beffd16391ceaff5573f7cd0e49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 8 Jan 2024 16:53:52 +0100 Subject: [PATCH 67/95] fix warning --- Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 70cda242d01..97b1d8306da 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -284,7 +284,7 @@ Scene_polyhedron_selection_item_priv::triangulate_facet(fg_face_descriptor fit,c //iterates on the internal faces to add the vertices to the positions //and the normals to the appropriate vectors - auto f = [&](auto& ffit, auto& v2v) { + auto f = [&](auto& ffit, auto& /* v2v */) { if (ffit.info().is_external) return; From de17922ca4ee3ad011eb910b9034e74cf7c7c3f7 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Tue, 9 Jan 2024 10:26:19 +0100 Subject: [PATCH 68/95] removed warnings --- Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/triangulate_primitive.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp index 72e1475f82f..3034e7f58a3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Distance_plugin.cpp @@ -204,7 +204,7 @@ private: sampled_points.push_back(r); //triangle facets with sample points for color display - auto func = [&](auto& ffit, auto& v2v) { + auto func = [&](auto& ffit, auto&) { if (ffit.info().is_external) return; diff --git a/Polyhedron/demo/Polyhedron/triangulate_primitive.h b/Polyhedron/demo/Polyhedron/triangulate_primitive.h index 4b0d0f13770..21c6223a9ea 100644 --- a/Polyhedron/demo/Polyhedron/triangulate_primitive.h +++ b/Polyhedron/demo/Polyhedron/triangulate_primitive.h @@ -205,7 +205,7 @@ private: std::vector skip(idPoints.size(), false); for (std::size_t i = 0; i < idPoints.size(); i++) { - int prev = (i - 1 + idPoints.size()) % idPoints.size(); + std::size_t prev = (i - 1 + idPoints.size()) % idPoints.size(); if (idPoints[i].first < idPoints[prev].first) { auto it = edge_map.emplace(std::make_pair(idPoints[i].first, idPoints[prev].first), i); if (!it.second) { From aeda27f4050c544b3107c417d78f0fda2752d607 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 9 Jan 2024 13:58:03 +0100 Subject: [PATCH 69/95] "compilation of demo_framework" should be in the Installation package and Polyhedron --- Installation/cmake/modules/CGAL_add_test.cmake | 4 ++-- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Installation/cmake/modules/CGAL_add_test.cmake b/Installation/cmake/modules/CGAL_add_test.cmake index 904e35e25f1..edc7b43dbee 100644 --- a/Installation/cmake/modules/CGAL_add_test.cmake +++ b/Installation/cmake/modules/CGAL_add_test.cmake @@ -117,7 +117,7 @@ function(cgal_add_compilation_test exe_name) add_test(NAME "check build system" COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$") set_property(TEST "check build system" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation") set_property(TEST "check build system" PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture") endif() @@ -133,7 +133,7 @@ function(cgal_add_compilation_test exe_name) add_test(NAME "compilation of CGAL_Qt6_moc_and_resources" COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt6_moc_and_resources" --config "$") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" PROPERTY FIXTURES_SETUP "CGAL_Qt6_moc_and_resources_Fixture") set_property(TEST "compilation of CGAL_Qt6_moc_and_resources" diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 91f4f086637..73198653607 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -45,11 +45,11 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "demo_framework" --config "$") set_property(TEST "compilation of demo_framework" - APPEND PROPERTY LABELS "CGAL_build_system") + APPEND PROPERTY LABELS "CGAL_build_system" "Installation" "${PROJECT_NAME}") set_property(TEST "compilation of demo_framework" APPEND PROPERTY FIXTURES_SETUP "demo_framework_SetupFixture") set_property(TEST "compilation of demo_framework" - APPEND PROPERTY DEPENDS "compilation_of__CGAL_Qt6_moc_and_resources") + APPEND PROPERTY DEPENDS "check build system" "compilation of CGAL_Qt6_moc_and_resources") endif() endif() else() From a0638f6e0a9c23f209ff9e5210c81ab12670d8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 10 Jan 2024 11:18:50 +0100 Subject: [PATCH 70/95] Use file's completeBaseName for item names --- .../Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp | 4 ++-- .../demo/Polyhedron/Plugins/IO/Nef_io_plugin.cpp | 2 +- .../demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp | 2 +- .../Plugins/IO/OFF_to_nef_io_plugin.cpp | 2 +- .../Plugins/IO/Polylines_io_plugin.cpp | 2 +- .../demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp | 16 ++++++++-------- .../demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp | 2 +- .../Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 6 +++--- .../Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp | 2 +- .../Plugins/Mesh_3/Io_image_plugin.cpp | 8 ++++---- .../Polyhedron/Plugins/PMP/Selection_plugin.cpp | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp index feeef33572e..36233827a32 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp @@ -85,7 +85,7 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce t.stop(); std::cerr << "Reading took " << t.time() << " sec." << std::endl; if(name_and_color.first.size() == 0){ - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); } else { item->setName(name_and_color.first.c_str()); } @@ -121,7 +121,7 @@ save(QFileInfo fileinfo,QList& items) std::ofstream out(fileinfo.filePath().toUtf8()); out.precision (std::numeric_limits::digits10 + 2); SMesh* poly = const_cast(sm_item->polyhedron()); - CGAL::IO::write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly); + CGAL::IO::write_GOCAD(out, qPrintable(fileinfo.completeBaseName()), *poly); items.pop_front(); return true; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Nef_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Nef_io_plugin.cpp index ed9658065f7..25b5c1d7432 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Nef_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Nef_io_plugin.cpp @@ -57,7 +57,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { // Try to read .nef3 in a polyhedron Scene_nef_polyhedron_item* item = new Scene_nef_polyhedron_item(); - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); if(fileinfo.size() == 0) { CGAL::Three::Three::warning( tr("The file you are trying to load is empty.")); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp index e7de52da567..c413104e883 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp @@ -215,7 +215,7 @@ Polyhedron_demo_off_plugin::load_obj(QFileInfo fileinfo) { return nullptr; } Scene_surface_mesh_item* item = new Scene_surface_mesh_item(); - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); if(item->load_obj(in)) return item; //if not polygonmesh load in soup diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_to_nef_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_to_nef_io_plugin.cpp index 0f04fcd2dbf..9e6cfd399ee 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_to_nef_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_to_nef_io_plugin.cpp @@ -50,7 +50,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene){ return QList()<setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(item); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp index 3573ec548f3..75503490a2a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp @@ -201,7 +201,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene){ } Scene_polylines_item* item = new Scene_polylines_item; item->polylines = polylines; - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); item->setColor(Qt::black); item->setProperty("polylines metadata", polylines_metadata); std::cerr << "Number of polylines in item: " << item->polylines.size() << std::endl; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index bf3f4bf54e9..ca824a3e9ee 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -348,7 +348,7 @@ public: || (is_polygon_mesh && is_polyline) || (is_c3t3 && is_polyline) ) { - group = new Scene_group_item(fileinfo.baseName()); + group = new Scene_group_item(fileinfo.completeBaseName()); } if(is_polygon_mesh) @@ -372,12 +372,12 @@ public: if(poly_item) { if(group) { - poly_item->setName(QString("%1_faces").arg(fileinfo.baseName())); + poly_item->setName(QString("%1_faces").arg(fileinfo.completeBaseName())); CGAL::Three::Three::scene()->addItem(poly_item); CGAL::Three::Three::scene()->changeGroup(poly_item, group); } else{ - poly_item->setName(fileinfo.baseName()); + poly_item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(poly_item); @@ -484,12 +484,12 @@ public: c3t3_item->resetCutPlane(); if(group) { - c3t3_item->setName(QString("%1_tetrahedra").arg(fileinfo.baseName())); + c3t3_item->setName(QString("%1_tetrahedra").arg(fileinfo.completeBaseName())); CGAL::Three::Three::scene()->addItem(c3t3_item); CGAL::Three::Three::scene()->changeGroup(c3t3_item, group); } else{ - c3t3_item->setName(fileinfo.baseName()); + c3t3_item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(c3t3_item); @@ -506,12 +506,12 @@ public: polyline_item->polylines.push_back(segment); if(group) { - polyline_item->setName(QString("%1_lines").arg(fileinfo.baseName())); + polyline_item->setName(QString("%1_lines").arg(fileinfo.completeBaseName())); CGAL::Three::Three::scene()->addItem(polyline_item); CGAL::Three::Three::scene()->changeGroup(polyline_item, group); } else{ - polyline_item->setName(fileinfo.baseName()); + polyline_item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(polyline_item); @@ -537,7 +537,7 @@ public: double* p = data->GetPoint(i); point_item->point_set()->insert(Point_3(p[0], p[1], p[2])); } - point_item->setName(fileinfo.baseName()); + point_item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(point_item); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp index 9dbd44d2abe..8810d81942a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp @@ -64,7 +64,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { Scene_polylines_item* item = new Scene_polylines_item; item->polylines = polylines; - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); item->setColor(Qt::black); std::cerr << "Number of polylines in item: " << item->polylines.size() << std::endl; item->invalidateOpenGLBuffers(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 4cadd392fd3..536545443d4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -96,7 +96,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( } if(fileinfo.suffix().toLower() == "cgal") { - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); if(item->load_binary(in)) { if(add_to_scene){ @@ -134,7 +134,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( in.open(fileinfo.filePath().toUtf8(), std::ios_base::in);//not binary CGAL_assertion(!(!in)); - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), @@ -165,7 +165,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( CGAL_assertion(!(!in)); } - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); if (CGAL::IO::read_AVIZO_TETRA(in, item->c3t3().triangulation())) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp index 795f6a247f9..8fbe68dfc4e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_rib_exporter_plugin.cpp @@ -387,7 +387,7 @@ save(const Scene_c3t3_item& c3t3_item, const QFileInfo& fileInfo) rib_file.precision(8); // Header - QString basename = fileInfo.baseName(); + QString basename = fileInfo.completeBaseName(); write_header(qPrintable(basename), rib_file); // Lights diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index fd99361c290..317e15e7dc7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -1356,7 +1356,7 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { //Create planes image_item = new Scene_image_item(image,0, true); - image_item->setName(fileinfo.baseName()); + image_item->setName(fileinfo.completeBaseName()); msgBox.setText("Planes created : 0/3"); msgBox.setStandardButtons(QMessageBox::NoButton); msgBox.show(); @@ -1367,7 +1367,7 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { image_item = new Scene_image_item(image,voxel_scale, false); } - image_item->setName(fileinfo.baseName()); + image_item->setName(fileinfo.completeBaseName()); if(add_to_scene) CGAL::Three::Three::scene()->addItem(image_item); @@ -1456,7 +1456,7 @@ bool Io_image_plugin::loadDirectory(const QString& dirname, { // Create planes image_item = new Scene_image_item(image,125, true); - image_item->setName(fileinfo.baseName()); + image_item->setName(fileinfo.completeBaseName()); msgBox.setText("Planes created : 0/3"); msgBox.setStandardButtons(QMessageBox::NoButton); msgBox.show(); @@ -1470,7 +1470,7 @@ bool Io_image_plugin::loadDirectory(const QString& dirname, int voxel_scale = ui.precisionList->currentIndex() + 1; image_item = new Scene_image_item(image,voxel_scale, false); - image_item->setName(fileinfo.baseName()); + image_item->setName(fileinfo.completeBaseName()); scene->addItem(image_item); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index b1ffae6e97b..2c50e614ac0 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -111,7 +111,7 @@ public: ok = false; return QList(); } - item->setName(fileinfo.baseName()); + item->setName(fileinfo.completeBaseName()); ok = true; if(add_to_scene) CGAL::Three::Three::scene()->addItem(item); From 83fd1fe2b34bcbe6a69437e6d4748412f24889a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 10 Jan 2024 11:19:12 +0100 Subject: [PATCH 71/95] Disable the area smoothing box if Ceres is not available --- Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp index 212f2cc60ef..70747cdddc9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp @@ -107,6 +107,10 @@ public: ui_widget.projection_checkBox->setChecked(true); ui_widget.area_smoothing_checkBox->setChecked(false); +#ifndef CGAL_PMP_USE_CERES_SOLVER + ui_widget.area_smoothing_checkBox->setDisabled(true); +#endif + ui_widget.flip_checkBox->setChecked(true); ui_widget.flip_checkBox->setDisabled(true); } From 53567bd20a3b3f0231f5841861b462b7644cd112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 10 Jan 2024 11:19:43 +0100 Subject: [PATCH 72/95] Handle non triangulated inputs in the repair plugin --- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index b0ac1f85996..6a6d43c08f2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -373,6 +373,11 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_tr qobject_cast(scene->item(index)); if (poly_item) { + if(! CGAL::is_triangle_mesh(*poly_item->polyhedron())) { + CGAL::Three::Three::error(QString("The mesh must have triangle faces")); + return; + } + std::size_t nbv = faces(*poly_item->polyhedron()).size(); CGAL::Polygon_mesh_processing::remove_degenerate_faces( *poly_item->polyhedron()); @@ -399,6 +404,11 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveSelfIntersections_ qobject_cast(scene->item(index)); if (poly_item) { + if(! CGAL::is_triangle_mesh(*poly_item->polyhedron())) { + CGAL::Three::Three::error(QString("The mesh must have triangle faces")); + return; + } + bool solved = CGAL::Polygon_mesh_processing::experimental::remove_self_intersections( *poly_item->polyhedron(), CGAL::parameters::preserve_genus(false)); @@ -424,6 +434,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefine_triggered(Sce qobject_cast(scene->item(index)); if (poly_item) { + CGAL::Polygon_mesh_processing::triangulate_faces(*poly_item->polyhedron()); try{ CGAL::Polygon_mesh_processing::experimental::autorefine(*poly_item->polyhedron()); } @@ -523,6 +534,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefineAndRMSelfInter qobject_cast(scene->item(index)); if (poly_item) { + CGAL::Polygon_mesh_processing::triangulate_faces(*poly_item->polyhedron()); try{ bool solved = CGAL::Polygon_mesh_processing::experimental:: From af3608335b8e1f3f88b3150a0616fdac8ca0ba71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 10 Jan 2024 11:20:29 +0100 Subject: [PATCH 73/95] Misc indentation fixes --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 2 +- .../Plugins/PMP/Repair_polyhedron_plugin.cpp | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 1f92d97129f..f85d0355570 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1102,7 +1102,7 @@ void MainWindow::open(QString filename) if ( dfs_it==default_plugin_selection.end() ) { // collect all io_plugins and offer them to load if the file extension match one name filter - // also collect all available plugin in case of a no extension match + // also collect all available plugins in case of a no extension match for(CGAL::Three::Polyhedron_demo_io_plugin_interface* io_plugin : io_plugins) { if ( file_matches_filter(io_plugin->loadNameFilters(), filename.toLower()) ) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index 6a6d43c08f2..5d87af53f59 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -182,8 +182,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveIsolatedVertices_t if (poly_item) { std::size_t nbv = - CGAL::Polygon_mesh_processing::remove_isolated_vertices( - *poly_item->polyhedron()); + CGAL::Polygon_mesh_processing::remove_isolated_vertices(*poly_item->polyhedron()); CGAL::Three::Three::information(tr(" %1 isolated vertices have been removed.") .arg(nbv)); poly_item->setNbIsolatedvertices(0); @@ -369,8 +368,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() template void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_triggered(Scene_interface::Item_id index) { - Item* poly_item = - qobject_cast(scene->item(index)); + Item* poly_item = qobject_cast(scene->item(index)); if (poly_item) { if(! CGAL::is_triangle_mesh(*poly_item->polyhedron())) { @@ -379,8 +377,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_tr } std::size_t nbv = faces(*poly_item->polyhedron()).size(); - CGAL::Polygon_mesh_processing::remove_degenerate_faces( - *poly_item->polyhedron()); + CGAL::Polygon_mesh_processing::remove_degenerate_faces(*poly_item->polyhedron()); nbv -= faces(*poly_item->polyhedron()).size(); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); @@ -400,8 +397,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveDegenerateFaces_tr template void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveSelfIntersections_triggered(Scene_interface::Item_id index) { - Item* poly_item = - qobject_cast(scene->item(index)); + Item* poly_item = qobject_cast(scene->item(index)); if (poly_item) { if(! CGAL::is_triangle_mesh(*poly_item->polyhedron())) { @@ -430,8 +426,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionRemoveSelfIntersections_ template void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefine_triggered(Scene_interface::Item_id index) { - Item* poly_item = - qobject_cast(scene->item(index)); + Item* poly_item = qobject_cast(scene->item(index)); if (poly_item) { CGAL::Polygon_mesh_processing::triangulate_faces(*poly_item->polyhedron()); @@ -530,8 +525,7 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionNewAutorefine_triggered( template void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefineAndRMSelfIntersections_triggered(Scene_interface::Item_id index) { - Item* poly_item = - qobject_cast(scene->item(index)); + Item* poly_item = qobject_cast(scene->item(index)); if (poly_item) { CGAL::Polygon_mesh_processing::triangulate_faces(*poly_item->polyhedron()); From 1f26c03e3bb23c0906cd9de5273a51310ff5b835 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 10 Jan 2024 16:23:44 +0100 Subject: [PATCH 74/95] plugins should not depend on `Polyhedron_3` --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 3 --- SMDS_3/examples/SMDS_3/c3t3_example.cpp | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 4cadd392fd3..c83911ea93f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -138,7 +138,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), - /*verbose = */false, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) + /*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) { update_c3t3(item->c3t3()); diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 73198653607..c9ffbd9a93e 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,9 +61,6 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) - if(TARGET Polyhedron_3) - add_dependencies( ${plugin_name} Polyhedron_3 ) - endif() if(NOT TARGET CGALlab_all_plugins) add_custom_target(CGALlab_all_plugins) endif() diff --git a/SMDS_3/examples/SMDS_3/c3t3_example.cpp b/SMDS_3/examples/SMDS_3/c3t3_example.cpp index 5ebb5cc3e35..f6d7043c2d0 100644 --- a/SMDS_3/examples/SMDS_3/c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/c3t3_example.cpp @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) Triangulation tr; std::ifstream is(filename, std::ios_base::in); - if(!CGAL::IO::read_MEDIT(is, tr)) + if(!CGAL::IO::read_MEDIT(is, tr, CGAL::parameters::verbose(true))) { std::cerr << "Failed to read" << std::endl; return EXIT_FAILURE; From 37ef2a04f853e1b93857ad746ef5c9970b5bfdad Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 10 Jan 2024 17:08:40 +0000 Subject: [PATCH 75/95] Make the file name unique by baking a pointer in it --- .../CGAL/_test_cls_triangulation_short_2.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h index 132e487bff2..08725583a25 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h @@ -24,7 +24,8 @@ #include #include - +#include +#include #include #include @@ -475,23 +476,31 @@ _test_cls_triangulation_short_2( const Triangul &) /********************/ /******** I/O *******/ + std::string T15fname, T23fname; + std::stringstream ss15; + ss15 << "T15" << &T1_5 << ".triangulation"; + ss15 >> T15fname; + std::stringstream ss23; + ss23 << "T23" << &T2_3 << ".triangulation"; + ss23 >> T23fname; + std::cout << " output to a file" << std::endl; - std::ofstream of1_5("T15short.triangulation"); + std::ofstream of1_5(T15fname.c_str()); CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); - std::ofstream of2_3("T23short.triangulation"); + std::ofstream of2_3(T23fname.c_str()); CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); std::cout << " input from a file" << std::endl; - std::ifstream if1_5("T15short.triangulation"); CGAL::IO::set_ascii_mode(if1_5); + std::ifstream if1_5(T15fname.c_str()); CGAL::IO::set_ascii_mode(if1_5); Triangul T1_5_copy; if1_5 >> T1_5_copy; assert( T1_5_copy.is_valid() && T1_5_copy.number_of_vertices() == T1_5.number_of_vertices() ); - std::ifstream if2_3("T23short.triangulation"); CGAL::IO::set_ascii_mode(if2_3); + std::ifstream if2_3(T23fname.c_str()); CGAL::IO::set_ascii_mode(if2_3); Triangul T2_3_copy; if2_3 >> T2_3_copy; assert( T2_3_copy.is_valid() && T2_3_copy.number_of_vertices() == T2_3.number_of_vertices() ); From d4a36120d83cb0de06483d30ff21e26448ad2124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 11 Jan 2024 09:31:15 +0100 Subject: [PATCH 76/95] make sure we can read the file --- .../Polygon_mesh_processing/soup_autorefinement.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/soup_autorefinement.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/soup_autorefinement.cpp index a76e1254f6e..b1b58ae10e3 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/soup_autorefinement.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/soup_autorefinement.cpp @@ -22,7 +22,11 @@ int main(int argc, char** argv) std::vector input_points; std::vector> input_triangles; - CGAL::IO::read_polygon_soup(filename, input_points, input_triangles); + if (!CGAL::IO::read_polygon_soup(filename, input_points, input_triangles)) + { + std::cerr << "Cannot read " << filename << "\n"; + return 1; + } PMP::repair_polygon_soup(input_points, input_triangles); PMP::triangulate_polygons(input_points, input_triangles); From f3e547f73838da56f1044fa2d08107561b97454e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Jan 2024 09:45:05 +0000 Subject: [PATCH 77/95] Parabola_segment_2: turn it into a struct --- Apollonius_graph_2/include/CGAL/Parabola_segment_2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h index 7c03ff5d5e5..20883169ba7 100644 --- a/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h +++ b/Apollonius_graph_2/include/CGAL/Parabola_segment_2.h @@ -27,7 +27,7 @@ namespace Qt { } template < class Gt > -class Parabola_segment_2 : public Parabola_2< Gt > +struct Parabola_segment_2 : public Parabola_2< Gt > { typedef CGAL::Parabola_2 Base; typedef typename Base::Site_2 Site_2; @@ -39,10 +39,10 @@ class Parabola_segment_2 : public Parabola_2< Gt > using Base::t; using Base::f; -protected: + Point_2 p1, p2; -public: + Parabola_segment_2() : Parabola_2< Gt >() {} template From 3f3691a48e4fece4f072cf8488e4772f2f99d810 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Jan 2024 08:43:05 +0000 Subject: [PATCH 78/95] Add testcase that shows the problem --- .../Segment_Delaunay_graph_2/issue7972.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp new file mode 100644 index 00000000000..6dd4a4e5e2b --- /dev/null +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp @@ -0,0 +1,21 @@ + +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel K; +typedef CGAL::Segment_Delaunay_graph_traits_2 Gt; +typedef CGAL::Segment_Delaunay_graph_2 SDG2; + +int main() { + auto segments = std::vector({ + CGAL::Segment_2( + CGAL::Point_2(0.0, 0.0), + CGAL::Point_2(1.0, 0.0)) + }); + + SDG2 delaunay; + delaunay.insert_segments(segments.begin(), segments.end()); + + return 0; +} From 23e56a8e3e2df7b1c5e9cd659f1b10c35e41940d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Jan 2024 08:43:48 +0000 Subject: [PATCH 79/95] In case of Epeck the source of a segment is not a reference --- .../include/CGAL/Segment_Delaunay_graph_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h index 1c684d32202..05a199a5bff 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h @@ -632,11 +632,11 @@ public: } template - static const Point_2& get_source(const Segment_2& segment){ + static Point_2 get_source(const Segment_2& segment){ return segment.source(); } template - static const Point_2& get_target(const Segment_2& segment){ + static Point_2 get_target(const Segment_2& segment){ return segment.target(); } From 074a337e884aa5b683a5da16b4ef2438c5abd280 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jan 2024 11:35:05 +0100 Subject: [PATCH 80/95] Mesh_3/SMDS_3: Fix reading of .mesh files With a `.mesh` containing `Triangles` in a comment, like that one: ``` MeshVersionFormatted 1 Dimension 3 Vertices 121 -10.0402 -10.0402 -10.0402 0 -10 10 10 0 10 10 10 0 [...] Triangles 609 98 76 65 0 98 81 76 0 65 81 98 0 Tetrahedra 244 81 65 76 98 0 28 1 37 34 0 69 25 70 94 0 [...] End ``` then the code failed. It read `Triangles` as the beginning of the triangles section. The commit use `std::getline()` to read the comments and the keywords: - `Vertices` - `Triangles` - `Tetrahedra` --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index a71e38f8c43..d4dbf04e3f3 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -596,24 +596,17 @@ bool build_triangulation_from_file(std::istream& is, bool is_CGAL_mesh = false; - while(is >> word && word != "End") + std::string line; + while(std::getline(is, line) && line != "End") { - if (word.at(0) == '#') + if (line.size() > 0 && line.at(0) == '#' && + line.find("CGAL::Mesh_complex_3_in_triangulation_3") != std::string::npos) { - is >> word; - if (word == "End") - { - break; - } - else if (word == "CGAL::Mesh_complex_3_in_triangulation_3") - { - is_CGAL_mesh = true; // with CGAL meshes, domain 0 should be kept - continue; - } - //else skip other comments + is_CGAL_mesh = true; // with CGAL meshes, domain 0 should be kept + continue; } - if(word == "Vertices") + if(line == "Vertices") { is >> nv; for(int i=0; i> nf; for(int i=0; i> ntet; for(int i=0; i Date: Thu, 11 Jan 2024 12:40:39 +0100 Subject: [PATCH 81/95] Add an advanced example to draw cropped duals of Segment Delaunay Graphs --- .../Segment_Delaunay_graph_2/CMakeLists.txt | 24 +- .../sdg-advanced-draw.cpp | 512 ++++++++++++++++++ 2 files changed, 527 insertions(+), 9 deletions(-) create mode 100644 Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-advanced-draw.cpp diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt index 88944af9274..7d280fb1feb 100644 --- a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt @@ -4,13 +4,19 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Segment_Delaunay_graph_2_Examples) -find_package(CGAL REQUIRED) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) -# 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("sdg-count-sites.cpp") +create_single_source_cgal_program("sdg-fast-sp.cpp") +create_single_source_cgal_program("sdg-fast-sp-polygon.cpp") +create_single_source_cgal_program("sdg-filtered-traits.cpp") +create_single_source_cgal_program("sdg-info-set.cpp") +create_single_source_cgal_program("sdg-red-blue-info.cpp") +create_single_source_cgal_program("sdg-voronoi-edges.cpp") + +find_package(LEDA QUIET) +if(CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("sdg-advanced-draw.cpp") +else() + message("NOTICE: The program sdg-advanced-draw requires CGAL_Core or LEDA, and will not be compiled.") +endif() diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-advanced-draw.cpp b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-advanced-draw.cpp new file mode 100644 index 00000000000..95b6b16c84a --- /dev/null +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/sdg-advanced-draw.cpp @@ -0,0 +1,512 @@ +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#define SDG_DRAW_DEBUG // debug log +#define SDG_DRAW_DUMP_FILES // print input / ouput +// #define SINGLE_INPUT_FILE // if not defined, each segment of the input has its own file + +#ifdef SDG_DRAW_DUMP_FILES_PP // also print parabolas +#define SDG_DRAW_DUMP_FILES +#endif + +typedef CGAL::Simple_cartesian CK; +typedef CK::Point_2 Point_2; +typedef CK::Segment_2 Segment_2; +typedef CGAL::Field_with_sqrt_tag CM; +typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EK; +typedef CGAL::Field_with_sqrt_tag EM; +typedef CGAL::Simple_cartesian > FK; +typedef CGAL::Field_with_sqrt_tag FM; +typedef CGAL::Segment_Delaunay_graph_filtered_traits_2 Gt; +typedef CGAL::Segment_Delaunay_graph_2 SDG; + +///////////////////////////////// CODE ABOUT EXACT DUALS /////////////////////////////////////////// + +template < typename ExactSite, typename ExactKernel, + typename SDGSite, typename InputKernel > +ExactSite convert_site_to_exact(const SDGSite &site, + const InputKernel & /*k*/, + const ExactKernel & /*ek*/) +{ + using To_exact = CGAL::Cartesian_converter; + To_exact to_exact; + + // Note: in theory, a site can be constructed from more than just one or two points + // (e.g. 4 points for the segment defined by the intersection of two segments). Thus, it + // would be better to convert the input points at the very beginning and just maintain + // a type of map between the base and exact sites. + ExactSite es; + if(site.is_point()) + es = ExactSite::construct_site_2(to_exact(site.point())); + else + es = ExactSite::construct_site_2(to_exact(site.segment().source()), to_exact(site.segment().target())); + + return es; +} + +// Dual (Voronoi site) of an SDG face +template < typename FiniteFacesIterator, typename InputKernel, typename ExactKernel > +typename ExactKernel::Point_2 exact_primal(const FiniteFacesIterator sdg_f, + const InputKernel& k, + const ExactKernel& ek) +{ + using Exact_SDG_traits = CGAL::Segment_Delaunay_graph_traits_2; + using Exact_site_2 = typename Exact_SDG_traits::Site_2; + + static Exact_SDG_traits e_sdg_gt; + const Exact_site_2 es0 = convert_site_to_exact(sdg_f->vertex(0)->site(), k, ek); + const Exact_site_2 es1 = convert_site_to_exact(sdg_f->vertex(1)->site(), k, ek); + const Exact_site_2 es2 = convert_site_to_exact(sdg_f->vertex(2)->site(), k, ek); + + return e_sdg_gt.construct_svd_vertex_2_object()(es0, es1, es2); +} + +// Dual (Voronoi edge) of an SDG edge +// this function is identical 'SDG::primal()', but with a conversion to exact sites +template < typename Edge, typename InputKernel, typename ExactKernel > +CGAL::Object exact_primal(const Edge& e, + const SDG& sdg, + const InputKernel& k, + const ExactKernel& ek) +{ + using Exact_SDG_traits = CGAL::Segment_Delaunay_graph_traits_2; + using Exact_site_2 = typename Exact_SDG_traits::Site_2; + + using DT = CGAL::Field_with_sqrt_tag; + using Construct_sdg_bisector_2 = CGAL::SegmentDelaunayGraph_2::Construct_sdg_bisector_2; + using Construct_sdg_bisector_ray_2 = CGAL::SegmentDelaunayGraph_2::Construct_sdg_bisector_ray_2; + using Construct_sdg_bisector_segment_2 = CGAL::SegmentDelaunayGraph_2::Construct_sdg_bisector_segment_2; + + CGAL_precondition(!sdg.is_infinite(e)); + + if(sdg.dimension() == 1) + { + Exact_site_2 p = convert_site_to_exact((e.first)->vertex(sdg.cw(e.second))->site(), k, ek); + Exact_site_2 q = convert_site_to_exact((e.first)->vertex(sdg.ccw(e.second))->site(), k, ek); + + return make_object(Construct_sdg_bisector_2()(p, q)); + } + + // dimension == 2 + // neither of the two adjacent faces is infinite + if((!sdg.is_infinite(e.first)) && (!sdg.is_infinite(e.first->neighbor(e.second)))) + { + Exact_site_2 p = convert_site_to_exact((e.first)->vertex(sdg.ccw(e.second))->site(), k, ek); + Exact_site_2 q = convert_site_to_exact((e.first)->vertex(sdg.cw(e.second))->site(), k, ek); + Exact_site_2 r = convert_site_to_exact((e.first)->vertex(e.second)->site(), k, ek); + Exact_site_2 s = convert_site_to_exact(sdg.tds().mirror_vertex(e.first, e.second)->site(), k, ek); + + return Construct_sdg_bisector_segment_2()(p, q, r, s); + } + + // both of the adjacent faces are infinite + if(sdg.is_infinite(e.first) && sdg.is_infinite(e.first->neighbor(e.second))) + { + Exact_site_2 p = convert_site_to_exact((e.first)->vertex(sdg.cw(e.second))->site(), k, ek); + Exact_site_2 q = convert_site_to_exact((e.first)->vertex(sdg.ccw(e.second))->site(), k, ek); + + return make_object(Construct_sdg_bisector_2()(p, q)); + } + + // only one of the adjacent faces is infinite + CGAL_assertion(sdg.is_infinite(e.first) || sdg.is_infinite(e.first->neighbor(e.second))); + CGAL_assertion(!(sdg.is_infinite(e.first) && sdg.is_infinite(e.first->neighbor(e.second)))); + CGAL_assertion(sdg.is_infinite(e.first->vertex(e.second)) || sdg.is_infinite(sdg.tds().mirror_vertex(e.first, e.second))); + + Edge ee = e; + if(sdg.is_infinite(e.first->vertex(e.second))) + { + ee = Edge(e.first->neighbor(e.second), + e.first->neighbor(e.second)->index(sdg.tds().mirror_vertex(e.first, e.second))); + } + + Exact_site_2 p = convert_site_to_exact(ee.first->vertex(sdg.ccw(ee.second))->site(), k, ek); + Exact_site_2 q = convert_site_to_exact(ee.first->vertex(sdg.cw(ee.second))->site(), k, ek); + Exact_site_2 r = convert_site_to_exact(ee.first->vertex(ee.second)->site(), k, ek); + + return make_object(Construct_sdg_bisector_ray_2()(p, q, r)); +} + +///////////////////////////////// CODE TO DRAW A CROPPED DIAGRAM /////////////////////////////////// + +// Split a Voronoi edge that is a parabola (one site is a point, one site is a segment) into small segments +template +void segment_parabola(const CGAL::Parabola_segment_2& p, + const CGAL::Bbox_2& scaled_bbox, + SegmentContainer& segment_list) +{ + using FT = typename OutputKernel::FT; + using Point_2 = typename OutputKernel::Point_2; + + const Point_2& o = p.origin(); + const Point_2& c = p.center(); + + // @todo could be cached + const Point_2 mm(scaled_bbox.xmin(), scaled_bbox.ymin()); + const Point_2 mM(scaled_bbox.xmin(), scaled_bbox.ymax()); + const Point_2 Mm(scaled_bbox.xmax(), scaled_bbox.ymin()); + const Point_2 MM(scaled_bbox.xmax(), scaled_bbox.ymax()); + + FT s = CGAL::squared_distance(mm, c); + s = (std::max)(s, CGAL::squared_distance(mM, c)); + s = (std::max)(s, CGAL::squared_distance(Mm, c)); + s = (std::max)(s, CGAL::squared_distance(MM, c)); + + s = CGAL::sqrt(s) - CGAL::sqrt(CGAL::squared_distance(c, o)); + + const double lx = scaled_bbox.xmax() - scaled_bbox.xmin(); + const double ly = scaled_bbox.ymax() - scaled_bbox.ymin(); + + const double max_length = 0.001 * (std::min)(lx, ly); // max length in the discretization of a parabola + +#ifdef SDG_DRAW_DEBUG + std::cout << "origin & center: " << o << " [[]] " << c << std::endl; + std::cout << "max length " << max_length << std::endl; +#endif + + std::vector points; + p.generate_points(points, max_length, -s, s); + +#ifdef SDG_DRAW_DEBUG + std::cout << "Discretize parabola into " << points.size() << " points" << std::endl; + for(const auto& pt : points) + std::cout << CGAL::to_double(pt.x()) << " " << CGAL::to_double(pt.y()) << " 0" << std::endl; + std::cout << "end of parabola" << std::endl; +#endif + + if(points.size() < 2) + return; + + for(std::size_t i=0, ps=points.size()-1; i +void fill_Voronoi_structure(const SDG& sdg, + const CGAL::Bbox_2& scaled_bbox, + LineContainer& line_list, + RayContainer& ray_list, + SegmentContainer& segment_list) +{ + using Line_2 = typename OutputKernel::Line_2; + using Ray_2 = typename OutputKernel::Ray_2; + using Segment_2 = typename OutputKernel::Segment_2; + using SDG_traits = CGAL::Segment_Delaunay_graph_traits_2; + + CK k; + OutputKernel ek; + + Line_2 l; + Ray_2 r; + Segment_2 s; + CGAL::Parabola_segment_2 p; + + int nl = 0, ns = 0, nr = 0, np = 0; + + typename SDG::Finite_edges_iterator eit = sdg.finite_edges_begin(), + eend = sdg.finite_edges_end(); + for (; eit != eend; ++eit) + { + CGAL::Object o = exact_primal(*eit, sdg, k, ek); + + if(CGAL::assign(l, o)) { line_list.push_back(l); ++nl; } + if(CGAL::assign(s, o)) { segment_list.push_back(s); ++ns; } + if(CGAL::assign(r, o)) { ray_list.push_back(r); ++nr; } + if(CGAL::assign(p, o)) { segment_parabola(p, scaled_bbox, segment_list); ++np; } + } + +#ifdef SDG_DRAW_DEBUG + std::cout << nl << " lines" << std::endl; + std::cout << ns << " segments" << std::endl; + std::cout << nr << " rays" << std::endl; + std::cout << np << " parabolas" << std::endl; +#endif +} + +template +struct Box_clipper +{ + bool operator()(const T& obj, + const typename OutputKernel::Iso_rectangle_2& bbox, + OutputIterator oit) const + { + CGAL::Object obj_cgal = CGAL::intersection(obj, bbox); + + typename OutputKernel::Segment_2 s; + bool ret = CGAL::assign(s, obj_cgal); + if(ret) + oit++ = s; + + return ret; + } +}; + +template +struct Box_clipper +{ + bool operator()(const typename OutputKernel::Segment_2& is, + const typename OutputKernel::Iso_rectangle_2& bbox, + OutputIterator oit) const + { + if(bbox.has_on_unbounded_side(is.source()) && bbox.has_on_unbounded_side(is.target())) + return false; + + if(!bbox.has_on_unbounded_side(is.source()) && !bbox.has_on_unbounded_side(is.target())) + { + oit++ = is; + return true; + } + + CGAL::Object obj_cgal = CGAL::intersection(is, bbox); + + typename OutputKernel::Segment_2 s; + bool ret = CGAL::assign(s, obj_cgal); + if(ret) + oit++ = s; + + return ret; + } +}; + +template +void draw_dual(const LineContainer& lines, + const RayContainer& rays, + const SegmentContainer& segments, + const typename OutputKernel::Iso_rectangle_2& bbox, + OutputIterator oit) +{ + using Line_2 = typename OutputKernel::Line_2; + using Ray_2 = typename OutputKernel::Ray_2; + using Segment_2 = typename OutputKernel::Segment_2; + + typedef Box_clipper Line_clipper; + typedef Box_clipper Ray_clipper; + typedef Box_clipper Segment_clipper; + + Line_clipper lc; + Ray_clipper rc; + Segment_clipper sc; + + for(const Line_2& line : lines) + lc(line, bbox, oit); + for(const Ray_2& ray : rays) + rc(ray, bbox, oit); + for(const Segment_2& segment : segments) + sc(segment, bbox, oit); +} + +template< typename OutputKernel, typename OutputIterator > +OutputIterator draw_SDG(const SDG& sdg, + const typename OutputKernel::Iso_rectangle_2& bbox, + const CGAL::Bbox_2& scaled_bbox, + OutputIterator oit) +{ + using Line_2 = typename OutputKernel::Line_2; + using Ray_2 = typename OutputKernel::Ray_2; + using Segment_2 = typename OutputKernel::Segment_2; + + std::list line_list; + std::list ray_list; + std::list segment_list; + + fill_Voronoi_structure(sdg, scaled_bbox, line_list, ray_list, segment_list); + draw_dual(line_list, ray_list, segment_list, bbox, oit); + + return oit; +} + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cout << std::fixed; + + if(argc < 2) + std::cout << "Usage: " << argv[0] << " input.cin" << std::endl; + +#ifdef SDG_DRAW_DUMP_FILES + // dump the input + std::ifstream input((argc > 1) ? argv[1] : "./data/sites.cin"); + assert(input); + + std::string str; + int i = 0; + +# ifdef SINGLE_INPUT_FILE + std::ofstream in_out("input.cgal"); + in_out.precision(17); +# endif + + // read line by line, and distinguish between point and segment + std::string line; + while(std::getline(input, line)) + { +# ifndef SINGLE_INPUT_FILE + std::stringstream oss; + oss << "input_" << i++ << ".cgal" << std::ends; + std::ofstream in_out(oss.str().c_str()); + in_out.precision(17); +# endif + + std::stringstream ss(line); + ss >> str; + if(str == "s") + { + double x0, y0, x1, y1; + ss >> x0 >> y0 >> x1 >> y1; + + in_out << "2 " << x0 << " " << y0 << " 0 "; + in_out << x1 << " " << y1 << " 0\n"; + } + else if(str == "p") + { + double x, y; + ss >> x >> y; + + in_out << "2 " << x << " " << y << " 0\n"; + in_out << x << " " << y << " 0\n"; // abusive 0-length polyline + } + else + { + std::cerr << "Error: Unknown input: " << str << std::endl; + return EXIT_FAILURE; + } + +# ifndef SINGLE_INPUT_FILE + in_out.close(); +# endif + } +# ifdef SINGLE_INPUT_FILE + in_out.close(); +# endif +#endif + + std::ifstream ifs((argc > 1) ? argv[1] : "./data/sites.cin"); + assert(ifs); + + // polygon points + std::set all_points; + + // segments of the polygon as a pair of point indices + std::vector points; + std::vector segments; + SDG::Site_2 site; + + // read segment input, format: + // s [x0 y0 x1 y1] + // p [x y] + + while (ifs >> site) + { + if(site.is_segment()) + { + all_points.insert(site.source_of_supporting_site()); + all_points.insert(site.target_of_supporting_site()); + segments.push_back(site.segment()); + } + else + { + all_points.insert(site.point()); + points.push_back(site.point()); + } + } + + if(points.empty() && segments.empty()) + { + std::cerr << "Nothing in input..." << std::endl; + return EXIT_SUCCESS; + } + + // insert the sites all at once using spatial sorting to speed the insertion + SDG sdg; + sdg.insert_points(points.begin(), points.end()); + sdg.insert_segments(segments.begin(), segments.end()); + assert(sdg.is_valid(true, 1)); // validate the segment Delaunay graph + + typedef EK OK; // output kernel + std::list svd_edges; + + // Get the bbox of the input points, and grow it a bit + const CGAL::Bbox_2 bbox = bbox_2(all_points.begin(), all_points.end()); + const double xmin = bbox.xmin(), xmax = bbox.xmax(); + const double ymin = bbox.ymin(), ymax = bbox.ymax(); + const double xmid = 0.5 * (xmin + xmax), ymid = 0.5 * (ymin + ymax); + const double scaling_factor = 3.; // '0.5' gives the identity + const double lx = scaling_factor * (xmax - xmin), + ly = scaling_factor * (ymax - ymin); + const CGAL::Bbox_2 scaled_bbox(xmid - lx, ymid - ly, xmid + lx, ymid + ly); + const OK::Iso_rectangle_2 bounding_iso_rec(scaled_bbox); + +#ifdef SDG_DRAW_DEBUG + std::cout << "bbox: " << bbox.xmin() << " " << bbox.ymin() << std::endl; + std::cout << "bbox: " << bbox.xmax() << " " << bbox.ymax() << std::endl; + std::cout << "lx/y: " << lx << " " << ly << std::endl; + std::cout << "Scaled bbox: " << scaled_bbox.xmin() << " " << scaled_bbox.ymin() << std::endl; + std::cout << "Scaled bbox: " << scaled_bbox.xmax() << " " << scaled_bbox.ymax() << std::endl; +#endif + + draw_SDG(sdg, bounding_iso_rec, scaled_bbox, std::back_inserter(svd_edges)); + +#ifdef SDG_DRAW_DEBUG + std::cout << "Edges of the diagram (exact form):" << std::endl; + for(const OK::Segment_2& edge : svd_edges) + std::cout << edge << "\n"; + + std::cout << "Now in the double, approximate format..." << std::endl; + for(const OK::Segment_2& edge : svd_edges) + { + std::cout << CGAL::to_double(edge.source().x()) << " "; + std::cout << CGAL::to_double(edge.source().y()) << " "; + std::cout << CGAL::to_double(edge.target().x()) << " "; + std::cout << CGAL::to_double(edge.target().y()) << "\n"; + } +#endif + +#ifdef SDG_DRAW_DUMP_FILES + // This file can be visualized with the CGAL 3D Polyhedron Demo + std::ofstream out("dual.cgal"); + out.precision(17); + for(const OK::Segment_2& edge : svd_edges) + { + out << "2 " << CGAL::to_double(edge.source().x()) << " "; + out << CGAL::to_double(edge.source().y()) << " 0 "; + out << CGAL::to_double(edge.target().x()) << " "; + out << CGAL::to_double(edge.target().y()) << " 0\n"; + } +#endif + + std::cout << "Done" << std::endl; + + return EXIT_SUCCESS; +} From 2ccb65f6eab056004daaae93b09633f7e730a183 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jan 2024 15:17:26 +0100 Subject: [PATCH 82/95] Revert "plugins should not depend on `Polyhedron_3`" This reverts commit 1f26c03e3bb23c0906cd9de5273a51310ff5b835. --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 3 +++ SMDS_3/examples/SMDS_3/c3t3_example.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index c83911ea93f..4cadd392fd3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -138,7 +138,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->set_valid(false); if(CGAL::SMDS_3::build_triangulation_from_file(in, item->c3t3().triangulation(), - /*verbose = */true, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) + /*verbose = */false, /*replace_subdomain_0 = */false, /*allow_non_manifold = */true)) { update_c3t3(item->c3t3()); diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index c9ffbd9a93e..73198653607 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,6 +61,9 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) + if(TARGET Polyhedron_3) + add_dependencies( ${plugin_name} Polyhedron_3 ) + endif() if(NOT TARGET CGALlab_all_plugins) add_custom_target(CGALlab_all_plugins) endif() diff --git a/SMDS_3/examples/SMDS_3/c3t3_example.cpp b/SMDS_3/examples/SMDS_3/c3t3_example.cpp index f6d7043c2d0..5ebb5cc3e35 100644 --- a/SMDS_3/examples/SMDS_3/c3t3_example.cpp +++ b/SMDS_3/examples/SMDS_3/c3t3_example.cpp @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) Triangulation tr; std::ifstream is(filename, std::ios_base::in); - if(!CGAL::IO::read_MEDIT(is, tr, CGAL::parameters::verbose(true))) + if(!CGAL::IO::read_MEDIT(is, tr)) { std::cerr << "Failed to read" << std::endl; return EXIT_FAILURE; From 1491b754f7c894f0bddc996df8ace27078748832 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Jan 2024 15:28:40 +0100 Subject: [PATCH 83/95] If CGAL_TEST_SUITE, then plugins do not depend on Polyhedron_3 --- Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake index 73198653607..d31b0aa911d 100644 --- a/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake +++ b/Polyhedron/demo/Polyhedron/polyhedron_demo_macros.cmake @@ -61,7 +61,7 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) endif() # Link with CGAL target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL ) - if(TARGET Polyhedron_3) + if(NOT CGAL_TEST_SUITE AND TARGET Polyhedron_3) add_dependencies( ${plugin_name} Polyhedron_3 ) endif() if(NOT TARGET CGALlab_all_plugins) From 961f00d52b0d65e14d9a220d1ee397047a994525 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 12 Jan 2024 07:04:01 +0000 Subject: [PATCH 84/95] Kernel_d: Use integral_division() --- .../CGAL/Kernel_d/Linear_algebraHd_impl.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h index df22d36cf9a..9398b3964e9 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h +++ b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h @@ -95,13 +95,13 @@ linear_solver(const Matrix& A, const Vector& b, for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division((L(i,j)*C(k,k) - C(i,k)*L(k,j)), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division((C(i,j)*C(k,k) - temp*C(k,j)), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -140,7 +140,7 @@ linear_solver(const Matrix& A, const Vector& b, for (j = i + 1; j < rank; j++) { h -= C(i,j)*x[var[j]]; } - x[var[i]]= h / C(i,i); + x[var[i]]= integral_division(h, C(i,i)); } #ifdef CGAL_LA_SELFTEST CGAL_assertion( (M*x).is_zero() ); @@ -156,7 +156,7 @@ linear_solver(const Matrix& A, const Vector& b, RT_ h = - C(i,rank + l)*D; for ( j= i + 1; j Date: Fri, 12 Jan 2024 08:03:00 +0000 Subject: [PATCH 85/95] more integral_division() --- .../CGAL/Kernel_d/Linear_algebraHd_impl.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h index 9398b3964e9..286211363bb 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h +++ b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraHd_impl.h @@ -241,13 +241,13 @@ determinant(const Matrix& A) for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division(L(i,j)*C(k,k) - C(i,k)*L(k,j), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division(C(i,j)*C(k,k) - temp*C(k,j), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -355,13 +355,13 @@ determinant(const Matrix& A, for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division(L(i,j)*C(k,k) - C(i,k)*L(k,j), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division(C(i,j)*C(k,k) - temp*C(k,j), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -551,13 +551,13 @@ independent_columns(const Matrix& A, for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division(L(i,j)*C(k,k) - C(i,k)*L(k,j), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division(C(i,j)*C(k,k) - temp*C(k,j), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -666,13 +666,13 @@ rank(const Matrix& A) for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division(L(i,j)*C(k,k) - C(i,k)*L(k,j), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division(C(i,j)*C(k,k) - temp*C(k,j), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -774,13 +774,13 @@ inverse(const Matrix& A, Matrix& inverse, for(i = k + 1; i < rows; i++) for (j = 0; j < rows; j++) //and all columns of |L| - L(i,j) = (L(i,j)*C(k,k) - C(i,k)*L(k,j))/denom; + L(i,j) = integral_division(L(i,j)*C(k,k) - C(i,k)*L(k,j), denom); for(i = k + 1; i < rows; i++) { /* the following iteration uses and changes |C(i,k)| */ RT temp = C(i,k); for (j = k; j <= cols; j++) - C(i,j) = (C(i,j)*C(k,k) - temp*C(k,j))/denom; + C(i,j) = integral_division(C(i,j)*C(k,k) - temp*C(k,j), denom); } denom = C(k,k); #ifdef CGAL_LA_SELFTEST @@ -822,7 +822,7 @@ inverse(const Matrix& A, Matrix& inverse, h = L (j,i) * D; for (int l = j + 1; l Date: Fri, 12 Jan 2024 08:04:00 +0000 Subject: [PATCH 86/95] Use Exact_integer; Do not divide a Vector in case of Homogeneous --- .../test/Kernel_d/Linear_algebra-test.cpp | 16 ------------ Kernel_d/test/Kernel_d/interface-test.cpp | 22 +++++----------- Kernel_d/test/Kernel_d/intersection-test.cpp | 26 +++---------------- 3 files changed, 10 insertions(+), 54 deletions(-) diff --git a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp index cc12532746e..d117d61a733 100644 --- a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp +++ b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp @@ -10,23 +10,9 @@ #include #include -#if defined( CGAL_USE_LEDA) || defined ( CGAL_USE_GMP ) - typedef CGAL::Exact_integer RT; typedef CGAL::Exact_rational FT; -#else - -// The following are too slow : -// #include -// #include -// typedef CGAL::MP_Float RT; -// typedef CGAL::Quotient FT; -typedef double RT; -typedef double FT; - -#endif - int main(int argc, char* argv[]) { CGAL_KD_SETDTHREAD(151); @@ -72,8 +58,6 @@ int main(int argc, char* argv[]) Vector v21(v13),v22(v13); v21 *= 13; CGAL_TEST(v21 == NT(13)*v22){} - v21 /= 13; - CGAL_TEST(v21 == v22){} if (IOTEST) CGAL_IO_TEST(v1,v2,CGAL::IO::ASCII); } diff --git a/Kernel_d/test/Kernel_d/interface-test.cpp b/Kernel_d/test/Kernel_d/interface-test.cpp index 1429ac6ac76..c6ab8053689 100644 --- a/Kernel_d/test/Kernel_d/interface-test.cpp +++ b/Kernel_d/test/Kernel_d/interface-test.cpp @@ -5,22 +5,12 @@ #include #include -#ifdef CGAL_USE_LEDA -#include -#include -typedef leda_integer RT_; -typedef leda_rational FT_; -#else -#ifdef CGAL_USE_GMP -#include -#include -typedef CGAL::Gmpz RT_; -typedef CGAL::Quotient FT_; -#else -typedef double RT_; -typedef double FT_; -#endif -#endif +#include +#include + +typedef CGAL::Exact_integer RT_; +typedef CGAL::Exact_rational FT_; + int main() { CGAL_KD_SETDTHREAD(2); diff --git a/Kernel_d/test/Kernel_d/intersection-test.cpp b/Kernel_d/test/Kernel_d/intersection-test.cpp index 3f22d193653..1808c3daf95 100644 --- a/Kernel_d/test/Kernel_d/intersection-test.cpp +++ b/Kernel_d/test/Kernel_d/intersection-test.cpp @@ -5,28 +5,11 @@ #include #include -#ifdef CGAL_USE_LEDA +#include +#include -#include -#include -typedef leda_integer RT; -typedef leda_real FT; - -#elif defined CGAL_USE_GMP - -#include -#include -typedef CGAL::Gmpz RT; -typedef CGAL::Gmpq FT; - -#else - -#include -#include -typedef CGAL::MP_Float RT; -typedef CGAL::Quotient FT; - -#endif +typedef CGAL::Exact_integer RT; +typedef CGAL::Exact_rational FT; int main() { CGAL::IO::set_pretty_mode ( std::cerr ); @@ -383,4 +366,3 @@ int main() } CGAL_TEST_END; } - From a484bfa35a3c5f9b82a0de8a852a66acaa32ec72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 12 Jan 2024 09:12:09 +0100 Subject: [PATCH 87/95] add missing include directives --- Number_types/test/Number_types/to_interval_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Number_types/test/Number_types/to_interval_test.cpp b/Number_types/test/Number_types/to_interval_test.cpp index 59752059bf6..69ae3969e5b 100644 --- a/Number_types/test/Number_types/to_interval_test.cpp +++ b/Number_types/test/Number_types/to_interval_test.cpp @@ -3,6 +3,9 @@ #include // That one should not be needed in the long term: +#include +#include +#include #include #ifdef CGAL_USE_LEDA From c539c5657c9ad9bae32a1b0e9ab3a65a27f51a79 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 17 Jan 2024 09:56:39 +0100 Subject: [PATCH 88/95] fix when reading on Linux a .mesh file produced by Windows --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index d4dbf04e3f3..f20a4aafcfb 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -599,6 +599,11 @@ bool build_triangulation_from_file(std::istream& is, std::string line; while(std::getline(is, line) && line != "End") { + // remove trailing whitespace, in particular a possible '\r' from Windows + // end-of-line encoding + if(std::isspace(line.back())) { + line.pop_back(); + } if (line.size() > 0 && line.at(0) == '#' && line.find("CGAL::Mesh_complex_3_in_triangulation_3") != std::string::npos) { From 806d1247e647fa0a5953411013224750f56f30c4 Mon Sep 17 00:00:00 2001 From: hoskillua <47090776+hoskillua@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:47:39 +0300 Subject: [PATCH 89/95] display plugin ball radius slider update --- .../Polyhedron/Plugins/Display/Display_property_plugin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index cbff878abb7..68826d91862 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -90,6 +90,7 @@ private: double bI = 0.; double expand_radius = 0.; + double expand_radius_updated = false; double maxEdgeLength = -1.; Color_ramp color_ramp; @@ -912,6 +913,8 @@ private Q_SLOTS: expand_radius = (pow(base, val) - 1) * outMax / (pow(base, sliderMax) - 1); dock_widget->expandingRadiusLabel->setText(tr("Expanding Radius: %1").arg(expand_radius)); + CGAL_assertion(expand_radius >= 0); + expand_radius_updated = true; } private: @@ -933,7 +936,7 @@ private: bool non_init; SMesh::Property_map mu_i_map; std::tie(mu_i_map, non_init) = smesh.add_property_map(tied_string, 0); - if(non_init) + if(non_init || expand_radius_updated) { if(vnm_exists) { @@ -967,6 +970,8 @@ private: .ball_radius(expand_radius)); } } + + expand_radius_updated = false; } displaySMProperty(tied_string, smesh); From fbd15aa2ae773855565cf5d4373c69bf8a7c8b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 19 Jan 2024 13:55:53 +0100 Subject: [PATCH 90/95] make it cleaner --- .../test/Arrangement_on_surface_2/cgal_test.cmake | 5 ++--- .../test/Arrangement_on_surface_2/cgal_test_with_cmake | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 80d8fcf3fa9..59f174e0ba6 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,9 +72,8 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable.") if (CGAL_USE_LEDA) - message(STATUS "Try to use LEDA instead.") + message(STATUS "GMP is disabled, try to use LEDA instead.") set(GMPZ_NT ${LEDA_INT_NT}) set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) @@ -82,7 +81,7 @@ if(CGAL_DISABLE_GMP) set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) set(CGAL_GMPZ_NT ${LEDA_INT_NT}) else() - message(STATUS "Try to use MP float instead.") + message(STATUS "GMP is disabled, try to use MP float instead.") set(GMPZ_NT ${MP_FLOAT_NT}) set(QUOTIENT_CGAL_GMPZ_NT ${QUOTIENT_MP_FLOAT_NT}) set(CGAL_GMPQ_NT ${QUOTIENT_MP_FLOAT_NT}) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index acf5c73f486..d8c26c68390 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -78,9 +78,8 @@ CORE_INT_NT=15 CORE_RAT_NT=16 if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. if [ -n "CGAL_USE_LEDA" ]; then - echo Try to use LEDA instead. + echo GMP is disabled, try to use LEDA instead. GMPZ_NT=$LEDA_INT_NT QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT CGAL_GMPQ_NT=$LEDA_RAT_NT @@ -88,7 +87,7 @@ if [ -n "${CGAL_DISABLE_GMP}" ]; then LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT CGAL_GMPZ_NT=$LEDA_INT_NT else - echo Try to use MP float instead. + echo GMP is disabled, try to use MP float instead. GMPZ_NT=$MP_FLOAT_NT QUOTIENT_CGAL_GMPZ_NT=$QUOTIENT_MP_FLOAT_NT CGAL_GMPQ_NT=$QUOTIENT_MP_FLOAT_NT From 885647fe4cf43a26c20e114691deb685b2be1cf9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 19 Jan 2024 15:17:04 +0100 Subject: [PATCH 91/95] fix for when the line is empty --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index f20a4aafcfb..7b250380193 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -601,7 +601,7 @@ bool build_triangulation_from_file(std::istream& is, { // remove trailing whitespace, in particular a possible '\r' from Windows // end-of-line encoding - if(std::isspace(line.back())) { + if(!line.empty() && std::isspace(line.back())) { line.pop_back(); } if (line.size() > 0 && line.at(0) == '#' && From 7431715e96ad235d5e94a86d14f1830e5d3b972c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 22 Jan 2024 18:02:48 +0100 Subject: [PATCH 92/95] improve doc --- .../include/CGAL/Polygon_mesh_processing/region_growing.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h index 92571c43b1d..fc594b9122f 100644 --- a/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h +++ b/Shape_detection/include/CGAL/Polygon_mesh_processing/region_growing.h @@ -106,7 +106,8 @@ private: @param mesh the polygon mesh whose faces are used for region growing @param region_map a property map storing the region index of each face. Values start at `0` up to the value returned minus `1`. - `std::size_t(-1)` is put for faces with no region assigned (can only happen if `minimum_region_size > 1`). + `std::size_t(-1)` is put for faces with no region assigned (it can happen if `minimum_region_size > 1` or for a non-triangular + face having a fitting plane not satisfying the maximum distance criterium). @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below @return the number of regions detected From ab19b99105cb81f4b96df167155b3c39defa9e6c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 29 Jan 2024 16:16:17 +0000 Subject: [PATCH 93/95] Kernel_23: Add function squared_length() --- .../Kernel_23/CGAL/Kernel/global_functions.h | 34 +++++++++++++++++++ .../include/CGAL/Kernel/global_functions_2.h | 16 +++++++++ .../include/CGAL/Kernel/global_functions_3.h | 16 +++++++++ .../CGAL/Kernel/global_functions_internal_2.h | 17 ++++++++++ .../CGAL/Kernel/global_functions_internal_3.h | 16 +++++++++ 5 files changed, 99 insertions(+) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h index 243ca48a93e..b26638c84b1 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h @@ -2691,6 +2691,40 @@ const CGAL::Point_3& r); /// \defgroup squared_distance_grp CGAL::squared_distance() /// \ingroup kernel_global_function +/// \defgroup squared_radius_grp CGAL::squared_length() +/// \ingroup kernel_global_function + +/*! +compute the squared length of vector `v`. +*/ +template +FT +squared_length(const CGAL::Vector_2& v); + +/*! +compute the squared length of segment `s`. +*/ +template +FT +squared_length(const CGAL::Segment_2& s); + +/*! +compute the squared length of vector `v`. +*/ +template +FT +squared_length(const CGAL::Vector_3& v); + +/*! +compute the squared length of segment `s`. +*/ +template +FT +squared_length(const CGAL::Segment_3& s); + +/// @} + + /// \defgroup squared_radius_grp CGAL::squared_radius() /// \ingroup kernel_global_function /// \sa `Circle_2_grp` diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_2.h index e974eae730d..ad67bff1041 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_2.h @@ -1114,6 +1114,22 @@ side_of_oriented_circle(const Point_2 &p, return internal::side_of_oriented_circle(p, q, r, t, K()); } +template < class K > +inline +typename K::FT +squared_length(const Vector_2 &v) +{ + return internal::squared_length(v, K()); +} + +template < class K > +inline +typename K::FT +squared_length(const Segment_2 &s) +{ + return internal::squared_length(s, K()); +} + template < class K > inline typename K::FT diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_3.h index e17211e184b..aa16e5d7cb8 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_3.h @@ -1276,6 +1276,22 @@ squared_area(const Point_3 &p, const Point_3 &q, const Point_3 &r) return internal::squared_area(p, q, r, K()); } +template < class K > +inline +typename K::FT +squared_length(const Vector_3 &v) +{ + return internal::squared_length(v, K()); +} + +template < class K > +inline +typename K::FT +squared_length(const Segment_3 &s) +{ + return internal::squared_length(s, K()); +} + template < class K > inline typename K::FT diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h index 7212eb7ed60..a7407a9fd74 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h @@ -988,6 +988,23 @@ side_of_oriented_circle(const typename K::Point_2 &p, return k.side_of_oriented_circle_2_object()(p, q, r, t); } + +template +inline +typename K::FT +squared_length(const typename K::Vector_2 &v, const K &k) +{ + return k.compute_squared_length_2_object()(v); +} + +template +inline +typename K::FT +squared_length(const typename K::Segment_2 &s, const K &k) +{ + return k.compute_squared_length_2_object()(s); +} + template < class K > inline typename K::FT diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h index e48ec201f38..8ae26a9c787 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h @@ -1112,6 +1112,22 @@ squared_area(const typename K::Point_3 &p, return k.compute_squared_area_3_object()(p, q, r); } +template +inline +typename K::FT +squared_length(const typename K::Vector_3 &v, const K &k) +{ + return k.compute_squared_length_3_object()(v); +} + +template +inline +typename K::FT +squared_length(const typename K::Segment_3 &s, const K &k) +{ + return k.compute_squared_length_3_object()(s); +} + template < class K > inline typename K::FT From 276857a49cf4027b25d633209cf679baaa4ee64a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 29 Jan 2024 16:22:20 +0000 Subject: [PATCH 94/95] fix grp --- Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h index b26638c84b1..59823ac96c8 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h @@ -2688,12 +2688,14 @@ const CGAL::Point_3& r); // The same reason as do_intersect. -/// \defgroup squared_distance_grp CGAL::squared_distance() +/// \defgroup squared_length_grp CGAL::squared_distance() /// \ingroup kernel_global_function /// \defgroup squared_radius_grp CGAL::squared_length() /// \ingroup kernel_global_function +/// @{ + /*! compute the squared length of vector `v`. */ From e3ee9990246b7ca94adfd45bd320823ac349ef37 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 29 Jan 2024 16:26:29 +0000 Subject: [PATCH 95/95] fix grp --- Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h index 59823ac96c8..f0e1e50973f 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Kernel/global_functions.h @@ -2688,10 +2688,10 @@ const CGAL::Point_3& r); // The same reason as do_intersect. -/// \defgroup squared_length_grp CGAL::squared_distance() +/// \defgroup squared_distance_grp CGAL::squared_distance() /// \ingroup kernel_global_function -/// \defgroup squared_radius_grp CGAL::squared_length() +/// \defgroup squared_length_grp CGAL::squared_length() /// \ingroup kernel_global_function /// @{