diff --git a/.github/install.sh b/.github/install.sh index e06328da401..32b8552aa8f 100755 --- a/.github/install.sh +++ b/.github/install.sh @@ -1,5 +1,4 @@ #!/bin/bash -sudo add-apt-repository ppa:mikhailnov/pulseeffects -y sudo apt-get update sudo apt-get install -y libmpfr-dev \ libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \ diff --git a/.github/workflows/Remove_labels.yml b/.github/workflows/Remove_labels.yml new file mode 100644 index 00000000000..8e9ed55f6bd --- /dev/null +++ b/.github/workflows/Remove_labels.yml @@ -0,0 +1,32 @@ +name: remove_labels +on: + pull_request_target: + types: [synchronize] +jobs: + remove_label: + runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'Tested') + name: remove label + steps: + - name: removelabel + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: "Tested", + }); + - name: Post address + uses: actions/github-script@v6 + if: ${{ success() }} + with: + script: | + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: "This pull-request was previously marked with the label `Tested`, but has been modified with new commits. That label has been removed." + }) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 8a238305b81..3d2f2941c95 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -4,9 +4,16 @@ on: issue_comment: types: [created] +permissions: + contents: read # to fetch code (actions/checkout) + jobs: build: + permissions: + contents: read # to fetch code (actions/checkout) + pull-requests: write # to create comment + runs-on: ubuntu-latest steps: - uses: actions/github-script@v6 @@ -40,15 +47,27 @@ jobs: //get pullrequest url const pr_number = context.payload.issue.number return pr_number + + - name: Emoji-comment + uses: actions/github-script@v6 + if: steps.get_round.outputs.result != 'stop' + with: + script: | + github.rest.reactions.createForIssueComment({ + comment_id: ${{ github.event.comment.id }}, + owner: context.repo.owner, + repo: context.repo.repo, + content: 'rocket' + }) + - uses: actions/checkout@v3 name: "checkout branch" if: steps.get_round.outputs.result != 'stop' with: - repository: ${{ github.repository }} - ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge - token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }} - fetch-depth: 2 - + repository: ${{ github.repository }} + ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge + token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }} + fetch-depth: 2 - name: install dependencies if: steps.get_round.outputs.result != 'stop' @@ -83,14 +102,17 @@ jobs: #list impacted packages LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true) if [ "$LIST_OF_PKGS" = "" ]; then - echo "::set-output name=DoxygenError::No package affected." + echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT exit 1 fi cd build_doc && make -j2 doc make -j2 doc_with_postprocessing 2>tmp.log if [ -s tmp.log ]; then content=`cat ./tmp.log` - echo "::set-output name=DoxygenError::$(cat tmp.log)" + delimiter="$(openssl rand -hex 8)" + echo "DoxygenError<<${delimiter}" >> "${GITHUB_OUTPUT}" + cat tmp.log >> "${GITHUB_OUTPUT}" + echo "${delimiter}" >> "${GITHUB_OUTPUT}" exit 1 fi cd .. @@ -110,7 +132,7 @@ jobs: mv tmp.html index.html git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master else - echo "::set-output name=DoxygenError::This round already exists. Overwrite it with /force-build." + echo "DoxygenError=This round already exists. Overwrite it with /force-build." >> $GITHUB_OUTPUT exit 1 fi @@ -131,11 +153,13 @@ jobs: }); - name: Post error + env: + ERRORMSG: ${{steps.build_and_run.outputs.DoxygenError}} uses: actions/github-script@v6 if: ${{ failure() && steps.get_round.outputs.result != 'stop' }} with: script: | - const error = "${{steps.build_and_run.outputs.DoxygenError}}" + const error = process.env.ERRORMSG const msg = "There was an error while building the doc: \n"+error github.rest.issues.createComment({ owner: "CGAL", diff --git a/.github/workflows/filter_testsuite.yml b/.github/workflows/filter_testsuite.yml index 27f4c350885..9b222b77eb3 100644 --- a/.github/workflows/filter_testsuite.yml +++ b/.github/workflows/filter_testsuite.yml @@ -4,8 +4,12 @@ on: issue_comment: types: [created] +permissions: {} jobs: build: + permissions: + pull-requests: write # to create comment + if: (github.event.comment.user.login == 'sloriot' || github.event.comment.user.login == 'lrineau') && contains(github.event.comment.body, '/testme') runs-on: ubuntu-latest steps: diff --git a/AABB_tree/demo/AABB_tree/resources/about.html b/AABB_tree/demo/AABB_tree/resources/about.html index 8d2c41d1ea0..1ab9dc84c1b 100644 --- a/AABB_tree/demo/AABB_tree/resources/about.html +++ b/AABB_tree/demo/AABB_tree/resources/about.html @@ -2,8 +2,8 @@

AABB Tree Demo

Copyright ©2009 - INRIA Sophia Antipolis - Mediterranee

-

This application illustrates the AABB tree component + INRIA Sophia Antipolis - Mediterranee

+

This application illustrates the AABB tree component of CGAL, applied to polyhedron facets and edges.

See also the following chapters of the manual: diff --git a/AABB_tree/test/AABB_tree/AABB_test_util.h b/AABB_tree/test/AABB_tree/AABB_test_util.h index 65be2e8a7c5..5b73a20f9f2 100644 --- a/AABB_tree/test/AABB_tree/AABB_test_util.h +++ b/AABB_tree/test/AABB_tree/AABB_test_util.h @@ -527,7 +527,6 @@ private: { CGAL::Timer timer; timer.start(); - int nb_test = 0; while ( timer.time() < duration ) { Point a = random_point_in(m_tree.bbox()); @@ -539,8 +538,6 @@ private: test(segment, m_polyhedron, m_tree, m_naive); test(ray, m_polyhedron, m_tree, m_naive); test(line, m_polyhedron, m_tree, m_naive); - - ++nb_test; } timer.stop(); diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h index 3e4d8ba7df9..c7f5e1325b2 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h @@ -370,19 +370,19 @@ namespace CGAL { coord_type K, min_K; const coord_type eps; const coord_type inv_eps_2; // 1/(eps^2) - const coord_type eps_3; // test de ^3 donc points tel 1e-7 soit petit + const coord_type eps_3; // tests using cubed eps so points such that 1e-7 is small const criteria STANDBY_CANDIDATE; const criteria STANDBY_CANDIDATE_BIS; const criteria NOT_VALID_CANDIDATE; //--------------------------------------------------------------------- - //Pour une visu correcte - //pour retenir les facettes selectionnees + // For a correct visualization + // to retain the selected facets int _vh_number; int _facet_number; //--------------------------------------------------------------------- - //Pour le post traitement + // For post-processing mutable int _postprocessing_counter; int _size_before_postprocessing; @@ -501,9 +501,8 @@ namespace CGAL { } //------------------------------------------------------------------- - // pour gerer certaines aretes interieures: a savoir celle encore connectee au - // bord (en fait seule, les aretes interieures reliant 2 bords nous - // interressent...) + // to handle certain interior edges, meaning those still connected to the boundary + // (actually, only the interior edges linking two boundaries are relevant) inline void set_interior_edge(Vertex_handle w, Vertex_handle v) { @@ -806,7 +805,7 @@ namespace CGAL { if ((number_of_facets() > static_cast(T.number_of_vertices()))&& (NB_BORDER_MAX > 0)) - // en principe 2*nb_sommets = nb_facettes: y a encore de la marge!!! + // in theory 2*vertices_n = facets_n: plenty of room!!! { while(postprocessing()){ extend2_timer.start(); @@ -1068,9 +1067,8 @@ namespace CGAL { //--------------------------------------------------------------------- bool is_interior_edge(const Edge_like& key) const - // pour gerer certaines aretes interieures: a savoir celle encore connectee au - // bord (en fait seule, les aretes interieures reliant 2 bords nous - // interressent...) + // to handle certain interior edges, meaning those still connected to the boundary + // (actually, only the interior edges linking two boundaries are relevant) { return (is_interior_edge(key.first, key.second)|| is_interior_edge(key.second, key.first)); @@ -1299,7 +1297,6 @@ namespace CGAL { #ifdef AFSR_LAZY value = lazy_squared_radius(cc); #else - // qualified with CGAL, to avoid a compilation error with clang if(volume(pp0, pp1, pp2, pp3) != 0){ value = T.geom_traits().compute_squared_radius_3_object()(pp0, pp1, pp2, pp3); } else { @@ -1337,7 +1334,6 @@ namespace CGAL { { value = compute_scalar_product(Vc, Vc) - ac*ac/norm_V; if ((value < 0)||(norm_V > inv_eps_2)){ - // qualified with CGAL, to avoid a compilation error with clang value = T.geom_traits().compute_squared_radius_3_object()(cp1, cp2, cp3); } } @@ -1365,7 +1361,7 @@ namespace CGAL { /// @} //--------------------------------------------------------------------- - // For a border edge e we determine the incident facet which has the highest + // For a border edge e, we determine the incident facet which has the highest // chance to be a natural extension of the surface Radius_edge_type @@ -1425,8 +1421,7 @@ namespace CGAL { P2Pn = construct_vector(p2, pn); v2 = construct_cross_product(P2P1,P2Pn); - //pas necessaire de normer pour un bon echantillon: - // on peut alors tester v1*v2 >= 0 + // no need to normalize for a correct sampling: one can then test v1*v2 >= 0 norm = sqrt(norm1 * compute_scalar_product(v2,v2)); pscal = v1*v2; // check if the triangle will produce a sliver on the surface @@ -1437,7 +1432,8 @@ namespace CGAL { if (tmp < min_valueA) { PnP1 = p1-pn; - // DELTA represente la qualite d'echantillonnage du bord + // DELTA encodes the quality of the border sampling + // // We skip triangles having an internal angle along e // whose cosinus is smaller than -DELTA // that is the angle is larger than arcos(-DELTA) @@ -1462,37 +1458,36 @@ namespace CGAL { if ((min_valueA == infinity()) || border_facet) // bad facets case { - min_facet = Facet(c, i); // !!! sans aucune signification.... - value = NOT_VALID_CANDIDATE; // Attention a ne pas inserer dans PQ + min_facet = Facet(c, i); // !!! without any meaning.... + value = NOT_VALID_CANDIDATE; // Do not insert in the PQ } else { min_facet = min_facetA; - //si on considere seulement la pliure value appartient a [0, 2] - //value = coord_type(1) - min_valueP; - - // si la pliure est bonne on note suivant le alpha sinon on prend en compte la - // pliure seule... pour discriminer entre les bons slivers... - // si on veut discriminer les facettes de bonnes pliures plus finement - // alors -(1+1/min_valueA) app a [-inf, -1] - // -min_valueP app a [-1, 1] + // If we only consider the fold value belongs to [0, 2] + // value = coord_type(1) - min_valueP; + // If the fold is OK, we rate based on the alpha value. Otherwise, take only the fold into account + // to discriminate between good slivers. + // + // If we wish to discriminate the facets with good folds more finely, + // then: + // -(1+1/min_valueA) is within [-inf, -1] + // -min_valueP is within [-1, 1] + // if (min_valueP > COS_BETA) value = -(coord_type(1) + coord_type(1)/min_valueA); else { - //on refuse une trop grande non-uniformite + // reject overly non-uniform values coord_type tmp = priority (*this, c, i); if (min_valueA <= K * tmp) value = - min_valueP; else { - value = STANDBY_CANDIDATE; // tres mauvais candidat mauvaise pliure - // + grand alpha... a traiter plus tard.... - min_K = - (std::min)(min_K, - min_valueA/tmp); + value = STANDBY_CANDIDATE; // extremely bad candidate, bad fold + large alpha; handle later + min_K = (std::min)(min_K, min_valueA/tmp); } } } @@ -1597,7 +1592,7 @@ namespace CGAL { } //--------------------------------------------------------------------- - // test de reciprocite avant de recoller une oreille anti-singularite + // reciprocity test before glueing anti-singularity ear int test_merge(const Edge_like& ordered_key, const Border_elt& result, const Vertex_handle& v, const coord_type& ear_alpha) @@ -1622,12 +1617,12 @@ namespace CGAL { coord_type norm = sqrt(compute_scalar_product(v1, v1) * compute_scalar_product(v2, v2)); if (v1*v2 > COS_BETA*norm) - return 1; // label bonne pliure sinon: + return 1; // mark as good fold if (ear_alpha <= K * priority(*this, neigh, n_ind)) - return 2; // label alpha coherent... + return 2; // mark alpha consistent - return 0; //sinon oreille a rejeter... + return 0; // ear to be rejected } @@ -1753,7 +1748,7 @@ namespace CGAL { Edge_like ordered_key(v1,v2); if (!is_border_elt(ordered_key, result12)) - std::cerr << "+++probleme coherence bord " << std::endl; + std::cerr << "+++issue with border consistency " << std::endl; bool is_border_el1 = is_border_elt(ordered_el1, result1), is_border_el2 = is_border_elt(ordered_el2, result2); @@ -1782,8 +1777,7 @@ namespace CGAL { return FINAL_CASE; } //--------------------------------------------------------------------- - //on peut alors marquer v1 et on pourrait essayer de merger - //sans faire de calcul inutile??? + // we can then mark v1 and could try to merge without any useless computation??? if (is_border_el1) { Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third), @@ -1796,7 +1790,7 @@ namespace CGAL { return EAR_CASE; } //--------------------------------------------------------------------- - //idem pour v2 + //idem for v2 if (is_border_el2) { Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second), @@ -1852,9 +1846,9 @@ namespace CGAL { // border incident to a point... _mark<1 even if th orientation // may be such as one vh has 2 successorson the same border... { - // a ce niveau on peut tester si le recollement se fait en - // maintenant la compatibilite d'orientation des bords (pour - // surface orientable...) ou si elle est brisee... + // at this level, we can test if glueing can be done while keeping + // compatible orientations for the borders (for an orientable surface...) + // or if it is broken Edge_incident_facet edge_Ifacet_1(Edge(c, i, edge_Efacet.first.second), edge_Efacet.second); Edge_incident_facet edge_Ifacet_2(Edge(c, i, edge_Efacet.first.third), @@ -1884,8 +1878,8 @@ namespace CGAL { Border_elt result_ear2; Edge_like ear1_e, ear2_e; - // pour maintenir la reconstruction d'une surface orientable : - // on verifie que les bords se recollent dans des sens opposes + // to preserve the reconstruction of an orientable surface, we check that + // borders glue to one another in opposite directions if (ordered_key.first==v1) { ear1_e = Edge_like(c->vertex(i), ear1_c ->vertex(ear1_i)); @@ -1897,7 +1891,7 @@ namespace CGAL { ear2_e = Edge_like(c->vertex(i), ear2_c ->vertex(ear2_i)); } - //maintient la surface orientable + // preserves orientability of the surface bool is_border_ear1 = is_ordered_border_elt(ear1_e, result_ear1); bool is_border_ear2 = is_ordered_border_elt(ear2_e, result_ear2); bool ear1_valid(false), ear2_valid(false); @@ -1931,8 +1925,7 @@ namespace CGAL { { Validation_case res = validate(ear1, e1.first); if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; + std::cerr << "+++issue in glueing: case " << res << std::endl; e2 = compute_value(edge_Ifacet_2); if (ordered_key.first == v1) @@ -1948,8 +1941,7 @@ namespace CGAL { { Validation_case res = validate(ear2, e2.first); if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; + std::cerr << "+++issue in glueing : case " << res << std::endl; e1 = compute_value(edge_Ifacet_1); if (ordered_key.first == v1) @@ -1962,25 +1954,23 @@ namespace CGAL { _ordered_border.insert(Radius_ptr_type(e1.first, p1)); } } - else// les deux oreilles ne se recollent pas sur la meme arete... + else // both ears do not glue on the same edge { - // on resoud la singularite. + // resolve the singularity if (ear1_valid) { Validation_case res = validate(ear1, e1.first); if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; + std::cerr << "+++issue in glueing: case " << res << std::endl; } if (ear2_valid) { Validation_case res = validate(ear2, e2.first); if (!((res == EAR_CASE)||(res == FINAL_CASE))) - std::cerr << "+++probleme de recollement : cas " - << res << std::endl; + std::cerr << "+++issue in glueing : case " << res << std::endl; } - // on met a jour la PQ s'il y a lieu... mais surtout pas - // avant la resolution de la singularite + + // Update the PQ if needed, but not before resolving the singularity if (!ear1_valid) { _ordered_border.insert(Radius_ptr_type(e1.first, p1)); @@ -2020,7 +2010,7 @@ namespace CGAL { if (new_candidate.first == STANDBY_CANDIDATE) { - // a garder pour un K un peu plus grand... + // put aside for a slightly larger K new_candidate.first = STANDBY_CANDIDATE_BIS; } @@ -2042,8 +2032,8 @@ namespace CGAL { void extend() { - // initilisation de la variable globale K: qualite d'echantillonnage requise - K = K_init; // valeur d'initialisation de K pour commencer prudemment... + // Initialize the global variable K: required sampling quality + K = K_init; // initial value of K to start carefully coord_type K_prev = K; Vertex_handle v1, v2; @@ -2052,7 +2042,7 @@ namespace CGAL { } do { - min_K = infinity(); // pour retenir le prochain K necessaire pour progresser... + min_K = infinity(); // to store the next K required to progress do { @@ -2095,7 +2085,7 @@ namespace CGAL { { new_candidate = compute_value(mem_Ifacet); if ((new_candidate != mem_e_it)) - // &&(new_candidate.first < NOT_VALID_CANDIDATE)) + // &&(new_candidate.first < NOT_VALID_CANDIDATE)) { IO_edge_type* pnew = set_again_border_elt(key_tmp.first, key_tmp.second, @@ -2111,8 +2101,7 @@ namespace CGAL { (_ordered_border.begin()->first < STANDBY_CANDIDATE_BIS)); K_prev = K; K += (std::max)(K_step, min_K - K + eps); - // on augmente progressivement le K mais on a deja rempli sans - // faire des betises auparavant... + // Progressively increase K, but having already filled without issue beforehand } while((!_ordered_border.empty())&&(K <= K)&&(min_K != infinity())&&(K!=K_prev)); @@ -2125,9 +2114,8 @@ namespace CGAL { //--------------------------------------------------------------------- - // En principe, si l'allocateur de cellules etait bien fait on aurait pas besoin - // de mettre a jour les valeurs rajoutees pour les cellules a la main... - + // In theory, if the cell allocator were properly made, one would not need to manually update + // the values added for the cells void re_init_for_free_cells_cache(const Vertex_handle& vh) { @@ -2152,9 +2140,8 @@ namespace CGAL { int index = c->index(vh); Cell_handle neigh = c->neighbor(index); int n_ind = neigh->index(c); - neigh->set_smallest_radius(n_ind, -1); // pour obliger le recalcul - // si c est selectionnee c'est qu'elle est aussi le mem_IFacet renvoye par - // compute_value... donc a swapper aussi + neigh->set_smallest_radius(n_ind, -1); // forces recomputation + // if c is selected, then it is also the mem_IFacet returned by compute_value... so to be swapped too if (c->is_selected_facet(index)) { int fn = c->facet_number(index); @@ -2214,8 +2201,8 @@ namespace CGAL { circ = next(circ); } while(circ.first.first != c); - // si on passe par la, alors y a eu un probleme.... - std::cerr << "+++probleme dans la MAJ avant remove..." << std::endl; + // if we are here, something went wrong + std::cerr << "+++issue in the update before removal..." << std::endl; return Facet(c, start.second); } @@ -2237,7 +2224,7 @@ namespace CGAL { ordered_map_erase(border_elt.second.first.first, border_IO_elt(vh, vh_succ)); remove_border_edge(vh, vh_succ); - // 1- a virer au cas ou car vh va etre detruit + // 1- remove just in case since vh is about to be destroyed remove_interior_edge(vh_succ, vh); bool while_cond(true); do @@ -2266,14 +2253,14 @@ namespace CGAL { { ordered_map_erase(result.first.first, border_IO_elt(vh_int, vh)); remove_border_edge(vh_int, vh); - // 1- a virer au cas ou car vh va etre detruit + // 1- remove just in case since vh is about to be destroyed remove_interior_edge(vh_int, vh); while_cond = false; } - // a titre preventif... on essaye de s'assurer de marquer les aretes - // interieures au sens large... - // 2- a virer a tout pris pour que maintenir le sens de interior edge + // As a preventive measure, we try to ensure marking the interior edges in a broad sense + + // 2- remove to preserve the interior edge remove_interior_edge(vh_int, vh_succ); remove_interior_edge(vh_succ, vh_int); @@ -2304,16 +2291,16 @@ namespace CGAL { bool create_singularity(const Vertex_handle& vh) { - // Pour reperer le cas de triangle isole + // To detect the isolated triangle case if (vh->is_on_border()) { - // vh sommet 0 + // vh vertex 0 Next_border_elt border_elt = *(vh->first_incident()); - Vertex_handle vh_1 = border_elt.first;// sommet 1 + Vertex_handle vh_1 = border_elt.first;// vertex 1 border_elt = *(vh_1->first_incident()); - Vertex_handle vh_2 = border_elt.first;// sommet 2 + Vertex_handle vh_2 = border_elt.first;// vertex 2 border_elt = *(vh_2->first_incident()); - Vertex_handle vh_3 = border_elt.first;// sommet 0 ??? + Vertex_handle vh_3 = border_elt.first;// vertex 0 ??? Cell_handle c; int i, j, k; if ((vh_3 == vh)&&(T.is_facet(vh, vh_1, vh_2, c, i ,j ,k))) @@ -2328,7 +2315,7 @@ namespace CGAL { } - // Reperer le cas d'aretes interieures... + // Detect the interior edges case std::list vh_list; T.incident_vertices(vh, std::back_inserter(vh_list)); @@ -2402,9 +2389,9 @@ namespace CGAL { std::list L_v; - // Pour controler les sommets choisis sur le bord... + // To control vertices chosen on the boundary - // nombre d'aretes a partir duquel on considere que c'est irrecuperable NB_BORDER_MAX + // NB_BORDER_MAX: number of edges from which we consider that things are irrecoverable int vh_on_border_inserted(0); for(Finite_vertices_iterator v_it = T.finite_vertices_begin(); @@ -2445,7 +2432,7 @@ namespace CGAL { std::size_t itmp, L_v_size_mem; L_v_size_mem = L_v.size(); - if ((vh_on_border_inserted != 0)&& // pour ne post-traiter que les bords + if ((vh_on_border_inserted != 0)&& // to post-process only the borders (L_v.size() < .1 * _size_before_postprocessing)) { { @@ -2460,7 +2447,7 @@ namespace CGAL { } #ifdef VERBOSE if(L_v.size() > 0){ - std::cout << " " << L_v.size() << " non regular points." << std::endl; + std::cout << " " << L_v.size() << " non-regular points." << std::endl; } #endif // VERBOSE re_compute_values(); @@ -2469,7 +2456,7 @@ namespace CGAL { postprocess_timer.stop(); return false; } - // we stop if we removed more than 10% of points or after 20 rounds + // we stop if we removed more than 10% of points, or after 20 rounds if ((L_v_size_mem == L_v.size())|| ((_size_before_postprocessing - T.number_of_vertices()) > .1 * _size_before_postprocessing)|| @@ -2479,7 +2466,6 @@ namespace CGAL { } min_K = infinity(); - // fin-- // if (_postprocessing_counter < 5) // return true; postprocess_timer.stop(); diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h index a8c2bf4b2b4..bbecac5c757 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h @@ -220,7 +220,7 @@ namespace CGAL { else { if (m_incident_border->second->first != nullptr) - std::cerr << "+++probleme de MAJ du bord " << std::endl; + std::cerr << "+++issue while updating border " << std::endl; *m_incident_border->second = elt; } } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index dd142ad6791..d385b481a33 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -73,7 +73,7 @@ namespace CGAL { * in turn required by the \c CurvedKernelViaAnalysis_2 concept * (see the documentation of the corresponding package). Therefore, * some types and methods of the class have both an "algebraic" name - * (demanded by \c CurveKernelWithAnalysis_d_2) and an "non-algebraic name + * (demanded by \c CurveKernelWithAnalysis_d_2) and a "non-algebraic" name * (demanded by \c CurveKernel_2). * * \b Algebraic_curve_kernel_2 is a template class, and needs a model @@ -356,10 +356,10 @@ public: const OuterFunctor& outer) : _inner(inner), _outer(outer) {} - Unary_compose(const Unary_compose& other) - : _inner(other._inner), _outer(other._outer) {} + Unary_compose(const Unary_compose& other) = default; + Unary_compose& operator=(const Unary_compose& other) = default; - Unary_compose() : _inner(::boost::none),_outer(::boost::none) {} + Unary_compose() : _inner(::boost::none),_outer(::boost::none) {} typedef typename InnerFunctor::argument_type argument_type; typedef typename OuterFunctor::result_type result_type; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h index 19f447c08f2..18b7fa805dd 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_quadratic_refinement_rep_bfi.h @@ -45,7 +45,7 @@ namespace internal { * @Unpublished{abbott-quadratic, * author = {John Abbott}, * title = {Quadratic Interval Refinement for Real Roots}, - * url = {http://www.dima.unige.it/~abbott/}, + * url = {https://www.dima.unige.it/~abbott/}, * note = {Poster presented at the 2006 Internat. Sympos. on Symbolic and Algebraic Computation (ISSAC 2006)} * } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h index f1f45aab56c..974e26d0a57 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h @@ -1147,8 +1147,8 @@ public: Bitstream_descartes() : Base(new Rep()) {} //! Copy constructor - Bitstream_descartes(const Self& other) : Base(static_cast(other)) - {} + Bitstream_descartes(const Self& other) = default; + Bitstream_descartes& operator=(const Self& other) = default; /*! * \brief Constructor for a polynomial \c f diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h index d78d50acfd0..50ae06acee9 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_E08_tree.h @@ -436,6 +436,9 @@ public: friend class CGAL::internal::Bitstream_descartes_E08_tree; friend class CGAL::internal::Bitstream_descartes_E08_tree_rep; + Bitstream_descartes_E08_node(const Self&) = default; + Self& operator= (const Self&) = delete; + private: // "node data" (set individually in subdivision) Integer lower_num_, upper_num_; // TODO use lower_num_, width_num_ instead @@ -466,8 +469,6 @@ private: log_eps_ = n.log_eps_; log_C_eps_ = n.log_C_eps_; } - - Self& operator= (const Self&) = delete; }; // struct Bitstream_descartes_E08_node diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h index 869b758cb12..9d1084414cd 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h @@ -525,6 +525,9 @@ public: friend class internal::Bitstream_descartes_rndl_tree; friend class internal::Bitstream_descartes_rndl_tree_rep; + Bitstream_descartes_rndl_node(const Self&) = default; + Self& operator= (const Self&) = delete; + private: // "node data" (set individually in subdivision) Integer lower_num_, upper_num_; // TODO use lower_num_, width_num_ instead @@ -557,8 +560,6 @@ private: log_eps_ = n.log_eps_; log_C_eps_ = n.log_C_eps_; } - - Self& operator= (const Self&)=delete; }; // struct Bitstream_descartes_rndl_node diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h index 7167c9f8a12..3ae2a59e961 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h @@ -762,7 +762,7 @@ std::istream& operator >> ( is >> arcno; - // read the ") + // read the ")" swallow(is, ')'); pt = Xy_coordinate_2(x, curve, arcno); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h index b79e47262b3..ce3d7b3fda1 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_real_root_isolator.h @@ -187,7 +187,7 @@ void test_real_root_isolator() { assert( n == number_of_roots); }{ //std::cout << "Kameny 3\n"; - // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol + // from https://www-sop.inria.fr/saga/POL/BASE/1.unipol/ NT c = CGAL::ipower(NT(10),12); Polynomial P(NT(-3),NT(0),c); @@ -202,7 +202,7 @@ void test_real_root_isolator() { assert(3 == internal::check_intervals_real_root_isolator(P)); }{ //std::cout << "Kameny 4\n"; - // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol + // from https://www-sop.inria.fr/saga/POL/BASE/1.unipol NT z(0); NT a = CGAL::ipower(NT(10),24); // a = 10^{24} @@ -218,7 +218,7 @@ void test_real_root_isolator() { assert( 4 == internal::check_intervals_real_root_isolator(P)); }{ //std::cout << "Polynomial with large and small clustered roots\n"; - // from http://www-sop.inria.fr/saga/POL/BASE/1.unipol + // from https://www-sop.inria.fr/saga/POL/BASE/1.unipol // there seems to be some error or misunderstanding NT z(0); diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index d54f28b21a3..373dc515573 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -849,7 +848,7 @@ Alpha_shape_2::initialize_interval_edge_map() { // both faces are infinite by definition unattached // the edge is finite by construction - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && is_infinite(pFace))); interval = make_triple(squared_radius(pFace, i), Infinity, @@ -859,7 +858,7 @@ Alpha_shape_2::initialize_interval_edge_map() else { // is_infinite(pNeighbor) - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && !is_infinite(pFace))); if (is_attached(pFace, i)) interval = make_triple(UNDEFINED, @@ -1109,7 +1108,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { // which might be infinity // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == REGULAR)); + CGAL_assertion((classify(v) == REGULAR)); Alpha_shape_vertices_list.push_back(v); } } @@ -1122,7 +1121,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { ++vertex_alpha_it) { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == SINGULAR)); + CGAL_assertion((classify(v) == SINGULAR)); Alpha_shape_vertices_list.push_back(v); } @@ -1159,7 +1158,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const { pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1171,9 +1170,9 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1191,7 +1190,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1203,9 +1202,9 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1219,12 +1218,12 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // if alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) - == REGULAR) - || (classify((*edge_alpha_it).second.first, + CGAL_assertion(((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) - == SINGULAR))); + == REGULAR) + || (classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) + == SINGULAR))); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)); } @@ -1324,7 +1323,7 @@ Alpha_shape_2::number_of_solid_components(const Type_of_alpha& alpha) c ++face_it) { Face_handle pFace = face_it; - CGAL_triangulation_postcondition( pFace != nullptr); + CGAL_postcondition( pFace != nullptr); if (classify(pFace, alpha) == INTERIOR){ Data& data = marked_face_set[pFace]; @@ -1358,7 +1357,7 @@ Alpha_shape_2::traverse(const Face_handle& pFace, for (int i=0; i<3; i++) { pNeighbor = fh->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); + CGAL_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_face_set[pNeighbor]; if(data == false){ @@ -1514,7 +1513,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); // if we used Edelsbrunner and Muecke's definition // regular means incident to a higher-dimensional face @@ -1536,7 +1535,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const { pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1563,11 +1562,11 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == - Alpha_shape_2::INTERIOR)); + CGAL_assertion((classify(f) == + Alpha_shape_2::INTERIOR)); - CGAL_triangulation_assertion((classify(f, i) == - Alpha_shape_2::REGULAR)); + CGAL_assertion((classify(f, i) == + Alpha_shape_2::REGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' << V[f->vertex(f->cw(i))] << std::endl; @@ -1595,8 +1594,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == - Alpha_shape_2::REGULAR)); + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); V[v] = number_of_vertices++; os << v->point() << std::endl; } @@ -1608,8 +1606,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const ++vertex_alpha_it) { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == - Alpha_shape_2::SINGULAR)); + CGAL_assertion((classify(v) == Alpha_shape_2::SINGULAR)); V[v] = number_of_vertices++; os << v->point() << std::endl; @@ -1652,7 +1649,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const if (pInterval->second != Infinity && pInterval->second <= get_alpha()) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::REGULAR)); // assure that all vertices are in ccw order if (classify(f) == Alpha_shape_2::EXTERIOR) @@ -1665,7 +1662,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == + CGAL_assertion((classify(f) == Alpha_shape_2::INTERIOR)); os << V[f->vertex(f->ccw(i))] << ' ' @@ -1680,7 +1677,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the singular edges if (pInterval->first != UNDEFINED) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::SINGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' << V[f->vertex(f->cw(i))] << std::endl; @@ -1739,7 +1736,7 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); @@ -1769,7 +1766,7 @@ Alpha_shape_2::Output () if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1782,9 +1779,9 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - REGULAR)); + CGAL_assertion((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + REGULAR)); L.push_back((this->segment((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)) .source()); @@ -1802,12 +1799,12 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - REGULAR) || - (classify((*edge_alpha_it).second.first, - (*edge_alpha_it).second.second) == - SINGULAR))); + CGAL_assertion(((classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + REGULAR) || + (classify((*edge_alpha_it).second.first, + (*edge_alpha_it).second.second) == + SINGULAR))); L.push_back((this->segment((*edge_alpha_it).second.first, (*edge_alpha_it).second.second)) .source()); diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index bbce2b51e1c..b7b8c2e18ba 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -319,7 +319,7 @@ private : } // the version to be used with Tag_true is templated to avoid - // instanciation through explicit instantiation of the whole class + // instantiation through explicit instantiation of the whole class void set_alpha_min_of_vertices(Tag_false) { for( Finite_vertices_iterator vit = finite_vertices_begin(); @@ -401,7 +401,7 @@ public: // Returns the n-th alpha-value. // n < size() { - CGAL_triangulation_assertion( n > 0 && + CGAL_assertion( n > 0 && n <= static_cast(alpha_spectrum.size()) ); return alpha_spectrum[n-1]; } @@ -1713,7 +1713,7 @@ Alpha_shape_3::number_of_solid_components(const NT& alpha) const for( cell_it = finite_cells_begin(); cell_it != done; ++cell_it) { Cell_handle pCell = cell_it; - CGAL_triangulation_assertion(pCell != nullptr); + CGAL_assertion(pCell != nullptr); if (classify(pCell, alpha) == INTERIOR){ Data& data = marked_cell_set[pCell]; @@ -1745,7 +1745,7 @@ void Alpha_shape_3::traverse(Cell_handle pCell, for (int i=0; i<=3; i++) { pNeighbor = pCell->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != nullptr); + CGAL_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_cell_set[pNeighbor]; if(data == false){ diff --git a/Alpha_wrap_3/examples/Alpha_wrap_3/triangle_mesh_wrap.cpp b/Alpha_wrap_3/examples/Alpha_wrap_3/triangle_mesh_wrap.cpp index b4b1ec067ff..5aa8deeb4de 100644 --- a/Alpha_wrap_3/examples/Alpha_wrap_3/triangle_mesh_wrap.cpp +++ b/Alpha_wrap_3/examples/Alpha_wrap_3/triangle_mesh_wrap.cpp @@ -45,6 +45,7 @@ int main(int argc, char** argv) const double alpha = diag_length / relative_alpha; const double offset = diag_length / relative_offset; + std::cout << "alpha: " << alpha << ", offset: " << offset << std::endl; // Construct the wrap CGAL::Real_timer t; diff --git a/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp b/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp index 91b95584f8c..2eb3f9c4155 100644 --- a/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp +++ b/Alpha_wrap_3/examples/Alpha_wrap_3/wrap_from_cavity.cpp @@ -47,16 +47,9 @@ int main(int argc, char** argv) const double offset = diag_length / relative_offset; // Construct the wrap - using Oracle = CGAL::Alpha_wraps_3::internal::Triangle_mesh_oracle; - Oracle oracle; - oracle.add_triangle_mesh(input); - CGAL::Real_timer t; t.start(); - Mesh wrap; - CGAL::Alpha_wraps_3::internal::Alpha_wrap_3 aw3(oracle); - // There is no limit on how many seeds can be used. // However, the algorithm automatically determines whether a seed can be used // to initialize the refinement based on a few conditions (distance to the offset, value of alpha, etc.) @@ -66,7 +59,8 @@ int main(int argc, char** argv) Point_3(0, 50, 0) // a point within the armadillo surface }; - aw3(alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds))); + Mesh wrap; + alpha_wrap_3(input, alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds))); t.stop(); std::cout << "Result: " << num_vertices(wrap) << " vertices, " << num_faces(wrap) << " faces" << std::endl; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h index e88e00fafe0..8e05d6929cf 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_3.h @@ -29,7 +29,7 @@ #include -#include +#include #include #include #include @@ -229,11 +229,14 @@ private: } public: - template + template void operator()(const double alpha, // = default_alpha() const double offset, // = alpha / 30. OutputMesh& output_mesh, - const NamedParameters& np) + const InputNamedParameters& in_np = parameters::default_values(), + const OutputNamedParameters& out_np = parameters::default_values()) { namespace PMP = Polygon_mesh_processing; @@ -241,25 +244,25 @@ public: using parameters::get_parameter_reference; using parameters::choose_parameter; - using OVPM = typename CGAL::GetVertexPointMap::type; - OVPM ovpm = choose_parameter(get_parameter(np, internal_np::vertex_point), + using OVPM = typename CGAL::GetVertexPointMap::type; + OVPM ovpm = choose_parameter(get_parameter(out_np, internal_np::vertex_point), get_property_map(vertex_point, output_mesh)); typedef typename internal_np::Lookup_named_param_def < internal_np::visitor_t, - NamedParameters, + InputNamedParameters, Wrapping_default_visitor // default >::reference Visitor; Wrapping_default_visitor default_visitor; - Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor); + Visitor visitor = choose_parameter(get_parameter_reference(in_np, internal_np::visitor), default_visitor); std::vector no_seeds; using Seeds = typename internal_np::Lookup_named_param_def< - internal_np::seed_points_t, NamedParameters, std::vector >::reference; - Seeds seeds = choose_parameter(get_parameter_reference(np, internal_np::seed_points), no_seeds); + internal_np::seed_points_t, InputNamedParameters, std::vector >::reference; + Seeds seeds = choose_parameter(get_parameter_reference(in_np, internal_np::seed_points), no_seeds); - const bool do_enforce_manifoldness = choose_parameter(get_parameter(np, internal_np::do_enforce_manifoldness), true); + const bool do_enforce_manifoldness = choose_parameter(get_parameter(in_np, internal_np::do_enforce_manifoldness), true); #ifdef CGAL_AW3_TIMER CGAL::Real_timer t; @@ -360,14 +363,6 @@ public: } // Convenience overloads - template - void operator()(const double alpha, - const double offset, - OutputMesh& output_mesh) - { - return operator()(alpha, offset, output_mesh, parameters::default_values()); - } - template void operator()(const double alpha, OutputMesh& output_mesh) diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h similarity index 96% rename from Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h rename to Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h index 1a3fa7d8183..22c64e9b5e2 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h @@ -13,8 +13,8 @@ // Andreas Fabri // Michael Hemmer // -#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H -#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H +#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H +#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H #include @@ -89,14 +89,14 @@ public: }; template -class Alpha_wrap_AABB_traits +class Alpha_wrap_AABB_geom_traits : public GT { public: using Ball_3 = internal::Ball_3; public: - Alpha_wrap_AABB_traits(const GT& gt = GT()) : GT(gt) { } + Alpha_wrap_AABB_geom_traits(const GT& gt = GT()) : GT(gt) { } public: class Construct_ball_3 @@ -295,4 +295,4 @@ public: } // namespace Alpha_wraps_3 } // namespace CGAL -#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H +#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Oracle_base.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Oracle_base.h index c38157a59bf..85bd11c00b6 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Oracle_base.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Oracle_base.h @@ -145,6 +145,8 @@ public: bool empty() const { return m_tree_ptr->empty(); } bool do_call() const { return (!empty() || base().do_call()); } + void clear() { m_tree_ptr->clear() && base().clear(); } + public: typename AABB_tree::Bounding_box bbox() const { @@ -313,6 +315,8 @@ public: bool empty() const { return m_tree_ptr->empty(); } bool do_call() const { return !empty(); } + void clear() { m_tree_ptr->clear(); } + public: typename AABB_tree::Bounding_box bbox() const { diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h index b27ffa0525a..7bad2ff313d 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Point_set_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct PS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Points = std::vector; using PR_iterator = typename Points::const_iterator; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h index a6a87f000ab..d02a9f9faaf 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Segment_soup_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct SS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Segments = std::vector; using SR_iterator = typename Segments::const_iterator; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h index f4e74da51e9..6d0f65142f6 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -37,7 +37,7 @@ namespace internal { template struct TM_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Point_3 = typename Geom_traits::Point_3; using AABB_traits = typename AABB_tree_splitter_traits::AABB_traits; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h index 81fed3d58df..57f936306da 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/Triangle_soup_oracle.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -38,7 +38,7 @@ namespace internal { template struct TS_oracle_traits { - using Geom_traits = Alpha_wrap_AABB_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 + using Geom_traits = Alpha_wrap_AABB_geom_traits; // Wrap the kernel to add Ball_3 + custom Do_intersect_3 using Point_3 = typename Geom_traits::Point_3; using AABB_traits = typename AABB_tree_splitter_traits::AABB_traits; using AABB_tree = typename AABB_tree_splitter_traits::AABB_tree; diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h index 77a4ca313c0..509a9efe7e2 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/oracles.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include diff --git a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h index 1e06b7ff30e..4b146e95d8f 100644 --- a/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h +++ b/Alpha_wrap_3/include/CGAL/Alpha_wrap_3/internal/splitting_helper.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include diff --git a/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h b/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h index 13cf90f2df8..638c5fb9fa1 100644 --- a/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h +++ b/Alpha_wrap_3/include/CGAL/alpha_wrap_3.h @@ -112,7 +112,7 @@ void alpha_wrap_3(const PointRange& points, Oracle oracle(alpha, gt); oracle.add_triangle_soup(points, faces, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // Convenience overloads @@ -261,7 +261,7 @@ void alpha_wrap_3(const TriangleMesh& tmesh, Oracle oracle(alpha, gt); oracle.add_triangle_mesh(tmesh, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // The convenience overloads are the same for triangle mesh & point set @@ -357,7 +357,7 @@ void alpha_wrap_3(const PointRange& points, Oracle oracle(gt); oracle.add_point_set(points, in_np); AW3 alpha_wrap_builder(oracle); - alpha_wrap_builder(alpha, offset, alpha_wrap, out_np); + alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np); } // Convenience overloads, common to both mesh and point set diff --git a/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp b/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp index 928cade6495..638431e3056 100644 --- a/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp +++ b/Alpha_wrap_3/test/Alpha_wrap_3/test_AW3_manifoldness.cpp @@ -45,7 +45,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh, Mesh nm_wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, nm_wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(false)); std::cout << "Result: " << vertices(nm_wrap).size() << " vertices, " << faces(nm_wrap).size() << " faces" << std::endl; @@ -67,7 +66,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh, Mesh m_wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, m_wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(true)); // CGAL::IO::write_polygon_mesh("last.off", wrap, CGAL::parameters::stream_precision(17)); diff --git a/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp b/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp index 5091934b62f..470d48e40d4 100644 --- a/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp +++ b/Alpha_wrap_3/test/Alpha_wrap_3/test_alpha_wrap_3_mesh.cpp @@ -47,7 +47,6 @@ void alpha_wrap_triangle_mesh(Mesh& input_mesh, Mesh wrap; CGAL::alpha_wrap_3(input_mesh, alpha, offset, wrap, - CGAL::parameters::default_values(), CGAL::parameters::do_enforce_manifoldness(enforce_manifoldness)); std::cout << "Result: " << vertices(wrap).size() << " vertices, " << faces(wrap).size() << " faces" << std::endl; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index e5988f9f77b..e9e6ee7d472 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -53,7 +53,7 @@ is_valid(bool verbose, int level) const if (number_of_vertices() < 3) return true; - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); for (All_edges_iterator eit = all_edges_begin(); eit != all_edges_end(); ++eit) { @@ -64,7 +64,7 @@ is_valid(bool verbose, int level) const if ( !is_infinite(v) ) { result = result && ( incircle(f, v->site()) != NEGATIVE ); - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); } Edge sym_e = sym_edge(e); f = sym_e.first; @@ -72,7 +72,7 @@ is_valid(bool verbose, int level) const if ( !is_infinite(v) ) { result = result && ( incircle(f, v->site()) != NEGATIVE ); - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); } } @@ -83,7 +83,7 @@ is_valid(bool verbose, int level) const std::cerr << "Apollonius diagram is NOT valid..." << std::flush; } - // CGAL_triangulation_assertion(result); + // CGAL_assertion(result); return result; } @@ -100,7 +100,7 @@ typename Apollonius_graph_2::Point_2 Apollonius_graph_2:: circumcenter(const Face_handle& f) const { - CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); + CGAL_precondition (dimension()==2 || !is_infinite(f)); return circumcenter(f->vertex(0)->site(), f->vertex(1)->site(), f->vertex(2)->site()); @@ -122,7 +122,7 @@ typename Apollonius_graph_2::Site_2 Apollonius_graph_2:: circumcircle(const Face_handle& f) const { - CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f)); + CGAL_precondition (dimension()==2 || !is_infinite(f)); return circumcircle(f->vertex(0)->site(), f->vertex(1)->site(), f->vertex(2)->site()); @@ -178,7 +178,7 @@ typename Gt::Object_2 Apollonius_graph_2:: dual(const Edge e) const { - CGAL_triangulation_precondition( !is_infinite(e) ); + CGAL_precondition( !is_infinite(e) ); if ( dimension() == 1 ) { Site_2 p = (e.first)->vertex(cw(e.second))->site(); @@ -207,16 +207,16 @@ dual(const Edge e) const } // only one of the adjacent faces is infinite - CGAL_triangulation_assertion( is_infinite( e.first ) || + CGAL_assertion( is_infinite( e.first ) || is_infinite( e.first->neighbor(e.second) ) ); - CGAL_triangulation_assertion( !(is_infinite( e.first ) && + CGAL_assertion( !(is_infinite( e.first ) && is_infinite( e.first->neighbor(e.second) ) ) ); - CGAL_triangulation_assertion + CGAL_assertion ( is_infinite( e.first->vertex(e.second) ) || is_infinite( tds().mirror_vertex(e.first, e.second) ) ); @@ -246,7 +246,7 @@ primal(const Edge e) const // typedef typename Geom_traits::Hyperbola_segment_2 Hyperbola_segment; // typedef typename Geom_traits::Parabola_segment_2 Parabola_segment; - // CGAL_triangulation_precondition( !is_infinite(e) ); + // CGAL_precondition( !is_infinite(e) ); if ( number_of_vertices() != 2 ) { if ( is_infinite(e) ) { @@ -257,7 +257,7 @@ primal(const Edge e) const Site_2 s = tds().mirror_vertex( e.first, e.second )->site(); ray = construct_Apollonius_primal_ray_2_object()(p,r,s); } else { - CGAL_triangulation_assertion + CGAL_assertion ( is_infinite( e.first->vertex(ccw(e.second)) ) ); Site_2 q = e.first->vertex( cw(e.second) )->site(); Site_2 r = e.first->vertex( e.second )->site(); @@ -317,11 +317,11 @@ typename Apollonius_graph_2::Edge Apollonius_graph_2:: flip(Face_handle& f, int i) { - CGAL_triangulation_precondition ( f != Face_handle() ); - CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( dimension()==2 ); + CGAL_precondition ( f != Face_handle() ); + CGAL_precondition (i == 0 || i == 1 || i == 2); + CGAL_precondition( dimension()==2 ); - CGAL_triangulation_precondition( f->vertex(i) != tds().mirror_vertex(f,i) ); + CGAL_precondition( f->vertex(i) != tds().mirror_vertex(f,i) ); this->_tds.flip(f, i); @@ -383,7 +383,7 @@ void Apollonius_graph_2:: remove_degree_2(Vertex_handle v) { - CGAL_triangulation_precondition( is_degree_2(v) ); + CGAL_precondition( is_degree_2(v) ); this->_tds.remove_degree_2( v ); } @@ -403,7 +403,7 @@ void Apollonius_graph_2:: remove_degree_3(Vertex_handle v, Face_handle f) { - CGAL_triangulation_precondition( degree(v) == 3 ); + CGAL_precondition( degree(v) == 3 ); this->_tds.remove_degree_3(v, f); } @@ -416,7 +416,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_first(const Site_2& p) { - CGAL_triangulation_precondition(number_of_vertices() == 0); + CGAL_precondition(number_of_vertices() == 0); Vertex_handle v = this->_tds.insert_second(); v->set_site(p); return v; @@ -428,7 +428,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_second(const Site_2& p) { - CGAL_triangulation_precondition( number_of_vertices() == 1 ); + CGAL_precondition( number_of_vertices() == 1 ); Vertex_handle vnew; Vertex_handle v(finite_vertices_begin()); if ( is_hidden(v->site(), p) ) { @@ -439,7 +439,7 @@ insert_second(const Site_2& p) v->set_site(p); vnew = v; } else { - CGAL_triangulation_precondition(number_of_vertices() == 1); + CGAL_precondition(number_of_vertices() == 1); vnew = this->_tds.insert_dim_up(infinite_vertex(), true); vnew->set_site(p); // vnew = Delaunay_graph::insert_second(p); @@ -453,7 +453,7 @@ typename Apollonius_graph_2::Vertex_handle Apollonius_graph_2:: insert_third(const Site_2& p) { - CGAL_triangulation_precondition( number_of_vertices() == 2 ); + CGAL_precondition( number_of_vertices() == 2 ); Face_handle f((*finite_edges_begin()).first); Vertex_handle v1(f->vertex(0)); @@ -592,7 +592,7 @@ insert_third(const Site_2& p) } } - // CGAL_triangulation_assertion( is_valid() ); + // CGAL_assertion( is_valid() ); return v; } @@ -1752,8 +1752,8 @@ void Apollonius_graph_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( !is_infinite(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( !is_infinite(v) ); // find a neighbor of v to use for point location of hidden sites to // be re-inserted @@ -1900,7 +1900,7 @@ remove_degree_d_vertex(Vertex_handle v) CGAL_assertion( found ); CGAL_USE(found); } - CGAL_triangulation_precondition( degree(v) == 3 ); + CGAL_precondition( degree(v) == 3 ); this->_tds.remove_degree_3( v, Face_handle() ); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index ba13844eb0e..a5369929afe 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -332,8 +332,8 @@ void Apollonius_graph_hierarchy_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); // get the hidden circles typename Apollonius_graph_base::Site_list wp_list; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h index c16c2f1903f..a1f6fc7158d 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_vertex_base_2.h @@ -19,7 +19,6 @@ #include #include -#include namespace CGAL { diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp index bdc2c17f627..b470946cec0 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementPainterOstream.cpp @@ -48,12 +48,10 @@ ArrangementPainterOstream>& ArrangementPainterOstream>:: operator<<(const X_monotone_curve_2& curve) { - int cnt = 0; for (typename X_monotone_curve_2::Subcurve_const_iterator it = curve.subcurves_begin(); it != curve.subcurves_end(); ++it) { - cnt++; this->painterOstream << *it; } @@ -200,7 +198,6 @@ ArrangementPainterOstreamfirst, p_curr->second); @@ -208,7 +205,6 @@ ArrangementPainterOstreamqp->drawLine(p1, p2); p_curr++; p_next++; - ++count; } while (p_next != end_pts); }; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.cpp index 2de4a0d6e28..ee1772a644b 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.cpp @@ -19,7 +19,7 @@ ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements - ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + ** will be met: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -31,7 +31,7 @@ ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be - ** met: http://www.gnu.org/copyleft/gpl.html. + ** met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h index 13c6c13b06e..ea1a2ba7a47 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h @@ -19,7 +19,7 @@ ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements - ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + ** will be met: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -31,7 +31,7 @@ ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be - ** met: http://www.gnu.org/copyleft/gpl.html. + ** met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. 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 029b95fa637..ad570b18253 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 @@ -1937,8 +1937,8 @@ perform a point-location query on the resulting arrangement. The query point \f$q\f$ is drawn as a plus sign. The face that contains it is drawn with a shaded texture. The program calls an instance of the function template `print_arrangement_size()`, which prints -quantitative measures of the arrangement; see \ref lst_paz "code -example" for its listing in Section \ref aos_ssec-basic-arr_class. +quantitative measures of the arrangement; see \ref lst_paz +"code example" for its listing in Section \ref aos_ssec-basic-arr_class. \cgalExample{Arrangement_on_surface_2/incremental_insertion.cpp} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h index ce14843f935..3d7d3ab5826 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_segment_traits_2.h @@ -112,7 +112,7 @@ public: typedef X_monotone_curve_2 Curve_2; //! A functor that trims curves. - Class Trim_2 { + class Trim_2 { public: //! \name Creation //! @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h index d19d83140cb..d01577defe1 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h @@ -8,7 +8,6 @@ namespace ArrTraits { * \cgalHasModel ArrangementClosedLeftTraits_2::Compare_y_on_boundary_2 * \cgalHasModel ArrangementClosedRightTraits_2::Compare_y_on_boundary_2 * \cgalHasModel ArrangementIdentifiedVerticalTraits_2::Compare_y_on_boundary_2 - * \cgalHasModel ArrangementOpenBoundaryTraits_2::Compare_y_on_boundary_2 * \cgalHasModel ArrangementSphericalBoundaryTraits_2::Compare_y_on_boundary_2 */ class CompareYOnBoundary_2 { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index f95817735da..5ad5f86b400 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -316,7 +316,7 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const // face) we check the isolated vertices inside the face to check whether there // is an isolated vertex right above/below the query point. // -template +template typename Arr_trapezoid_ric_point_location::result_type Arr_trapezoid_ric_point_location:: _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, @@ -324,40 +324,36 @@ _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, bool shoot_up, const Td_map_item& tr) const { + const auto* gt = this->arrangement()->geometry_traits(); const Comparison_result point_above_under = (shoot_up ? SMALLER : LARGER); - typename Geometry_traits_2::Compare_x_2 compare_x = - this->arrangement()->traits()->compare_x_2_object(); - typename Geometry_traits_2::Compare_xy_2 compare_xy = - this->arrangement()->traits()->compare_xy_2_object(); - typename Geometry_traits_2::Compare_y_at_x_2 compare_y_at_x = - this->arrangement()->traits()->compare_y_at_x_2_object(); + auto compare_x = gt->compare_x_2_object(); + auto compare_xy = gt->compare_xy_2_object(); + auto compare_y_at_x = gt->compare_y_at_x_2_object(); - Isolated_vertex_const_iterator iso_verts_it; - Vertex_const_handle closest_iso_v; - const Vertex_const_handle invalid_v; - const Halfedge_const_handle invalid_he; - Face_const_handle face; + Vertex_const_handle closest_iso_v; + const Vertex_const_handle invalid_v; + const Halfedge_const_handle invalid_he; // If the closest feature is a valid halfedge, take its incident face. // Otherwise, take the unbounded face. - if (halfedge_found == invalid_he) - face = _get_unbounded_face(tr, p, All_sides_oblivious_category()); - else - face = halfedge_found->face(); + Face_const_handle face = (halfedge_found == invalid_he) ? + _get_unbounded_face(tr, p, All_sides_oblivious_category()) : + halfedge_found->face(); // Go over the isolated vertices in the face. + // The following statement pacifies MSVC. Without it the implicit conversion + // from the iterator to the corresponding handle fails! + Isolated_vertex_const_iterator iso_verts_it; for (iso_verts_it = face->isolated_vertices_begin(); iso_verts_it != face->isolated_vertices_end(); ++iso_verts_it) { // The current isolated vertex should have the same x-coordinate as the // query point in order to be below or above it. - if (compare_x (p, iso_verts_it->point()) != EQUAL) - continue; + if (compare_x (p, iso_verts_it->point()) != EQUAL) continue; // Make sure the isolated vertex is above the query point (if we shoot up) // or below it (if we shoot down). - if (compare_xy (p, iso_verts_it->point()) != point_above_under) - continue; + if (compare_xy (p, iso_verts_it->point()) != point_above_under) continue; // Check if the current isolated vertex lies closer to the query point than // the closest feature so far. @@ -379,12 +375,10 @@ _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, // If we found an isolated vertex above (or under) the query point, return // a handle to this vertex. - if (closest_iso_v != invalid_v) - return make_result(closest_iso_v); + if (closest_iso_v != invalid_v) return make_result(closest_iso_v); // If we are inside the unbounded face, return this face. - if (halfedge_found == invalid_he) - return make_result(face); + if (halfedge_found == invalid_he) return make_result(face); // Return the halfedge lying above (or below) the query point. return make_result(halfedge_found); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h index 7b2cc3ffd9b..dff6a89f9cf 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_walk_along_line_pl_impl.h @@ -776,7 +776,7 @@ _is_in_connected_component (const Point_2& p, //----------------------------------------------------------------------------- // Find the first halfedge around a given target vertex, when going clockwise // from "6 o'clock" around this vertex (when shooting up) or starting from -// "12 o'clock (when shooting down). +// "12 o'clock" (when shooting down). // template typename Arr_walk_along_line_point_location::Halfedge_const_handle diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h index ca5e8ce1447..dab9ffa9248 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h @@ -1114,7 +1114,7 @@ public: // model of this concept. // // The following implementation is inspired by - // http://stackoverflow.com/a/11816999/1915421 + // https://stackoverflow.com/a/11816999/1915421 template struct Void { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h index 57f3acaf004..5824f23f425 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h @@ -183,7 +183,7 @@ protected: /*! * Find the first halfedge around a given target vertex, when going clockwise * from "6 o'clock" around this vertex (when shooting up) or starting from - * "12 o'clock (when shooting down). + * "12 o'clock" (when shooting down). * \param v The given vertex. * \param shoot_up If (true) we should start from "6 o'clock", * if (false) we should start from "12 o'clock". diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h index 0a89ec038a3..5fd87bc4e7b 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h @@ -164,7 +164,7 @@ enum Fig_depth /*! * \class A class for writing geometric objects in a FIG format (version 3.2). - * For more details, see: http://www.xfig.org/userman/fig-format.html + * For more details, see: https://mcj.sourceforge.net/ */ template class Fig_stream diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index c5d1e671ff0..da1177a7062 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -74,7 +74,7 @@ int main(int argc, char** argv) // Ad hoc property_map to store normals. Face_index_map is used to // map face_descriptors to a contiguous range of indices. See - // http://www.boost.org/libs/property_map/doc/vector_property_map.html + // https://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map normals(static_cast(num_faces(lcc)), get(CGAL::face_index, lcc)); diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index 9a67ba42b2d..711800cb8ab 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv) // Ad hoc property_map to store normals. Face_index_map is used to // map face_descriptors to a contiguous range of indices. See - // http://www.boost.org/libs/property_map/doc/vector_property_map.html + // https://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. boost::vector_property_map normals(static_cast(num_faces(P)), get(CGAL::face_index, P)); diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index ca9adb2d294..30d481f8cdf 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -38,11 +38,12 @@ typename boost::graph_traits::halfedge_descriptor join_face(typename boost::graph_traits::halfedge_descriptor h, Graph& g) { - typedef typename boost::graph_traits Traits; + typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); halfedge_descriptor hop = opposite(h,g); halfedge_descriptor hprev = prev(h, g), gprev = prev(hop, g); @@ -73,17 +74,17 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, remove_edge(edge(h, g), g); return hprev; - } + } // namespace EulerImpl /// \endcond - namespace Euler { +namespace Euler { + /// \ingroup PkgBGLEulerOperations /// @{ - /** * joins the two vertices incident to `h`, (that is `source(h, g)` and * `target(h, g)`) and removes `source(h,g)`. Returns the predecessor @@ -117,6 +118,8 @@ join_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::vertex_descriptor vertex_descriptor; typedef Halfedge_around_target_iterator halfedge_around_vertex_iterator; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + halfedge_descriptor hop = opposite(h, g) , hprev = prev(hop, g) , gprev = prev(h, g) @@ -191,8 +194,9 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { - CGAL_assertion(h1 != h2); - CGAL_assertion(target(h1, g) == target(h2, g)); + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(h1 != h2); + CGAL_precondition(target(h1, g) == target(h2, g)); typename boost::graph_traits::halfedge_descriptor hnew = halfedge(add_edge(g), g), @@ -226,8 +230,11 @@ split_vertex(typename boost::graph_traits::halfedge_descriptor h1, template typename boost::graph_traits::halfedge_descriptor split_edge(typename boost::graph_traits::halfedge_descriptor h, Graph& g) -{ return opposite(split_vertex(prev(h,g), opposite(h,g),g), g); } +{ + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + return opposite(split_vertex(prev(h,g), opposite(h,g),g), g); +} /** * joins the two faces incident to `h` and `opposite(h,g)`. @@ -260,8 +267,6 @@ join_face(typename boost::graph_traits::halfedge_descriptor h, return EulerImpl::join_face(h,g); } - - /** * splits the face incident to `h1` and `h2`. Creates the opposite * halfedges `h3` and `h4`, such that `next(h1,g) == h3` and `next(h2,g) == h4`. @@ -290,6 +295,12 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(h1 != h2); + CGAL_precondition(face(h1, g) == face(h2, g)); + CGAL_precondition(next(h1, g) != h2 && next(h2, g) != h1); + halfedge_descriptor hnew = halfedge(add_edge(g), g); face_descriptor fnew = add_face(g); internal::insert_tip( hnew, h2, g); @@ -298,6 +309,7 @@ split_face(typename boost::graph_traits::halfedge_descriptor h1, internal::set_face_in_face_loop(opposite(hnew,g), fnew, g); set_halfedge(face(hnew,g), hnew, g); set_halfedge(face(opposite(hnew,g),g), opposite(hnew,g), g); + return hnew; } @@ -327,7 +339,9 @@ join_loop(typename boost::graph_traits::halfedge_descriptor h1, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); CGAL_precondition( is_border(h1,g) || face(h1, g) != face(h2, g)); + if (! is_border(h1,g)) remove_face(face(h1, g), g); if (! is_border(h2,g)) @@ -401,13 +415,18 @@ split_loop(typename boost::graph_traits::halfedge_descriptor h1, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && + is_valid_halfedge_descriptor(h2, g) && + is_valid_halfedge_descriptor(h3, g)); + halfedge_descriptor h = h1, i = h2, j = h3; - CGAL_precondition( h != i); - CGAL_precondition( h != j); - CGAL_precondition( i != j); - CGAL_precondition( target(h,g) == target(opposite(i,g),g)); - CGAL_precondition( target(i,g) == target(opposite(j,g),g)); - CGAL_precondition( target(j,g) == target(opposite(h,g),g)); + CGAL_precondition(h != i); + CGAL_precondition(h != j); + CGAL_precondition(i != j); + CGAL_precondition(target(h,g) == target(opposite(i,g),g)); + CGAL_precondition(target(i,g) == target(opposite(j,g),g)); + CGAL_precondition(target(j,g) == target(opposite(h,g),g)); + // Create a copy of the triangle. halfedge_descriptor hnew = internal::copy(h,g); halfedge_descriptor inew = internal::copy(i,g); @@ -505,7 +524,9 @@ void remove_face(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); CGAL_precondition(! is_border(h,g)); + face_descriptor f = face(h, g); halfedge_descriptor end = h; @@ -551,13 +572,15 @@ add_edge(typename boost::graph_traits::vertex_descriptor s, typename boost::graph_traits::vertex_descriptor t, Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(s, g) && is_valid_vertex_descriptor(t, g)); + typename boost::graph_traits::edge_descriptor e = add_edge(g); set_target(halfedge(e, g), t, g); set_target(opposite(halfedge(e, g), g), s, g); + return e; } - /** * checks whether a new face defined by a range of vertices (identified by their descriptors, * `boost::graph_traits::%vertex_descriptor`) can be added. @@ -568,6 +591,9 @@ bool can_add_face(const VertexRange& vrange, const PMesh& sm) typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition_code(for(vertex_descriptor v : vrange)) + CGAL_precondition(is_valid_vertex_descriptor(v, sm)); + std::vector::vertex_descriptor> face(vrange.begin(), vrange.end()); std::size_t N = face.size(); @@ -697,6 +723,9 @@ add_face(const VertexRange& vr, Graph& g) typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + CGAL_precondition_code(for(vertex_descriptor v : vr)) + CGAL_precondition(is_valid_vertex_descriptor(v, g)); + std::vector vertices(vr.begin(), vr.end()); // quick and dirty copy unsigned int n = (unsigned int)vertices.size(); //check that every vertex is unique @@ -1115,7 +1144,9 @@ void make_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; typedef Halfedge_around_face_iterator halfedge_around_face_iterator; - CGAL_precondition(! is_border(h,g)); + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(!is_border(h, g)); + face_descriptor fd = face(h, g); halfedge_around_face_iterator hafib, hafie; for(boost::tie(hafib, hafie) = halfedges_around_face(h, g); @@ -1139,6 +1170,9 @@ void fill_hole(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::face_descriptor face_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(is_border(h, g)); + face_descriptor f = add_face(g); for(halfedge_descriptor hd : halfedges_around_face(h,g)){ set_face(hd, f,g); @@ -1179,6 +1213,9 @@ add_center_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + CGAL_precondition(!is_border(h, g)); + halfedge_descriptor hnew = halfedge(add_edge(g),g); vertex_descriptor vnew = add_vertex(g); internal::close_tip(hnew, vnew, g); @@ -1236,6 +1273,8 @@ remove_center_vertex(typename boost::graph_traits::halfedge_descriptor h, typedef typename boost::graph_traits Traits; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + // h points to the vertex that gets removed halfedge_descriptor h2 = opposite(next(h, g), g); halfedge_descriptor hret = prev(h, g); @@ -1283,14 +1322,28 @@ add_vertex_and_face_to_border(typename boost::graph_traits::halfedge_desc typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { - typename boost::graph_traits::vertex_descriptor v = add_vertex(g); - typename boost::graph_traits::face_descriptor f = add_face(g); - typename boost::graph_traits::edge_descriptor e1 = add_edge(g); - typename boost::graph_traits::edge_descriptor e2 = add_edge(g); - typename boost::graph_traits::halfedge_descriptor he1= halfedge(e1, g); - typename boost::graph_traits::halfedge_descriptor he2= halfedge(e2, g); - typename boost::graph_traits::halfedge_descriptor ohe1= opposite(he1, g); - typename boost::graph_traits::halfedge_descriptor ohe2= opposite(he2, g); + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + CGAL_precondition(is_border(h1, g) && is_border(h2, g)); + CGAL_precondition(h1 != h2); + + CGAL_precondition_code(halfedge_descriptor h = h1;) + CGAL_precondition_code(const halfedge_descriptor done = h1;) + CGAL_precondition_code(do { if(h == h2) break; h = next(h, g); } while(h != done);) + CGAL_precondition(h != done); + + vertex_descriptor v = add_vertex(g); + face_descriptor f = add_face(g); + edge_descriptor e1 = add_edge(g); + edge_descriptor e2 = add_edge(g); + halfedge_descriptor he1 = halfedge(e1, g); + halfedge_descriptor he2 = halfedge(e2, g); + halfedge_descriptor ohe1= opposite(he1, g); + halfedge_descriptor ohe2= opposite(he2, g); set_next(ohe1, next(h1,g),g); set_next(h1,he1,g); @@ -1340,6 +1393,7 @@ add_face_to_border(typename boost::graph_traits::halfedge_descriptor h1, typename boost::graph_traits::halfedge_descriptor h2, Graph& g) { + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); CGAL_precondition(is_border(h1,g) == true); CGAL_precondition(is_border(h2,g) == true); CGAL_precondition(h1 != h2); @@ -1409,6 +1463,8 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, typedef typename Traits::vertex_descriptor vertex_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_edge_descriptor(e, g)); + halfedge_descriptor pq = halfedge(e,g); halfedge_descriptor qp = opposite(pq, g); halfedge_descriptor pt = opposite(prev(pq, g), g); @@ -1520,15 +1576,17 @@ collapse_edge(typename boost::graph_traits::edge_descriptor e, template typename boost::graph_traits::vertex_descriptor collapse_edge(typename boost::graph_traits::edge_descriptor v0v1, - Graph& g - , EdgeIsConstrainedMap Edge_is_constrained_map) + Graph& g, + EdgeIsConstrainedMap Edge_is_constrained_map) { typedef boost::graph_traits< Graph > Traits; typedef typename Traits::vertex_descriptor vertex_descriptor; typedef typename Traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_edge_descriptor(v0v1, g)); + CGAL_precondition(!get(Edge_is_constrained_map, v0v1)); + halfedge_descriptor pq = halfedge(v0v1,g); - CGAL_assertion( !get(Edge_is_constrained_map,v0v1) ); halfedge_descriptor qp = opposite(pq,g); halfedge_descriptor pt = opposite(prev(pq,g),g); @@ -1666,6 +1724,8 @@ flip_edge(typename boost::graph_traits::halfedge_descriptor h, typedef typename Traits::halfedge_descriptor halfedge_descriptor; typedef typename Traits::face_descriptor face_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, g)); + vertex_descriptor s = source(h,g); vertex_descriptor t = target(h,g); halfedge_descriptor nh = next(h,g), nnh = next(nh,g), oh = opposite(h,g), noh = next(oh,g), nnoh = next(noh,g); @@ -1706,6 +1766,8 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef CGAL::Halfedge_around_source_iterator out_edge_iterator; + CGAL_precondition(is_valid_edge_descriptor(e, g)); + halfedge_descriptor v0_v1 = halfedge(e,g); halfedge_descriptor v1_v0 = opposite(v0_v1,g); @@ -1798,9 +1860,8 @@ does_satisfy_link_condition(typename boost::graph_traits::edge_descriptor #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL template -bool - satisfies_link_condition(typename boost::graph_traits::edge_descriptor e, - const Graph& g) +bool satisfies_link_condition(typename boost::graph_traits::edge_descriptor e, + const Graph& g) { return does_satisfy_link_condition(e, g); } @@ -1808,9 +1869,8 @@ bool #endif /// @} -} // CGAL - -} // CGAL +} // namespace Euler +} // namespace CGAL #endif /* CGAL_EULER_OPERATIONS_H */ diff --git a/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h b/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h index 7f7d663daa4..1f893ffb43c 100644 --- a/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h +++ b/BGL/include/CGAL/boost/graph/IO/Tds_2_off.h @@ -109,7 +109,7 @@ off_file_input( std::istream& is, Triangulation_data_structure_2& tds, bo tds.set_adjacency(fn, 2, inf_edge_map); edge_map.erase(edge_map.begin()); } - CGAL_triangulation_assertion(inf_edge_map.empty()); + CGAL_assertion(inf_edge_map.empty()); } diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index d49a53fd814..a4e91f177fb 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -195,6 +195,11 @@ make_quad(typename boost::graph_traits::vertex_descriptor v0, typename boost::graph_traits::vertex_descriptor v3, Graph& g) { + CGAL_precondition(is_valid_vertex_descriptor(v0, g) && + is_valid_vertex_descriptor(v1, g) && + is_valid_vertex_descriptor(v2, g) && + is_valid_vertex_descriptor(v3, g)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; halfedge_descriptor h0 = halfedge(add_edge(g), g); diff --git a/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h b/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h index a6e5bfe287d..5127f692a24 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h @@ -11,7 +11,7 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYMESH_ARRAYKERNELT_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYMESH_ARRAYKERNELT_H -// http://openmesh.org/Documentation/OpenMesh-Doc-Latest/classOpenMesh_1_1Concepts_1_1KernelT.html +// https://www.graphics.rwth-aachen.de/media/openmesh_static/Documentations/OpenMesh-Doc-Latest/a02182.html #include #include #include diff --git a/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h b/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h index 863dc50b075..512a4991e76 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h @@ -11,7 +11,7 @@ #ifndef CGAL_BOOST_GRAPH_GRAPH_TRAITS_TRIMESH_ARRAYKERNELT_H #define CGAL_BOOST_GRAPH_GRAPH_TRAITS_TRIMESH_ARRAYKERNELT_H -// http://openmesh.org/Documentation/OpenMesh-Doc-Latest/classOpenMesh_1_1Concepts_1_1KernelT.html +// https://www.graphics.rwth-aachen.de/media/openmesh_static/Documentations/OpenMesh-Doc-Latest/a02182.html #include #include #include diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 0448870f6ed..21644ebf18f 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #include - namespace CGAL { /*! @@ -75,277 +75,244 @@ is_border(typename boost::graph_traits::vertex_descriptor vd, return boost::optional::halfedge_descriptor>(); } +namespace BGL { - /*! - \ingroup PkgBGLHelperFct - returns `true` if there are no border edges. - */ -template -bool is_closed(const FaceGraph& g) +template +bool is_valid_vertex_descriptor(typename boost::graph_traits::vertex_descriptor v, + const Graph& g, + const bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(halfedge_descriptor hd : halfedges(g)){ - if(is_border(hd,g)){ - return false; - } - } - return true; -} + Verbose_ostream verr(verb); + bool valid = true; - /*! - \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly two incident edges. - */ -template -bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == opposite(next(opposite(next(hd,g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all vertices have exactly two incident edges. - */ -template - bool is_bivalent_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(vertex_descriptor vd : vertices(g)){ - halfedge_descriptor hd = halfedge(vd,g); - if((hd == boost::graph_traits::null_halfedge()) || - (! is_bivalent(hd,g))){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if the target of `hd` has exactly three incident edges. - */ -template -bool is_trivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == opposite(next(opposite(next(opposite(next(hd,g),g),g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all - vertices have exactly three incident edges. - */ -template - bool is_trivalent_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - for(vertex_descriptor vd : vertices(g)){ - halfedge_descriptor hd = halfedge(vd,g); - if((hd == boost::graph_traits::null_halfedge()) || - (! is_trivalent(halfedge(hd,g),g))){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a triangle. - \pre `g` must be valid. - */ -template - bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor beg = hd; - if(is_border(hd,g)) return false; - for(int i=0; i<3;i++){ - if(! is_border(opposite(hd,g),g)) return false; - hd = next(hd,g); - } - return hd == beg; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. - */ -template -bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == next(next(next(hd,g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all faces are triangles. - */ -template - bool is_triangle_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::face_descriptor face_descriptor; - for(face_descriptor fd : faces(g)){ - if(! is_triangle(halfedge(fd,g),g)){ - return false; - } - } - return true; -} - -/*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a quadrilateral. - */ -template -bool is_isolated_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor beg = hd; - if(is_border(hd,g)) return false; - for(int i=0; i<4;i++){ - if(! is_border(opposite(hd,g),g)) return false; - hd = next(hd,g); - } - return hd == beg; -} - - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. - */ -template -bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - return hd == next(next(next(next(hd,g),g),g),g); -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` if all faces are quadrilaterals. - */ -template - bool is_quad_mesh(const FaceGraph& g) -{ - typedef typename boost::graph_traits::face_descriptor face_descriptor; - for(face_descriptor fd : faces(g)){ - if(! is_quad(halfedge(fd,g),g)){ - return false; - } - } - return true; -} - - /*! - \ingroup PkgBGLHelperFct - returns `true` iff the connected component denoted by `hd` is a tetrahedron. - */ -template -bool is_tetrahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - halfedge_descriptor h1 = hd; - if(is_border(h1,g)) return false; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor h2 = next(h1,g); - halfedge_descriptor h3 = next(h2,g); - halfedge_descriptor h4 = next(opposite(h1,g),g ); - halfedge_descriptor h5 = next(opposite(h2,g),g ); - halfedge_descriptor h6 = next(opposite(h3,g),g ); - // check halfedge combinatorics. - // at least three edges at vertices 1, 2, 3. - if ( h4 == opposite(h3,g) ) return false; - if ( h5 == opposite(h1,g) ) return false; - if ( h6 == opposite(h2,g) ) return false; - // exact three edges at vertices 1, 2, 3. - if ( next(opposite(h4,g),g) != opposite(h3,g) ) return false; - if ( next(opposite(h5,g),g) != opposite(h1,g) ) return false; - if ( next(opposite(h6,g),g) != opposite(h2,g) ) return false; - // three edges at v4. - if ( opposite(next(h4,g),g) != h5 ) return false; - if ( opposite(next(h5,g),g) != h6 ) return false; - if ( opposite(next(h6,g),g) != h4 ) return false; - // All facets are triangles. - if ( next(next(next(h1,g),g),g) != h1 ) return false; - if ( next(next(next(h4,g),g),g) != h4 ) return false; - if ( next(next(next(h5,g),g),g) != h5 ) return false; - if ( next(next(next(h6,g),g),g) != h6 ) return false; - // all edges are non-border edges. - if ( is_border(h1,g) ) return false; // implies h2 and h3 - if ( is_border(h4,g) ) return false; - if ( is_border(h5,g) ) return false; - if ( is_border(h6,g) ) return false; - return true; - } - -template -bool is_valid_halfedge_descriptor( typename boost::graph_traits::halfedge_descriptor h, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - face_descriptor f = face(h,g); - halfedge_descriptor done(h); - do{ - if(face(h,g) != f){ - std::cerr << "halfedge " << h << " is invalid\n"; - return false; - } - halfedge_descriptor hn = h; - hn = next(h,g); - if(prev(hn,g) != h){ - std::cerr << "halfedge " << h << " is invalid\n"; - return false; - } - h = hn; - } while(h != done); - return true; -} - -template -bool is_valid_vertex_descriptor( typename boost::graph_traits::vertex_descriptor v, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - halfedge_descriptor h = halfedge(v,g), done(h); - if(h == boost::graph_traits::null_halfedge()){ - return true; - } - do{ - if(target(h,g) != v){ - std::cerr << "vertex " << v << " is invalid\n"; - return false; - } - h = opposite(next(h,g),g); - }while(h != done); - return true; -} - -template -bool is_valid_face_descriptor( typename boost::graph_traits::face_descriptor f, const FaceGraph& g) -{ - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - halfedge_descriptor h = halfedge(f,g); - if(face(h,g) != f){ - std::cerr << "face " << f << " is invalid\n"; + // null vertex + valid = (v != boost::graph_traits::null_vertex()); + if(!valid) + { + verr << "vertex is null." << std::endl; return false; } + + if(!CGAL::internal::is_isolated(v, g)) + { + // Incident halfedge integrity + valid = (target(halfedge(v, g), g) == v); + if(!valid) + { + verr << "vertex has invalid halfedge()." << std::endl; + return false; + } + } + return true; } +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits::halfedge_descriptor h, + const Graph& g, + const bool verb = false) +{ + Verbose_ostream verr(verb); + bool valid = true; + + // null halfedge + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge is null." << std::endl; + return false; + } + + // Pointer integrity. + valid = (prev(h, g) != boost::graph_traits::null_halfedge()); + valid = valid && (next(h, g) != boost::graph_traits::null_halfedge()); + valid = valid && (opposite(h, g) != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge's prev / next / opposite halfedges are null." << std::endl; + return false; + } + + // degeneracies + valid = (next(h, g) != h); + valid = valid && (prev(h, g) != h); + valid = valid && (opposite(h, g) != h); + valid = valid && (target(h, g) != target(opposite(h, g), g)); + if(!valid) + { + verr << "combinatorial degeneracies." << std::endl; + return false; + } + + // edge integrity + valid = (halfedge(edge(h, g), g) == h); + if(!valid) + { + verr << "halfedge has an invalid edge." << std::endl; + return false; + } + + // opposite integrity. + valid = (opposite(h, g) != h); + valid = valid && (opposite(opposite(h, g), g) == h); + if(!valid) + { + verr << "halfedge has invalid opposite()." << std::endl; + return false; + } + + // previous integrity. + valid = (prev(next(h, g), g) == h); + valid = valid && (next(prev(h, g), g) == h); + if(!valid) + { + verr << "prev(next(hd)) != hd OR next(prev(hd)) != hd" << std::endl; + return false; + } + + // vertex integrity. + valid = (target(h, g) != boost::graph_traits::null_vertex()); + if(!valid) + { + verr << "target of halfedge is the null vertex." << std::endl; + return false; + } + + valid = (target(h, g) == target(opposite(next(h, g), g), g)); + valid = valid && (target(opposite(h, g), g) == target(prev(h, g), g)); + if(!valid) + { + verr << "vertex inconsistencies with prev/next." << std::endl; + return false; + } + + return true; +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits::edge_descriptor e, + const FaceGraph& g, + const bool verb = false) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + Verbose_ostream verr(verb); + bool valid = true; + + // there is no null_edge() in the Graph concepts + + // Pointer integrity. + const halfedge_descriptor h = halfedge(e, g); + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge incident to edge is the null halfedge." << std::endl; + return false; + } + + // halfedge integrity + valid = (edge(h, g) == e); + if(!valid) + { + verr << "edge has an invalid halfedge()." << std::endl; + return false; + } + + return true; +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits::face_descriptor f, + const FaceGraph& g, + const bool verb = false) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + Verbose_ostream verr(verb); + bool valid = true; + + // null face + valid = (f != boost::graph_traits::null_face()); + if(!valid) + { + verr << "face is null." << std::endl; + return false; + } + + // Pointer integrity. + const halfedge_descriptor h = halfedge(f, g); + valid = (h != boost::graph_traits::null_halfedge()); + if(!valid) + { + verr << "halfedge incident to face is the null halfedge." << std::endl; + return false; + } + + valid = (face(h, g) == f); + if(!valid) + { + verr << "face has an invalid halfedge()." << std::endl; + return false; + } + + // face integrity. + valid = (face(h, g) == face(next(h, g), g)); + valid = valid && (face(h, g) == face(prev(h, g), g)); + if(!valid) + { + verr << "different face incident to face halfedges." << std::endl; + return false; + } + + return true; +} + +} // namespace BGL + +// These empty functions simply calling the BGL versions (just above) are done such that +// a specific graph type (e.g. Surface_mesh) can overload those and still call the BGL versions +// without duplicating code +template +bool is_valid_vertex_descriptor(typename boost::graph_traits::vertex_descriptor v, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_vertex_descriptor(v, g, verb); +} + +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits::halfedge_descriptor h, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_halfedge_descriptor(h, g, verb); +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits::edge_descriptor e, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_edge_descriptor(e, g, verb); +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits::face_descriptor f, + const Graph& g, + const bool verb = false) +{ + return BGL::is_valid_face_descriptor(f, g, verb); +} + /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the graph `g`. * - * `g` is valid if it follows the rules of the `HalfedgeListGraph` concept, - * and all of its associations are reciprocal. - * For example, `prev(next(h, g), g)` must be `h`, - * and `next(prev(h, g), g)` must be `h`. + * The graph `g` is valid if it follows the rules of the `HalfedgeListGraph` concept + * and all of its associations are reciprocal (for example, `prev(next(h, g), g)` must be `h`, + * and `next(prev(h, g), g)` must be `h`). * - * \param g the `Graph` to test. + * \param g the graph to test * \param verb if `true`, the details of the check will be written in the standard output. * * \tparam Graph a model of `HalfedgeListGraph` @@ -357,14 +324,13 @@ template bool is_valid_halfedge_graph(const Graph& g, bool verb = false) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::vertices_size_type vertex_size_type; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; Verbose_ostream verr(verb); - std::size_t num_v(std::distance(boost::begin(vertices(g)), boost::end(vertices(g)))), - num_e(std::distance(boost::begin(edges(g)), boost::end(edges(g)))), - num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g)))); + + std::size_t num_v = CGAL::internal::exact_num_vertices(g), + num_e = CGAL::internal::exact_num_edges(g), + num_h = CGAL::internal::exact_num_halfedges(g); bool valid = (1 != (num_h&1) && (2*num_e == num_h)); if(!valid) @@ -375,288 +341,185 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false) } // All halfedges. - halfedges_size_type n = 0; - for(halfedge_descriptor begin : halfedges(g)) + std::size_t hc = 0; + for(halfedge_descriptor h : halfedges(g)) { - // Pointer integrity. - valid = (next(begin, g) != boost::graph_traits::null_halfedge()); - valid = valid && (opposite(begin, g) != boost::graph_traits::null_halfedge()); - if(!valid) + if(!is_valid_halfedge_descriptor(h, g, verb)) { - verr << "halfedge " << n << " next / opposite halfedges are null." << std::endl; + verr << "halfedge " << hc << " is invalid." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - // edge integrity - valid = (halfedge(edge(begin, g), g) == begin); - - // opposite integrity. - valid = valid && (opposite(begin, g) != begin); - valid = valid && (opposite(opposite(begin, g), g) == begin); - if(!valid) - { - verr << "halfedge " << n << " invalid halfedge opposite()." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - // previous integrity. - valid = (prev(next(begin, g), g) == begin); - valid = valid && (next(prev(begin, g), g) == begin); - if(!valid) - { - verr << "halfedge " << n << " prev(next(hd)) != hd OR next(prev(hd)) != hd" << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - // vertex integrity. - valid = (target(begin, g) != boost::graph_traits::null_vertex()); - if(!valid) - { - verr << "halfedge " << n << " target of halfedge is the null vertex." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - valid = (target(begin, g) == target(opposite(next(begin, g), g), g)); - if(!valid) - { - verr << "halfedge " << n << " target(hd) != source(next(hd))." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - ++n; + ++hc; } - valid = (n == num_h); + valid = (hc == num_h); if(!valid) { - verr << "counting halfedges failed." << std::endl; + verr << "counting halfedges failed: " << hc << " vs " << num_h << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } // All vertices. - vertex_size_type v = 0; - n = 0; - for(vertex_descriptor vbegin : vertices(g)) + std::size_t vc = 0; + hc = 0; + for(vertex_descriptor v : vertices(g)) { - // Pointer integrity. - if(halfedge(vbegin, g) != boost::graph_traits::null_halfedge()) - valid = (target(halfedge(vbegin, g), g) == vbegin); - else - valid = false; - - if(!valid) + if(!is_valid_vertex_descriptor(v, g, verb)) { - verr << "vertex " << v << " halfedge incident to vertex is the null halfedge." << std::endl; + verr << "vertex " << vc << " is invalid." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } // cycle-around-vertex test. - halfedge_descriptor h = halfedge(vbegin, g); - if(h != boost::graph_traits::null_halfedge()) + if(!CGAL::internal::is_isolated(v, g)) { - halfedge_descriptor ge = h; + halfedge_descriptor h = halfedge(v, g), done = h; do { - ++n; + ++hc; h = opposite(next(h, g), g); - valid = (n <= num_h && n != 0); + valid = (hc <= num_h); if(!valid) { - verr << "vertex " << v << " too many halfedges around vertex." << std::endl; + verr << "vertex " << vc << " too many halfedges around vertex." << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } } - while(h != ge); + while(h != done); } - ++v; + ++vc; } - valid = (v == num_v); + valid = (vc == num_v); if(!valid) { - verr << "counting vertices failed." << std::endl; + verr << "counting vertices failed: " << vc << " vs " << num_v << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - valid = (n == num_h); + valid = (hc == num_h); if(!valid) { - verr << "counting halfedges via vertices failed." << std::endl; + verr << "counting halfedges via vertices failed: " << hc << " vs " << num_h << std::endl; verr << "Halfedge Graph Structure is NOT VALID." << std::endl; return false; } - // All halfedges. - n = 0; - for(halfedge_descriptor i : halfedges(g)) - { - // At least triangular facets and distinct geometry. - valid = (next(i, g) != i) && (target(i, g) != target(opposite(i, g), g)); - if(!valid) - { - verr << "halfedge " << n << " pointer validity corrupted." << std::endl; - verr << "Halfedge Graph Structure is NOT VALID." << std::endl; - return false; - } - - ++n; - } - - valid = (n == num_h); - if(!valid) - verr << "counting halfedges failed." << std::endl; - - verr << "Halfedge Graph Structure is " << (valid ? "valid." : "NOT VALID.") << std::endl; + verr << "Halfedge Graph Structure is valid" << std::endl; return valid; } /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the graph `g`. * - * `g` is valid if it is a valid `HalfedgeListGraph`, if it follows the rules - * of the `FaceListGraph` concept, and all of its associations are reciprocal. - * For example, `face(halfedge(f,g),g)` must be `f`. - * calls `is_valid_halfedge_graph()` + * The graph `g` is a valid face graph if it is a valid halfedge graph, and if it follows the rules + * of the `FaceListGraph` concept and all of its associations are reciprocal (for example, + * `face(halfedge(f,g),g)` must be `f`). * - * \param g the `Graph` to test. - * \param verb if `true`, the details of the check will be written in the standard output. + * \param g the graph to test + * \param verb if `true`, the details of the check will be written in the standard output * - * \tparam Graph a model of `FaceListGraph` + * \tparam FaceGraph a model of `FaceListGraph` and `HalfedgeListGraph` * * \return `true` if `g` is valid, `false` otherwise. * * \see `is_valid_halfedge_graph()` */ -template -bool is_valid_face_graph(const Graph& g, bool verb = false) +template +bool is_valid_face_graph(const FaceGraph& g, bool verb = false) { - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - typedef typename boost::graph_traits::halfedges_size_type halfedges_size_type; - typedef typename boost::graph_traits::face_descriptor face_descriptor; - typedef typename boost::graph_traits::faces_size_type faces_size_type; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + typedef typename boost::graph_traits::face_descriptor face_descriptor; Verbose_ostream verr(verb); - std::size_t num_f(std::distance(boost::begin(faces(g)), boost::end(faces(g)))), - num_h(std::distance(boost::begin(halfedges(g)), boost::end(halfedges(g)))); + std::size_t num_f = CGAL::internal::exact_num_faces(g), + num_h = CGAL::internal::exact_num_halfedges(g); - faces_size_type f = 0; - std::size_t n = 0; - std::size_t hn = 0; - halfedges_size_type nb = 0; + std::size_t fc = 0, hc = 0, nb = 0; - //is valid halfedge_graph ? bool valid = is_valid_halfedge_graph(g, verb); if(!valid) return false; // All faces. - for(face_descriptor fbegin : faces(g)) + for(face_descriptor f : faces(g)) { - // Pointer integrity. - if(halfedge(fbegin, g) != boost::graph_traits::null_halfedge()) - valid = (face(halfedge(fbegin, g), g) == fbegin); - else - valid = false; - - if(!valid) + if(!is_valid_face_descriptor(f, g, verb)) { - verr << "face " << f << " halfedge incident to face is the null halfedge." << std::endl; + verr << "face " << fc << " is invalid." << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } // cycle-around-face test. - halfedge_descriptor h = halfedge( fbegin, g); - if(h != boost::graph_traits::null_halfedge()) + halfedge_descriptor h = halfedge(f, g), done(h); + do { - halfedge_descriptor ge = h; - do + ++hc; + valid = (hc <= num_h); + if(!valid) { - ++n; - h = next(h, g); - valid = (n <= num_h && n != 0); - if(!valid) - { - verr << "face " << f << " too many halfedges around face." << std::endl; - verr << "Face Graph Structure is NOT VALID." << std::endl; - return false; - } + verr << "face " << fc << " too many halfedges around face." << std::endl; + verr << "Face Graph Structure is NOT VALID." << std::endl; + return false; } - while(h != ge); + h = next(h, g); } + while(h != done); - ++f; + ++fc; } - valid = (f == num_f); + valid = (fc == num_f); if(!valid) { - verr << "counting faces failed." << std::endl; + verr << "counting faces failed: " << fc << " vs " << num_f << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } - for(halfedge_descriptor i : halfedges(g)) + for(halfedge_descriptor h : halfedges(g)) { - ++hn; - //counting borders - if(is_border(i, g)) + if(is_border(h, g)) ++nb; - - // face integrity. - valid = (face(i, g) == face(next(i, g), g)); - if(!valid) - { - verr << "halfedge " << hn << " face(hd) != face(next(hd))." << std::endl; - verr << "Face Graph Structure is NOT VALID." << std::endl; - return false; - } } - valid = (n + nb == num_h); + valid = (hc + nb == num_h); if(!valid) { - verr << "sum border halfedges (2*nb) = " << 2 * nb << std::endl; verr << "counting halfedges via faces failed." << std::endl; + verr << "sum border halfedges (2*nb) = " << 2 * nb << " vs " << num_h << std::endl; verr << "Face Graph Structure is NOT VALID." << std::endl; return false; } - valid = (f == num_f); - if(!valid) - verr << "counting faces failed." << std::endl; - - verr << "Face Graph Structure is " << (valid ? "valid." : "NOT VALID.") << std::endl; + verr << "Face Graph Structure is valid" << std::endl; return valid; } /*! \ingroup PkgBGLHelperFct - * \brief checks the integrity of `g`. + * \brief checks the integrity of the mesh `g`. * - * `g` is valid if it is a valid `FaceListGraph` and it has distinct faces on each side of an edge. - * calls `is_valid_face_graph()`. + * The mesh `g` is a valid polygon mesh if it is a valid face graph and if it follows the rules + * defined in \ref PMPDef "PolygonMesh". * - * \param g the `Mesh` to test. - * \param verb : if `true`, the details of the check will be written in the standard output. + * \param g the `Mesh` to test + * \param verb if `true`, the details of the check will be written in the standard output * - * \tparam Mesh a model of `FaceListGraph` and `HalfedgeListGraph`, and follows - * the definition of a \ref PMPDef "PolygonMesh" + * \tparam Mesh a model of `FaceListGraph` and `HalfedgeListGraph` * \return `true` if `g` is valid, `false` otherwise. * * \see `is_valid_face_graph()` @@ -700,15 +563,246 @@ bool is_valid_polygon_mesh(const Mesh& g, bool verb = false) return true; } + /*! + \ingroup PkgBGLHelperFct + returns `true` if there are no border edges. + */ +template +bool is_closed(const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(halfedge_descriptor hd : halfedges(g)){ + if(is_border(hd,g)){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if the target of `hd` has exactly two incident edges. + */ +template +bool is_bivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == opposite(next(opposite(next(hd,g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all vertices have exactly two incident edges. + */ +template +bool is_bivalent_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(vertex_descriptor vd : vertices(g)){ + halfedge_descriptor hd = halfedge(vd,g); + if((hd == boost::graph_traits::null_halfedge()) || + (! is_bivalent(hd,g))){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if the target of `hd` has exactly three incident edges. + */ +template +bool is_trivalent(typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == opposite(next(opposite(next(opposite(next(hd,g),g),g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all + vertices have exactly three incident edges. + */ +template +bool is_trivalent_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + for(vertex_descriptor vd : vertices(g)){ + halfedge_descriptor hd = halfedge(vd,g); + if((hd == boost::graph_traits::null_halfedge()) || + (! is_trivalent(halfedge(hd,g),g))){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a triangle. + \pre `g` must be valid. + */ +template +bool is_isolated_triangle(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor beg = hd; + if(is_border(hd,g)) return false; + for(int i=0; i<3;i++){ + if(! is_border(opposite(hd,g),g)) return false; + hd = next(hd,g); + } + return hd == beg; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the face denoted by `hd` is a triangle, that is it has three incident halfedges. + */ +template +bool is_triangle(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == next(next(next(hd,g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all faces are triangles. + */ +template +bool is_triangle_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + for(face_descriptor fd : faces(g)){ + if(! is_triangle(halfedge(fd,g),g)){ + return false; + } + } + return true; +} + +/*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a quadrilateral. + */ +template +bool is_isolated_quad(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor beg = hd; + if(is_border(hd,g)) return false; + for(int i=0; i<4;i++){ + if(! is_border(opposite(hd,g),g)) return false; + hd = next(hd,g); + } + return hd == beg; +} + + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the face denoted by `hd` is a quad, that is it has four incident halfedges. + */ +template +bool is_quad(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + return hd == next(next(next(next(hd,g),g),g),g); +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` if all faces are quadrilaterals. + */ +template +bool is_quad_mesh(const FaceGraph& g) +{ + typedef typename boost::graph_traits::face_descriptor face_descriptor; + + for(face_descriptor fd : faces(g)){ + if(! is_quad(halfedge(fd,g),g)){ + return false; + } + } + return true; +} + + /*! + \ingroup PkgBGLHelperFct + returns `true` iff the connected component denoted by `hd` is a tetrahedron. + */ +template +bool is_tetrahedron(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + + halfedge_descriptor h1 = hd; + if(is_border(h1,g)) return false; + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + halfedge_descriptor h2 = next(h1,g); + halfedge_descriptor h3 = next(h2,g); + halfedge_descriptor h4 = next(opposite(h1,g),g ); + halfedge_descriptor h5 = next(opposite(h2,g),g ); + halfedge_descriptor h6 = next(opposite(h3,g),g ); + // check halfedge combinatorics. + // at least three edges at vertices 1, 2, 3. + if ( h4 == opposite(h3,g) ) return false; + if ( h5 == opposite(h1,g) ) return false; + if ( h6 == opposite(h2,g) ) return false; + // exact three edges at vertices 1, 2, 3. + if ( next(opposite(h4,g),g) != opposite(h3,g) ) return false; + if ( next(opposite(h5,g),g) != opposite(h1,g) ) return false; + if ( next(opposite(h6,g),g) != opposite(h2,g) ) return false; + // three edges at v4. + if ( opposite(next(h4,g),g) != h5 ) return false; + if ( opposite(next(h5,g),g) != h6 ) return false; + if ( opposite(next(h6,g),g) != h4 ) return false; + // All facets are triangles. + if ( next(next(next(h1,g),g),g) != h1 ) return false; + if ( next(next(next(h4,g),g),g) != h4 ) return false; + if ( next(next(next(h5,g),g),g) != h5 ) return false; + if ( next(next(next(h6,g),g),g) != h6 ) return false; + // all edges are non-border edges. + if ( is_border(h1,g) ) return false; // implies h2 and h3 + if ( is_border(h4,g) ) return false; + if ( is_border(h5,g) ) return false; + if ( is_border(h6,g) ) return false; + return true; +} + /*! \ingroup PkgBGLHelperFct returns `true` iff the connected component denoted by `hd` is a hexahedron. */ template -bool is_hexahedron( typename boost::graph_traits::halfedge_descriptor hd, const FaceGraph& g) +bool is_hexahedron(typename boost::graph_traits::halfedge_descriptor hd, + const FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(hd, g)); + halfedge_descriptor h1 = hd; if(is_border(h1,g)) return false; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; @@ -763,13 +857,14 @@ clear_impl(FaceGraph& g) } template -void swap_vertices( - typename boost::graph_traits::vertex_descriptor& p, - typename boost::graph_traits::vertex_descriptor& q, - FaceGraph& g) +void swap_vertices(typename boost::graph_traits::vertex_descriptor& p, + typename boost::graph_traits::vertex_descriptor& q, + FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_vertex_descriptor(p, g) && is_valid_vertex_descriptor(q, g)); + halfedge_descriptor hq=halfedge(q, g); halfedge_descriptor hp=halfedge(p, g); for(halfedge_descriptor h : halfedges_around_target(hq, g)) @@ -781,14 +876,16 @@ void swap_vertices( } template -void swap_edges( - const typename boost::graph_traits::halfedge_descriptor& h1, - const typename boost::graph_traits::halfedge_descriptor& h2, - FaceGraph& g) +void swap_edges(const typename boost::graph_traits::halfedge_descriptor& h1, + const typename boost::graph_traits::halfedge_descriptor& h2, + FaceGraph& g) { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + + CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g)); + const halfedge_descriptor oh1 = opposite(h1, g), oh2 = opposite(h2, g); // backup vertex pointers @@ -918,6 +1015,8 @@ int vertex_index_in_face(const typename boost::graph_traits::vertex_descr { typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_vertex_descriptor(vd, g) && is_valid_face_descriptor(fd, g)); + halfedge_descriptor start = halfedge(fd, g); halfedge_descriptor current = start; int counter = 0; @@ -958,7 +1057,7 @@ int halfedge_index_in_face(typename boost::graph_traits::halfedge_descrip typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; - CGAL_precondition(he != boost::graph_traits::null_halfedge()); + CGAL_precondition(is_valid_halfedge_descriptor(he, g)); CGAL_precondition(!is_border(he, g)); face_descriptor f = face(he, g); diff --git a/BGL/include/CGAL/boost/graph/internal/helpers.h b/BGL/include/CGAL/boost/graph/internal/helpers.h index ec6b47baf83..4da0e59a63c 100644 --- a/BGL/include/CGAL/boost/graph/internal/helpers.h +++ b/BGL/include/CGAL/boost/graph/internal/helpers.h @@ -11,14 +11,15 @@ #ifndef CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H #define CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H -#include -#include #include #include #include #include + #include +#include + namespace CGAL { // breaks a dependency loop between @@ -133,7 +134,7 @@ std::size_t exact_num_vertices(const Graph& g) { typename boost::graph_traits::vertex_iterator beg, end; - boost::tie(beg,end) = vertices(g); + std::tie(beg,end) = vertices(g); return std::distance(beg,end); } @@ -142,7 +143,7 @@ std::size_t exact_num_halfedges(const Graph& g) { typename boost::graph_traits::halfedge_iterator beg, end; - boost::tie(beg,end) = halfedges(g); + std::tie(beg,end) = halfedges(g); return std::distance(beg,end); } @@ -151,7 +152,7 @@ std::size_t exact_num_edges(const Graph& g) { typename boost::graph_traits::edge_iterator beg, end; - boost::tie(beg,end) = edges(g); + std::tie(beg,end) = edges(g); return std::distance(beg,end); } @@ -160,14 +161,14 @@ std::size_t exact_num_faces(const Graph& g) { typename boost::graph_traits::face_iterator beg, end; - boost::tie(beg,end) = faces(g); + std::tie(beg,end) = faces(g); return std::distance(beg,end); } template bool is_isolated(typename boost::graph_traits::vertex_descriptor v, - Graph& g) + const Graph& g) { return halfedge(v, g) == boost::graph_traits::null_halfedge(); } diff --git a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h index 35b49cf33eb..0740602e64f 100644 --- a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h +++ b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h @@ -202,7 +202,7 @@ public: : sm_(pm.sm_) {} - reference operator[](key_type v) + reference operator[](key_type v) const { #if defined(CGAL_USE_OM_POINTS) return sm_->point(v); diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index 2604e4cf223..46f36e27839 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -207,13 +207,11 @@ struct Regularization_graph prevent_unselection (prevent_unselection) { labels.reserve(num_faces(fg)); - std::size_t nb_selected = 0; for (fg_face_descriptor fd : faces(fg)) { if (get(is_selected_map,fd)) { labels.push_back(1); - ++ nb_selected; } else labels.push_back(0); @@ -486,7 +484,7 @@ reduce_face_selection( \cgalParamNEnd \cgalParamNBegin{prevent_unselection} - \cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrinked.} + \cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrunk.} \cgalParamType{`bool`} \cgalParamDefault{`false`} \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} @@ -545,7 +543,7 @@ regularize_face_selection_borders( (face_index_map)); for (mesh_face_descriptor fd : faces(mesh)) - put(is_selected, fd, graph.labels[get(face_index_map,fd)]); + put(is_selected, fd, (graph.labels[get(face_index_map,fd)] != 0)); } /// \cond SKIP_IN_MANUAL diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h deleted file mode 100644 index 14ab09b0474..00000000000 --- a/BGL/include/CGAL/boost/parameter.h +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) 2014 GeometryFactory (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Andreas Fabri - -#ifndef CGAL_BOOST_PARAMETER_H -#define CGAL_BOOST_PARAMETER_H - -#include - - -#ifdef BOOST_PARAMETER_MAX_ARITY -# if (BOOST_PARAMETER_MAX_ARITY < 12) -# error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" -# endif -#else -# define BOOST_PARAMETER_MAX_ARITY 12 -#endif - -#include - -#if defined(__clang__) || defined(BOOST_GCC) -# define CGAL_IGNORE_UNUSED_VARIABLES \ - _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \ - _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") -#else -# define CGAL_IGNORE_UNUSED_VARIABLES -#endif -#if __has_warning("-Wunneeded-internal-declaration") -# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION \ - _Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"") -#else -# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION -#endif - -#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \ - CGAL_IGNORE_UNUSED_VARIABLES \ - CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION - - -namespace CGAL -{ -namespace parameters -{ - -template -struct Base -{ - Base(T t) : t_(t) {} - T operator()() const { return t_; } -private: - T t_; -}; - -#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ - struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Class function_true() { return Class(true); } \ - inline Class function_false() { return Class(false); } - -#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \ - struct Class : public Base \ - { Class(double d) : Base(d) { precondition(d); } }; \ - inline Class function(double d) { return Class(d); } - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_NAME( c3t3 ) -BOOST_PARAMETER_NAME( domain ) -BOOST_PARAMETER_NAME( criteria ) -BOOST_PARAMETER_NAME( cdt ) - -BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_) -BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_) -BOOST_PARAMETER_NAME( (mark, tag) mark_) - -BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) -BOOST_PARAMETER_NAME( (convergence, tag) convergence_) -BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) -BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) - -BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) -BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) -BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) -BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) - -BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) - -BOOST_PARAMETER_NAME( (dump_after_init_prefix, tag ) dump_after_init_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_surface_prefix, tag ) dump_after_refine_surface_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_prefix, tag ) dump_after_refine_prefix_) -BOOST_PARAMETER_NAME( (dump_after_glob_opt_prefix, tag ) dump_after_glob_opt_prefix_) -BOOST_PARAMETER_NAME( (dump_after_perturb_prefix, tag ) dump_after_perturb_prefix_) -BOOST_PARAMETER_NAME( (dump_after_exude_prefix, tag ) dump_after_exude_prefix_) -BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_) -BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_) -BOOST_PARAMETER_NAME( (nonlinear_growth_of_balls, tag ) nonlinear_growth_of_balls_) -BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_) -BOOST_PARAMETER_NAME( (pointer_to_stop_atomic_boolean, tag ) pointer_to_stop_atomic_boolean_) - -// First used in -BOOST_PARAMETER_NAME( (function, tag ) function_) -BOOST_PARAMETER_NAME( (bounding_object, tag ) bounding_object_) -BOOST_PARAMETER_NAME( (relative_error_bound, tag ) relative_error_bound_) -BOOST_PARAMETER_NAME( (weights, tag) weights_) -BOOST_PARAMETER_NAME( (p_rng, tag ) p_rng_) -BOOST_PARAMETER_NAME( (null_subdomain_index, tag ) null_subdomain_index_) -BOOST_PARAMETER_NAME( (construct_surface_patch_index, tag ) construct_surface_patch_index_) - -// First used in -BOOST_PARAMETER_NAME( (image, tag ) image_) -BOOST_PARAMETER_NAME( (iso_value, tag) iso_value_) -BOOST_PARAMETER_NAME( (value_outside, tag) value_outside_) -BOOST_PARAMETER_NAME( (image_values_to_subdomain_indices, tag ) image_values_to_subdomain_indices_) - -CGAL_PRAGMA_DIAG_POP -} // parameters -} // CGAL - - -#endif // CGAL_BOOST_PARAMETER_H diff --git a/BGL/test/BGL/test_test_face.cpp b/BGL/test/BGL/test_test_face.cpp index e69f7e3176e..aa4e0fa0879 100644 --- a/BGL/test/BGL/test_test_face.cpp +++ b/BGL/test/BGL/test_test_face.cpp @@ -23,9 +23,9 @@ int main() vertex_descriptor vs = CGAL::add_vertex(sm); std::array face0; assert( ! CGAL::Euler::can_add_face(face0,sm) ); - std::array face1; + std::array face1 = { vp }; assert( ! CGAL::Euler::can_add_face(face1,sm) ); - std::array face2; + std::array face2 = { vp, vq }; assert( ! CGAL::Euler::can_add_face(face2,sm) ); std::array face = { vp, vq, vr }; @@ -56,5 +56,7 @@ int main() assert( ! CGAL::Euler::can_add_face(face,sm) ); } + std::cout << "Done" << std::endl; + return 0; } diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index 95f907fbb10..7708fc685df 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -project(Barycentric_coordinates_2_Examples) - cmake_minimum_required(VERSION 3.1...3.23) +project(Barycentric_coordinates_2_Examples) + find_package(CGAL REQUIRED COMPONENTS Core) create_single_source_cgal_program("segment_coordinates.cpp") diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index e147d8f5dae..d1dcba597f7 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_cmake_script. # This is the CMake script for compiling a CGAL application. -project(Barycentric_coordinates_2_Tests) - cmake_minimum_required(VERSION 3.1...3.23) +project(Barycentric_coordinates_2_Tests) + find_package(CGAL REQUIRED COMPONENTS Core) create_single_source_cgal_program("test_almost_degenerate_segment.cpp") diff --git a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h index d986acfd860..d1c2305c2dd 100644 --- a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h @@ -58,7 +58,7 @@ public: {} /*! Constructor with traits object. */ - Polygon_set_2 (Traits_2& tr) : + Polygon_set_2 (const Traits_2& tr) : Base(tr) {} diff --git a/Boolean_set_operations_2/include/CGAL/connect_holes.h b/Boolean_set_operations_2/include/CGAL/connect_holes.h index f4e293418bd..a7067650459 100644 --- a/Boolean_set_operations_2/include/CGAL/connect_holes.h +++ b/Boolean_set_operations_2/include/CGAL/connect_holes.h @@ -432,7 +432,7 @@ OutputIterator connect_holes(const Polygon_with_holes_2target() to keep looking for a hole that hasn't been traversed. we do not insert the target to the output set to avoid duplication with cases 2 and 3*/ diff --git a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt index 6fa63e9c60d..7ec2b717b7b 100644 --- a/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt +++ b/Bounding_volumes/doc/Bounding_volumes/PackageDescription.txt @@ -20,12 +20,6 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. \cgalClassifedRefPages @@ -62,4 +56,3 @@ checking off, cf. Section \ref secchecks. - `CGAL::Min_sphere_of_spheres_d` - `MinSphereOfSpheresTraits` */ - diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h index b60bf8d9491..4eef8eeab66 100644 --- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h +++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h @@ -12,7 +12,7 @@ // Note: whenever a comment refers to "Khachiyan's paper" then the // paper "Rounding of polytopes in the real number model of -// computation" is ment (Mathematics of Operations Research, Vol. 21, +// computation" is meant (Mathematics of Operations Research, Vol. 21, // No. 2, May 1996). Nontheless, most comments refer to the // accompanying documentation sheet (and not to the above paper), see // the file(s) in documentation/. @@ -85,7 +85,7 @@ namespace CGAL { // // Notice that (at almost all places in this code) whenever a // point "p" is mentioned in a comment then the embedded point is - // ment in case (ii). + // meant in case (ii). const int d_P; // dimension of the input points const int d; // dimension of the ambient space 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 b27264bc8e7..982787228d5 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 @@ -12,7 +12,7 @@ // Note: whenever a comment refers to "Khachiyan's paper" then the // paper "Rounding of polytopes in the real number model of -// computation" is ment (Mathematics of Operations Research, Vol. 21, +// computation" is meant (Mathematics of Operations Research, Vol. 21, // No. 2, May 1996). Nontheless, most comments refer to the // accompanying documentation sheet (and not to the above paper), see // the file(s) in documentation/. diff --git a/Bounding_volumes/include/CGAL/Min_annulus_d.h b/Bounding_volumes/include/CGAL/Min_annulus_d.h index 8dae7e73d26..eb7435ef1f8 100644 --- a/Bounding_volumes/include/CGAL/Min_annulus_d.h +++ b/Bounding_volumes/include/CGAL/Min_annulus_d.h @@ -325,7 +325,7 @@ public: Support_point_iterator support_points_begin() const { - CGAL_optimisation_assertion_msg(number_of_points() >= 2, + CGAL_assertion_msg(number_of_points() >= 2, "support_points_begin: not enough points"); return Support_point_iterator( solver->basic_original_variable_indices_begin(), @@ -334,7 +334,7 @@ public: Support_point_iterator support_points_end() const { - CGAL_optimisation_assertion_msg(number_of_points() >= 2, + CGAL_assertion_msg(number_of_points() >= 2, "support_points_begin: not enough points"); return Support_point_iterator( solver->basic_original_variable_indices_end(), @@ -401,27 +401,27 @@ public: // NOTE: an implicit conversion from ET to RT must be available! Point center( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return tco.construct_point_d_object()( ambient_dimension(), center_coordinates_begin(), center_coordinates_end()); } FT squared_inner_radius( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return FT( squared_inner_radius_numerator()) / FT( squared_radii_denominator()); } FT squared_outer_radius( ) const - { CGAL_optimisation_precondition( ! is_empty()); + { CGAL_precondition( ! is_empty()); return FT( squared_outer_radius_numerator()) / FT( squared_radii_denominator()); } // predicates CGAL::Bounded_side bounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -431,7 +431,7 @@ public: bool has_on_bounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -440,7 +440,7 @@ public: bool has_on_boundary( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d]; @@ -449,7 +449,7 @@ public: bool has_on_unbounded_side( const Point& p) const - { CGAL_optimisation_precondition( + { CGAL_precondition( is_empty() || tco.access_dimension_d_object()( p) == d); ET sqr_d = sqr_dist( p); ET h_p_sqr(da_coord(p)[d]); @@ -468,14 +468,14 @@ public: { if ( points.size() > 0) points.erase( points.begin(), points.end()); std::copy( first, last, std::back_inserter( points)); set_dimension(); - CGAL_optimisation_precondition_msg( check_dimension(), + CGAL_precondition_msg( check_dimension(), "Not all points have the same dimension."); compute_min_annulus(); } void insert( const Point& p) { if ( is_empty()) d = tco.access_dimension_d_object()( p); - CGAL_optimisation_precondition( + CGAL_precondition( tco.access_dimension_d_object()( p) == d); points.push_back( p); compute_min_annulus(); } @@ -483,10 +483,10 @@ public: template < class InputIterator > void insert( InputIterator first, InputIterator last) - { CGAL_optimisation_precondition_code( std::size_t old_n = points.size()); + { CGAL_precondition_code( std::size_t old_n = points.size()); points.insert( points.end(), first, last); set_dimension(); - CGAL_optimisation_precondition_msg( check_dimension( old_n), + CGAL_precondition_msg( check_dimension( old_n), "Not all points have the same dimension."); compute_min_annulus(); } @@ -645,7 +645,7 @@ private: options.set_pricing_strategy(pricing_strategy(NT())); delete solver; solver = new Solver(lp, options); - CGAL_optimisation_assertion(solver->status() == QP_OPTIMAL); + CGAL_assertion(solver->status() == QP_OPTIMAL); // compute center and squared radius ET sqr_sum = 0; @@ -829,7 +829,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -858,7 +858,7 @@ operator >> ( std::istream& is, CGAL::Min_annulus_d& min_annulus) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_circle_2.h b/Bounding_volumes/include/CGAL/Min_circle_2.h index 759eb9195ef..ee36071ce21 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2.h @@ -191,7 +191,7 @@ class Min_circle_2 { const Point& support_point( std::size_t i) const { - CGAL_optimisation_precondition(i < number_of_support_points()); + CGAL_precondition(i < number_of_support_points()); return( support_points[ i]); } // circle @@ -256,7 +256,7 @@ class Min_circle_2 { tco.circle.set( ); break; default: - CGAL_optimisation_assertion( n_support_points <= 3 ); } + CGAL_assertion( n_support_points <= 3 ); } } void @@ -334,7 +334,7 @@ class Min_circle_2 { // initialize circle tco.circle.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } // constructor for one point @@ -349,7 +349,7 @@ class Min_circle_2 { support_points[ 0] = p; tco.circle.set( p); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for two points diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h index 47d93bb8288..5121c02919c 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h @@ -293,7 +293,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -323,7 +323,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h index 43b90b757d0..cc5bbbf4164 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h @@ -332,7 +332,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -363,7 +363,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } 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 ccb2d79af91..114a59a297a 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 @@ -60,7 +60,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_circle_2& min_circle) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); 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 33cf439dd26..f2e94333b61 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 @@ -11,7 +11,7 @@ // Author(s) : Sven Schoenherr , Bernd Gaertner // includes -# include +# include namespace CGAL { @@ -42,7 +42,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_circle_2& c) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -79,7 +79,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2& c) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( is) invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2.h index 3421a2de847..b8b35130a50 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2.h @@ -203,7 +203,7 @@ class Min_ellipse_2 { const Point& support_point( std::size_t i) const { - CGAL_optimisation_precondition(i < number_of_support_points()); + CGAL_precondition(i < number_of_support_points()); return( support_points[ i]); } // ellipse @@ -281,7 +281,7 @@ class Min_ellipse_2 { tco.ellipse.set( ); break; default: - CGAL_optimisation_assertion( ( n_support_points >= 0) && + CGAL_assertion( ( n_support_points >= 0) && ( n_support_points <= 5) ); } } @@ -360,7 +360,7 @@ class Min_ellipse_2 { // initialize ellipse tco.ellipse.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } inline @@ -373,7 +373,7 @@ class Min_ellipse_2 { // initialize ellipse tco.ellipse.set(); - CGAL_optimisation_postcondition( is_empty()); + CGAL_postcondition( is_empty()); } // constructor for one point @@ -388,7 +388,7 @@ class Min_ellipse_2 { support_points[ 0] = p; tco.ellipse.set( p); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for two points @@ -409,7 +409,7 @@ class Min_ellipse_2 { // compute me me( points.end(), 0); - CGAL_optimisation_postcondition( is_degenerate()); + CGAL_postcondition( is_degenerate()); } // constructor for three points diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h index e2fad6bc1bb..be22328dfb4 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h @@ -18,7 +18,7 @@ // includes # include -# include +# include namespace CGAL { @@ -235,7 +235,7 @@ class _Min_ellipse_2_adapterC2__Ellipse { int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -298,7 +298,7 @@ class _Min_ellipse_2_adapterC2__Ellipse { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -341,7 +341,7 @@ operator << ( std::ostream& os, case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -405,7 +405,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h index f971e915fc4..22c12492b8d 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h @@ -18,7 +18,7 @@ // includes # include -# include +# include namespace CGAL { @@ -243,7 +243,7 @@ class _Min_ellipse_2_adapterH2__Ellipse { int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -306,7 +306,7 @@ class _Min_ellipse_2_adapterH2__Ellipse { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -349,7 +349,7 @@ operator << ( std::ostream& os, case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -413,7 +413,7 @@ operator >> ( std::istream& is, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } 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 708c6644d9c..d7bd821350e 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 @@ -60,7 +60,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2& min_ellipse) break; default: - CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!"); + CGAL_assertion_msg( false, "CGAL::IO::mode invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h index ef343d86c91..54c72de0678 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include @@ -131,7 +131,7 @@ class Optimisation_ellipse_2 { set( const Point& p, const Point& q) { n_boundary_points = 2; - CGAL_optimisation_precondition(boundary_point1 == p); CGAL_USE(p); + CGAL_precondition(boundary_point1 == p); CGAL_USE(p); boundary_point2 = q; } @@ -139,20 +139,20 @@ class Optimisation_ellipse_2 { set( const Point& p1, const Point& p2, const Point& p3) { n_boundary_points = 3; - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); boundary_point3 = p3; helper_conic.set_ellipse( p1, p2, p3); - CGAL_optimisation_assertion(helper_conic.is_ellipse()); + CGAL_assertion(helper_conic.is_ellipse()); } void set( const Point& p1, const Point& p2, const Point& p3, const Point& p4) { n_boundary_points = 4; - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); - CGAL_optimisation_precondition(boundary_point3 == p3); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point3 == p3); boundary_point4 = p4; Conic::set_two_linepairs( p1, p2, p3, p4, conic1, conic2); @@ -195,7 +195,7 @@ class Optimisation_ellipse_2 { if (!helper_ellipse_set) { helper_ellipse.set_ellipse( conic1, conic2); helper_ellipse.analyse(); - CGAL_optimisation_assertion (helper_ellipse.is_ellipse()); + CGAL_assertion (helper_ellipse.is_ellipse()); helper_ellipse_set= true; } } @@ -211,14 +211,14 @@ class Optimisation_ellipse_2 { // In that case, helper_conic is already correct, // but in general, this optimization is NOT valid. n_boundary_points = 5; - CGAL_optimisation_assertion(helper_conic.is_ellipse()); + CGAL_assertion(helper_conic.is_ellipse()); // the following assertion is too strict if we run under // double (which is sometimes the case, e.g. in demos) - // CGAL_optimisation_assertion(helper_conic.has_on_boundary(p5)); - CGAL_optimisation_precondition(boundary_point1 == p1); - CGAL_optimisation_precondition(boundary_point2 == p2); - CGAL_optimisation_precondition(boundary_point3 == p3); - CGAL_optimisation_precondition(boundary_point4 == p4); + // CGAL_assertion(helper_conic.has_on_boundary(p5)); + CGAL_precondition(boundary_point1 == p1); + CGAL_precondition(boundary_point2 == p2); + CGAL_precondition(boundary_point3 == p3); + CGAL_precondition(boundary_point4 == p4); CGAL_USE(p1); CGAL_USE(p2); CGAL_USE(p3); CGAL_USE(p4); boundary_point5 = p5; } @@ -247,7 +247,7 @@ class Optimisation_ellipse_2 { double &u, double &v, double &w) const { // just like double_conic, but we only get the coefficients - CGAL_optimisation_precondition( ! is_degenerate()); + CGAL_precondition( ! is_degenerate()); if ( n_boundary_points == 4) { set_e_values(); @@ -297,7 +297,7 @@ class Optimisation_ellipse_2 { || ( ( conic1 == e.conic2) && ( conic2 == e.conic1))); default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5)); } // keeps g++ happy return( false); @@ -343,7 +343,7 @@ class Optimisation_ellipse_2 { helper_conic.vol_derivative( dr, ds, dt, du, dv, dw); return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); } // keeps g++ happy return( CGAL::Bounded_side( 0)); @@ -416,7 +416,7 @@ class Optimisation_ellipse_2 { return (CGAL::ZERO == (c.vol_derivative(dr, ds, dt, du, dv, dw))); } default: - CGAL_optimisation_assertion( ( n_boundary_points >= 0) && + CGAL_assertion( ( n_boundary_points >= 0) && ( n_boundary_points <= 5) ); return false; } 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 f2b1d2e8e87..4f94bbe4047 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 @@ -43,7 +43,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2& e) case CGAL::IO::BINARY: break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } @@ -106,7 +106,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( is) invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h b/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h index 9fd4c66ec0b..d3ad2595068 100644 --- a/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h +++ b/Bounding_volumes/include/CGAL/Min_quadrilateral_traits_2.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include #include @@ -303,36 +303,36 @@ public: if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p1; } tmpo = isec(line(r.p3, r.d1), line(r.p2, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p2; } tmpo = isec(line(r.p3, r.d1), line(r.p4, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p3; } tmpo = isec(line(r.p1, r.d1), line(r.p4, r.d2)); if (assign(tmp, tmpo)) { *o++ = tmp; } else { - CGAL_optimisation_assertion_code(bool test1 =) + CGAL_assertion_code(bool test1 =) assign(tmpl, tmpo); - CGAL_optimisation_assertion(test1); + CGAL_assertion(test1); *o++ = r.p3; } return o; diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d.h b/Bounding_volumes/include/CGAL/Min_sphere_d.h index 96d11c86368..e76b989b39a 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d.h @@ -26,7 +26,7 @@ # include -# include +# include # include @@ -110,7 +110,7 @@ public: #endif if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d)); + CGAL_precondition ((d>=0) && all_points_have_dim(d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } @@ -137,7 +137,7 @@ public: #endif if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d)); + CGAL_precondition ((d>=0) && all_points_have_dim(d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } @@ -211,13 +211,13 @@ public: Point center () const { - CGAL_optimisation_precondition (!is_empty()); + CGAL_precondition (!is_empty()); return ms_basis.get_sphere(Rep_tag()).center(); } FT squared_radius () const { - CGAL_optimisation_precondition (!is_empty()); + CGAL_precondition (!is_empty()); return ms_basis.get_sphere(Rep_tag()).squared_radius(); } @@ -227,7 +227,7 @@ public: if (d == -1) return ON_UNBOUNDED_SIDE; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (Bounded_side (-CGAL::sign (ms_basis.get_sphere(Rep_tag()).excess (p)))); @@ -239,7 +239,7 @@ public: if (d == -1) return false; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_negative (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -250,7 +250,7 @@ public: if (d == -1) return true; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_positive (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -261,7 +261,7 @@ public: if (d == -1) return false; else { - CGAL_optimisation_precondition + CGAL_precondition (d == tco.access_dimension_d_object()(p)); return (CGAL_NTS is_zero (ms_basis.get_sphere(Rep_tag()).excess (p))); } @@ -296,7 +296,7 @@ public: support_end = points.begin(); if (points.size()>0) { d = tco.access_dimension_d_object() (points.front()); - CGAL_optimisation_precondition ((d>=0) && all_points_have_dim (d)); + CGAL_precondition ((d>=0) && all_points_have_dim (d)); ms_basis.get_sphere(Rep_tag()).set_size (d); pivot_ms(); } else { @@ -310,7 +310,7 @@ public: if (has_on_unbounded_side (p)) { if (is_empty()) { d = tco.access_dimension_d_object() (p); - CGAL_optimisation_precondition (d>=0); + CGAL_precondition (d>=0); ms_basis.get_sphere(Rep_tag()).set_size (d); } // ensure precondition of pivot_ms 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 0415adbf47f..17231e575e4 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 @@ -62,7 +62,7 @@ operator << ( std::ostream& os, const Min_sphere_d& min_sphere) break; default: - CGAL_optimisation_assertion_msg + CGAL_assertion_msg ( false, "IO::get_mode( os) invalid!"); break; } @@ -93,7 +93,7 @@ operator >> ( std::istream& is, Min_sphere_d& min_sphere) } break; default: - CGAL_optimisation_assertion_msg( false, "IO::mode invalid!"); + CGAL_assertion_msg( false, "IO::mode invalid!"); break; } diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h b/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h index 02c554f9610..8e10f2b499c 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d/Optimisation_sphere_d.h @@ -42,7 +42,7 @@ class Optimisation_sphere_d; #include - #include + #include namespace CGAL { @@ -188,7 +188,7 @@ class Optimisation_sphere_d; // compute z FT z = FT_(2)*v_basis[m+1] - prod(v,x,m+1); - CGAL_optimisation_assertion (!CGAL_NTS is_zero (z)); + CGAL_assertion (!CGAL_NTS is_zero (z)); FT inv_z = FT_(1)/z; // set up A^{-1}_{B^m} @@ -461,7 +461,7 @@ class Optimisation_sphere_d; // compute \tilde{z} RT old_denom = denom[m-1]; RT z = old_denom*RT_(2)*sqr_q_m - prod(v,x,m+1); - CGAL_optimisation_assertion (!CGAL_NTS is_zero (z)); + CGAL_assertion (!CGAL_NTS is_zero (z)); // set up \tilde{A}^{-1}_{B^m} RT** M = inv[m-1]; // \tilde{A}^{-1}_B, old matrix @@ -503,7 +503,7 @@ class Optimisation_sphere_d; // get h_p RT h_p = *(i++); - CGAL_optimisation_precondition (!CGAL_NTS is_zero (h_p)); + CGAL_precondition (!CGAL_NTS is_zero (h_p)); // compute (h_p h D)^2 (c-p)^2 RT sqr_dist(RT(0)); diff --git a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h index c3dcc29c393..e30576790c5 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h @@ -42,7 +42,7 @@ namespace CGAL_MINIBALL_NAMESPACE { { // That constant is embedded in an inline static function, to // workaround a bug of g++>=4.1 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 // g++ does not like const floating expression when -frounding-math // is used. static double result() { @@ -55,7 +55,7 @@ namespace CGAL_MINIBALL_NAMESPACE { { // That constant is embedded in an inline static function, to // workaround a bug of g++>=4.1 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 // g++ does not like const floating expression when -frounding-math // is used. static float result() { @@ -68,7 +68,7 @@ namespace CGAL_MINIBALL_NAMESPACE { { // That constant is embedded in an inline static function, to // workaround a bug of g++>=4.1 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 // g++ does not like const floating expression when -frounding-math // is used. static double result() { @@ -81,7 +81,7 @@ namespace CGAL_MINIBALL_NAMESPACE { { // That constant is embedded in an inline static function, to // workaround a bug of g++>=4.1 - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36912 // g++ does not like const floating expression when -frounding-math // is used. static float result() { diff --git a/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h b/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h index bc93c75bf74..d096b37c88f 100644 --- a/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h +++ b/Bounding_volumes/include/CGAL/Rectangular_p_center_traits_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -228,21 +228,21 @@ struct Rectangular_p_center_matrix_search_traits_2 { bool operator()(FT v) { - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); ld.r = v / FT(2); bool ok; pf(ld, Wastebasket< Point_2 >(), ok); - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); return ok; } template < class OutputIterator > OutputIterator operator()(FT v, OutputIterator o, bool& ok) { - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); ld.r = v / FT(2); OutputIterator n = pf(ld, o, ok); - CGAL_optimisation_assertion(ld.size() == ld_size); + CGAL_assertion(ld.size() == ld_size); return n; //pf(ld, o, ok); } @@ -250,7 +250,7 @@ protected: // data members: LD ld; PiercingFunction pf; - CGAL_optimisation_assertion_code(typename LD::size_type ld_size;) + CGAL_assertion_code(typename LD::size_type ld_size;) // copying this would be too inefficient Rectangular_p_center_matrix_search_traits_2( diff --git a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h index dfa0eb1e30c..081520c0846 100644 --- a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h +++ b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include @@ -346,8 +346,8 @@ min_rectangle_2( { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition( orientation_2(f, l, t) == COUNTERCLOCKWISE); // check for trivial cases @@ -395,7 +395,7 @@ min_rectangle_2( int yet_to_finish = 0; for (int i1 = 0; i1 < 4; ++i1) { - CGAL_optimisation_assertion(limit[i1] != l); + CGAL_assertion(limit[i1] != l); if (curr[i1] != limit[i1]) ++yet_to_finish; } @@ -448,7 +448,7 @@ min_parallelogram_2(ForwardIterator f, { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition(is_convex_2(f, l, t)); // types from the traits class typedef typename Traits::Direction_2 Direction_2; @@ -630,7 +630,7 @@ min_strip_2(ForwardIterator f, { typedef Optimisation::Min_quadrilateral_traits_wrapper Traits; Traits t(bt); - CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t)); + CGAL_expensive_precondition(is_convex_2(f, l, t)); // types from the traits class typedef typename Traits::Direction_2 Direction_2; diff --git a/Bounding_volumes/include/CGAL/pierce_rectangles_2.h b/Bounding_volumes/include/CGAL/pierce_rectangles_2.h index ebaf8081e1c..8a7f3560a38 100644 --- a/Bounding_volumes/include/CGAL/pierce_rectangles_2.h +++ b/Bounding_volumes/include/CGAL/pierce_rectangles_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -75,7 +75,7 @@ struct Loc_domain { void update(int j, Citerator i) { - CGAL_optimisation_precondition(j >= 0 && j < 4); + CGAL_precondition(j >= 0 && j < 4); if (j < 2) if (j == 0) { if (traits.less_x_2_object()(*i, minx)) minx = *i; @@ -106,9 +106,9 @@ struct Loc_domain { maxy(pts.front()), traits(t) { - CGAL_optimisation_precondition(b != e); + CGAL_precondition(b != e); Iterator i = pts.begin(); - CGAL_optimisation_assertion(i != pts.end()); + CGAL_assertion(i != pts.end()); while (++i != pts.end()) { if (traits.less_x_2_object()(*i, minx)) minx = *i; if (traits.less_x_2_object()(maxx, *i)) maxx = *i; @@ -124,7 +124,7 @@ struct Loc_domain { operator[](int i) const // return corner points (0 <-> bottom-left, 1 <-> bottom-right) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i == 0) return traits.construct_point_2_above_right_implicit_point_2_object()( minx, miny, r); @@ -142,7 +142,7 @@ struct Loc_domain { extreme(int i) const // return extreme points (0 <-> left, 1 <-> bottom) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i > 1) return i == 2 ? maxx : maxy; return i == 0 ? minx : miny; } @@ -151,7 +151,7 @@ struct Loc_domain { extreme(int i) // return extreme points (0 <-> left, 1 <-> bottom) { - CGAL_optimisation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if (i > 1) return i == 2 ? maxx : maxy; return i == 0 ? minx : miny; } @@ -177,13 +177,13 @@ struct Loc_domain { void check() const { - CGAL_optimisation_expensive_assertion_code( + CGAL_expensive_assertion_code( Iterator i = pts.begin(); do { - CGAL_optimisation_assertion(!traits.less_x_2_object()(*i, minx)); - CGAL_optimisation_assertion(!traits.less_x_2_object()(maxx, *i)); - CGAL_optimisation_assertion(!traits.less_y_2_object()(*i, miny)); - CGAL_optimisation_assertion(!traits.less_y_2_object()(maxy, *i)); + CGAL_assertion(!traits.less_x_2_object()(*i, minx)); + CGAL_assertion(!traits.less_x_2_object()(maxx, *i)); + CGAL_assertion(!traits.less_y_2_object()(*i, miny)); + CGAL_assertion(!traits.less_y_2_object()(maxy, *i)); } while (++i != end); ) } @@ -463,7 +463,7 @@ inline OutputIterator two_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -475,7 +475,7 @@ inline OutputIterator three_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -487,7 +487,7 @@ inline OutputIterator four_cover_points( InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); // compute location domain: Loc_domain< Traits > d(f, l, t); @@ -562,7 +562,7 @@ three_cover_points( using std::less; using std::iter_swap; - CGAL_optimisation_precondition(!d.empty()); + CGAL_precondition(!d.empty()); // typedefs: typedef typename Traits::Point_2 Point_2; @@ -583,7 +583,7 @@ three_cover_points( // are all points already covered? if (i == d.end()) { - CGAL_optimisation_assertion(k == 0); + CGAL_assertion(k == 0); *o++ = d[0]; ok = true; return o; @@ -620,11 +620,11 @@ three_cover_points( // check disjoint for two-pierceability: - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( save_end == find_if(d.end(), save_end, [&d, &dist, &corner](const Point_2& p) { return d.r < dist(corner, p); })); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( d.end() == find_if(d.begin(), d.end(), [&d,&dist, &corner](const Point_2& p) { return d.r >= dist(corner, p); })); @@ -721,7 +721,7 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok) // are all points already covered? if (i == d.end()) { - CGAL_optimisation_assertion(k == 0); + CGAL_assertion(k == 0); *o++ = d[0]; ok = true; return o; @@ -758,11 +758,11 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok) // check disjoint for two-pierceability: - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( save_end == find_if(d.end(), save_end, [&d,&dist,&corner](const Point_2& p) { return d.r < dist(corner, p); })); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( d.end() == find_if(d.begin(), d.end(), [&d,&dist,&corner](const Point_2& p) { return d.r >= dist(corner, p); })); diff --git a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h index cd3a1f14bee..a75118764b7 100644 --- a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h +++ b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include #include @@ -965,7 +965,7 @@ rectangular_3_center_2_type2( (Q_r_empty || op.compute_y_distance(q_r, Q_r) <= op.delta()(*m))) { boost::function1 greater_delta_m = boost::bind(less< FT >(), op.delta()(*m)); - CGAL_optimisation_assertion_code(RandomAccessIterator iii =) + CGAL_assertion_code(RandomAccessIterator iii =) find_if(e, l, boost::bind(logical_and< bool >(), @@ -973,7 +973,7 @@ rectangular_3_center_2_type2( boost::bind(op.distance(), q_t, _1)), boost::bind(greater_delta_m, boost::bind(op.distance(), q_r, _1)))); - CGAL_optimisation_assertion(iii == l); + CGAL_assertion(iii == l); } // check whether the points in [f,s) are covered { @@ -985,7 +985,7 @@ rectangular_3_center_2_type2( boost::bind(le_delta_m, boost::bind(op.distance(), q_t, _1))); iii = partition(iii, s, boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1))); - CGAL_optimisation_assertion(iii == s); + CGAL_assertion(iii == s); } #endif // CGAL_3COVER_CHECK @@ -1052,7 +1052,7 @@ rectangular_3_center_2_type2( } // step (e) [not enough points in G] - CGAL_optimisation_assertion(b1 - (m + 1) >= 5 * cutoff); + CGAL_assertion(b1 - (m + 1) >= 5 * cutoff); // compute the four cutting lines for R std::nth_element(m + 1, m + 1 + cutoff, b1, less_x_2); @@ -1113,7 +1113,7 @@ rectangular_3_center_2_type2( // now s_b corresponds to the first moment in [s, m+1) // where q_t and q_r cover B - CGAL_optimisation_assertion_code(bool loopcheck = false;) + CGAL_assertion_code(bool loopcheck = false;) CGAL_3CENTER_REPEAT_CHECK: // place q_t and q_r q_t = op.place_x_square(q_t_afap, r, op.delta()(*s_b)); @@ -1142,9 +1142,9 @@ CGAL_3CENTER_REPEAT_CHECK: // in degenerate situations it can happen that the number of // points in R is too small => decrease radius and check again --s_b; - CGAL_optimisation_assertion(!loopcheck); - CGAL_optimisation_assertion(s != s_b); - CGAL_optimisation_assertion_code(loopcheck = true;) + CGAL_assertion(!loopcheck); + CGAL_assertion(s != s_b); + CGAL_assertion_code(loopcheck = true;) goto CGAL_3CENTER_REPEAT_CHECK; } s = b1; @@ -1166,7 +1166,7 @@ CGAL_3CENTER_REPEAT_CHECK: // we still have a covering if (s_b == s) { - CGAL_optimisation_expensive_assertion_code( + CGAL_expensive_assertion_code( std::vector< Point > tmppts(f, l); RandomAccessIterator ii = partition(tmppts.begin(), tmppts.end(), @@ -1174,9 +1174,9 @@ CGAL_3CENTER_REPEAT_CHECK: IP tmppos = min_max_element(ii, tmppts.end(), op.compare_x(), op.compare_y()); ) - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( !op.compare_x()(*tmppos.first, q_t)); - CGAL_optimisation_expensive_assertion( + CGAL_expensive_assertion( !op.compare_y()(q_r, *tmppos.second)); // we are done @@ -1219,7 +1219,7 @@ CGAL_3CENTER_REPEAT_CHECK: [&op, s_b](const Point& p){ return op.delta()(*s_b) != op.delta()(p); }); rho_max = op.delta()(*s_b); q_t_at_rho_max = q_t, q_r_at_rho_max = q_r; - CGAL_optimisation_assertion(op.delta()(*next) < op.delta()(*s_b)); + CGAL_assertion(op.delta()(*next) < op.delta()(*s_b)); q_t_afap = op.update_x_square(q_t_afap, *s_b); q_r_afap = op.update_y_square(q_r_afap, *s_b); q_t = op.place_x_square(q_t_afap, r, op.delta()(*next)); @@ -1255,7 +1255,7 @@ CGAL_3CENTER_REPEAT_CHECK: } - CGAL_optimisation_assertion(b3 - b1 >= cutoff); + CGAL_assertion(b3 - b1 >= cutoff); e = b1; // adjust Q_t if (b1 != b2) { @@ -1299,7 +1299,7 @@ CGAL_3CENTER_REPEAT_CHECK: rho_max = max BOOST_PREVENT_MACRO_SUBSTITUTION (op.compute_x_distance(q_t, Q_t), op.compute_y_distance(q_r, Q_r)); #ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST - CGAL_optimisation_assertion(rho_max <= rad); + CGAL_assertion(rho_max <= rad); #endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST rad = rho_max; *o++ = op.construct_corner_square(r, rad / FT(2)); @@ -1307,7 +1307,7 @@ CGAL_3CENTER_REPEAT_CHECK: *o++ = op.construct_y_square(q_r, rad / FT(2)); return o; } - CGAL_optimisation_assertion(s != e); + CGAL_assertion(s != e); // find the first diameter where covering is possible for (;;) { @@ -1324,7 +1324,7 @@ CGAL_3CENTER_REPEAT_CHECK: // try the next possible diameter value FT try_rho = op.delta()(*t); - CGAL_optimisation_assertion(t == s || try_rho < rho_max); + CGAL_assertion(t == s || try_rho < rho_max); q_t = op.place_x_square(q_t_afap, r, try_rho); q_r = op.place_y_square(q_r_afap, r, try_rho); @@ -1370,8 +1370,8 @@ CGAL_3CENTER_REPEAT_CHECK: // - q_r_at_rho_max is the corr. position of q_r. // try rho_min - CGAL_optimisation_assertion(rho_min <= rho_max); - CGAL_optimisation_assertion(rho_min >= 0); + CGAL_assertion(rho_min <= rho_max); + CGAL_assertion(rho_min >= 0); FT rad_2 = q_t_q_r_cover_at_rho_min; if (s_at_rho_min != e_at_rho_min) { auto mydist = [&q_t_at_rho_min, &q_r_at_rho_min, &op](const Point& p) @@ -1384,7 +1384,7 @@ CGAL_3CENTER_REPEAT_CHECK: [&mydist](const Point& p1, const Point& p2) { return mydist(p1) < mydist(p2); }))); } - CGAL_optimisation_assertion(rad_2 == 0 || rad_2 > rho_min); + CGAL_assertion(rad_2 == 0 || rad_2 > rho_min); // if a covering with rho == 0 is possible, // it will be catched in the type1 functions @@ -1397,7 +1397,7 @@ CGAL_3CENTER_REPEAT_CHECK: q_t = q_t_at_rho_min, q_r = q_r_at_rho_min; #ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST - CGAL_optimisation_assertion(rad_2 <= rad); + CGAL_assertion(rad_2 <= rad); #endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST rad = rad_2; *o++ = op.construct_corner_square(r, rad / FT(2)); @@ -1414,7 +1414,7 @@ rectangular_3_center_2( typename Traits::FT& r, Traits& t) { - CGAL_optimisation_precondition(f != l); + CGAL_precondition(f != l); typedef typename Traits::FT FT; typedef typename Traits::Point_2 Point; typedef typename Traits::Iso_rectangle_2 Rectangle; diff --git a/Bounding_volumes/include/CGAL/rectangular_p_center_2.h b/Bounding_volumes/include/CGAL/rectangular_p_center_2.h index 1d680e9572f..78ec4b6e9cb 100644 --- a/Bounding_volumes/include/CGAL/rectangular_p_center_2.h +++ b/Bounding_volumes/include/CGAL/rectangular_p_center_2.h @@ -72,8 +72,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition( c >= 0 && c < number_of_columns()); + CGAL_precondition( r >= 0 && r < number_of_rows()); + CGAL_precondition( c >= 0 && c < number_of_columns()); return Base::operator()( r, number_of_columns() - 1 - c); } }; @@ -145,7 +145,7 @@ rectangular_p_center_2_binary_search( // -------------- // { - CGAL_optimisation_precondition( f != l); + CGAL_precondition( f != l); // typedefs: typedef typename Traits::FT FT; @@ -171,7 +171,7 @@ rectangular_p_center_2_binary_search( c_diffs.push_back( CGAL_NTS abs( i->x() - j->x())); c_diffs.push_back( CGAL_NTS abs( i->y() - j->y())); } - CGAL_optimisation_assertion( + CGAL_assertion( c_diffs.size() == pierce_it.number_of_points() * (pierce_it.number_of_points() - 1)); @@ -195,12 +195,12 @@ rectangular_p_center_2_binary_search( b = c + 1; } } // while ( e > b) - CGAL_optimisation_assertion( e == b); + CGAL_assertion( e == b); // return the result: r = c_diffs[e]; OutputIterator o_return( pierce_it( r, o, ok)); - CGAL_optimisation_assertion( ok); + CGAL_assertion( ok); return o_return; } // rectangular_p_center_2_binary_search( ... ) @@ -221,7 +221,7 @@ rectangular_p_center_2_matrix_search( const MatrixOperator& mop) { std::size_t number_of_points( iterator_distance( f, l)); - CGAL_optimisation_precondition( number_of_points > 0); + CGAL_precondition( number_of_points > 0); using std::minus; using std::sort; @@ -296,7 +296,7 @@ rectangular_p_center_2_matrix_search( // return result: OutputIterator o_return(pierce_it(r, o, ok)); - CGAL_optimisation_assertion(ok); + CGAL_assertion(ok); return o_return; } // P_center_matrix_search @@ -341,7 +341,7 @@ rectangular_p_center_matrix_search_2( FT& r, int p) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); typename std::iterator_traits::value_type::R t; if (p == 2) return rectangular_p_center_2_matrix_search( @@ -401,7 +401,7 @@ rectangular_p_center_2(ForwardIterator f, int p, Traits& t) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); r=0; if ( !internal::is_distance_greater_than_p(f,l,p) ) return std::copy(f,l,o); @@ -422,7 +422,7 @@ rectangular_p_center_2(ForwardIterator f, FT& r, int p) { - CGAL_optimisation_precondition(p >= 2 && p < 5); + CGAL_precondition(p >= 2 && p < 5); typedef typename std::iterator_traits< ForwardIterator >::value_type::R R; Rectangular_p_center_default_traits_2< R > t; diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat.h b/CGAL_Core/include/CGAL/CORE/BigFloat.h index 97183f63e50..6c7a8abff4c 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/BigFloatRep.h b/CGAL_Core/include/CGAL/CORE/BigFloatRep.h index 7439ce025a9..da8cb6967c8 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloatRep.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloatRep.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h index 3cbd077e487..dc828ae9379 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h @@ -23,7 +23,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ @@ -1102,7 +1102,7 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) { if (c == '.') d = 1; // Chen Li: fix a bug -- the sign of exponent can not happen before - // the character "e" appears! It must follow the "e' actually. + // the character "e" appears! It must follow the "e" actually. // if (e || c == '-' || c == '+') s = 1; if (e) s = 1; diff --git a/CGAL_Core/include/CGAL/CORE/BigInt.h b/CGAL_Core/include/CGAL/CORE/BigInt.h index 7b16a960ac3..f88a5877c9b 100644 --- a/CGAL_Core/include/CGAL/CORE/BigInt.h +++ b/CGAL_Core/include/CGAL/CORE/BigInt.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/BigRat.h b/CGAL_Core/include/CGAL/CORE/BigRat.h index 29b99509d40..d57e4e44cd9 100644 --- a/CGAL_Core/include/CGAL/CORE/BigRat.h +++ b/CGAL_Core/include/CGAL/CORE/BigRat.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CORE.h b/CGAL_Core/include/CGAL/CORE/CORE.h index 3fb78af5f83..a3e0b2ef83d 100644 --- a/CGAL_Core/include/CGAL/CORE/CORE.h +++ b/CGAL_Core/include/CGAL/CORE/CORE.h @@ -15,7 +15,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CoreAux.h b/CGAL_Core/include/CGAL/CORE/CoreAux.h index 9d75668be3a..fdb6c5de7cf 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreAux.h +++ b/CGAL_Core/include/CGAL/CORE/CoreAux.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h index 3f22a4cdfa1..9b335c393b2 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreAux_impl.h @@ -15,7 +15,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs.h b/CGAL_Core/include/CGAL/CORE/CoreDefs.h index 57c3da34645..e10ea21ec1a 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs.h @@ -17,7 +17,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h b/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h index d28326496f3..ecc29261130 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h @@ -14,7 +14,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h b/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h index 0e4a2044e74..59f4a7a63f6 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h @@ -11,7 +11,7 @@ * Zilin Du * Chee Yap * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Expr.h b/CGAL_Core/include/CGAL/CORE/Expr.h index 5cd5092d7e9..94b086e24d3 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr.h +++ b/CGAL_Core/include/CGAL/CORE/Expr.h @@ -18,7 +18,7 @@ * Sylvain Pion * Vikram Sharma * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index 723afa06080..bc142c77b6c 100644 --- a/CGAL_Core/include/CGAL/CORE/ExprRep.h +++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h @@ -18,7 +18,7 @@ * Sylvain Pion * Vikram Sharma * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ @@ -1340,7 +1340,7 @@ inline int ExprRep::getExactSign() { } // Chee, 7/17/02: degreeBound() function is now -// taken out of "computeExactFlags() +// taken out of "computeExactFlags()" inline int ExprRep::getSign() { if (ffVal.isOK()) return ffVal.sign(); diff --git a/CGAL_Core/include/CGAL/CORE/Expr_impl.h b/CGAL_Core/include/CGAL/CORE/Expr_impl.h index 5e3806024fa..69ccc73b616 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Expr_impl.h @@ -16,7 +16,7 @@ * Zilin Du * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Filter.h b/CGAL_Core/include/CGAL/CORE/Filter.h index ea0a02da1fa..56649b80c86 100644 --- a/CGAL_Core/include/CGAL/CORE/Filter.h +++ b/CGAL_Core/include/CGAL/CORE/Filter.h @@ -17,7 +17,7 @@ * Zilin Du * Chee Yap * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index 606b9223b2b..60a95c862e2 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -14,7 +14,7 @@ * Chee Yap * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Promote.h b/CGAL_Core/include/CGAL/CORE/Promote.h index 62a98e434ef..d882b6abcf3 100644 --- a/CGAL_Core/include/CGAL/CORE/Promote.h +++ b/CGAL_Core/include/CGAL/CORE/Promote.h @@ -18,7 +18,7 @@ * Sylvain Pion * Vikram Sharma * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Real.h b/CGAL_Core/include/CGAL/CORE/Real.h index b79503eb4c2..11174960dd2 100644 --- a/CGAL_Core/include/CGAL/CORE/Real.h +++ b/CGAL_Core/include/CGAL/CORE/Real.h @@ -18,7 +18,7 @@ * Zilin Du * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/RealRep.h b/CGAL_Core/include/CGAL/CORE/RealRep.h index 5a18d2748d1..85f7818a884 100644 --- a/CGAL_Core/include/CGAL/CORE/RealRep.h +++ b/CGAL_Core/include/CGAL/CORE/RealRep.h @@ -16,7 +16,7 @@ * Zilin Du * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Real_impl.h b/CGAL_Core/include/CGAL/CORE/Real_impl.h index c3a3041720a..e7ac7379f4c 100644 --- a/CGAL_Core/include/CGAL/CORE/Real_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Real_impl.h @@ -17,7 +17,7 @@ * Zilin Du * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ @@ -237,7 +237,7 @@ std::istream& operator >>(std::istream& i, Real& x) { if (c == '.') d = 1; // Chen Li: fix a bug -- the sign of exponent can not happen before - // the character "e" appears! It must follow the "e' actually. + // the character "e" appears! It must follow the "e" actually. // if (e || c == '-' || c == '+') s = 1; if (e) s = 1; diff --git a/CGAL_Core/include/CGAL/CORE/RefCount.h b/CGAL_Core/include/CGAL/CORE/RefCount.h index 91fafbf074f..ba1c8416a4b 100644 --- a/CGAL_Core/include/CGAL/CORE/RefCount.h +++ b/CGAL_Core/include/CGAL/CORE/RefCount.h @@ -35,7 +35,7 @@ * Zilin Du * Chee Yap * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/Timer.h b/CGAL_Core/include/CGAL/CORE/Timer.h index a0f2ce9f152..0e998c0b020 100644 --- a/CGAL_Core/include/CGAL/CORE/Timer.h +++ b/CGAL_Core/include/CGAL/CORE/Timer.h @@ -23,7 +23,7 @@ * Written by * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/extLong.h b/CGAL_Core/include/CGAL/CORE/extLong.h index d20caf05589..52ba91e321a 100644 --- a/CGAL_Core/include/CGAL/CORE/extLong.h +++ b/CGAL_Core/include/CGAL/CORE/extLong.h @@ -17,7 +17,7 @@ * Chen Li * Zilin Du * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/extLong_impl.h b/CGAL_Core/include/CGAL/CORE/extLong_impl.h index 0baeb58fbcd..69d92131839 100644 --- a/CGAL_Core/include/CGAL/CORE/extLong_impl.h +++ b/CGAL_Core/include/CGAL/CORE/extLong_impl.h @@ -21,7 +21,7 @@ * Zilin Du * Sylvain Pion * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/linearAlgebra.h b/CGAL_Core/include/CGAL/CORE/linearAlgebra.h index 16da34e461a..3d760cc629b 100644 --- a/CGAL_Core/include/CGAL/CORE/linearAlgebra.h +++ b/CGAL_Core/include/CGAL/CORE/linearAlgebra.h @@ -22,7 +22,7 @@ * Written by * Shubin Zhao (shubinz@cs.nyu.edu) (2001) * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $Id$ diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.h b/CGAL_Core/include/CGAL/CORE/poly/Curves.h index 65d1422d255..f1c9172e3e9 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.h @@ -49,7 +49,7 @@ * Author: Vikram Sharma and Chee Yap * Date: April 12, 2004 * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc index d9be84796c0..f21ddfec3a8 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc @@ -16,7 +16,7 @@ * Author: Vikram Sharma and Chee Yap * Date: April 12, 2004 * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.h b/CGAL_Core/include/CGAL/CORE/poly/Poly.h index bd56376a5b2..50ec728b685 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.h @@ -36,7 +36,7 @@ * Author: Chee Yap * Date: May 28, 2002 * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc index 325f64d528c..604a86ad6e1 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc @@ -30,7 +30,7 @@ * Author: Chee Yap, Sylvain Pion and Vikram Sharma * Date: May 28, 2002 * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h index 57fe5b26b7f..77ceab8c9ae 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h @@ -37,7 +37,7 @@ * Author: Chee Yap and Sylvain Pion, Vikram Sharma * Date: July 20, 2002 * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_Core/include/CGAL/export/CORE.h b/CGAL_Core/include/CGAL/export/CORE.h index 440239528a1..651387e610d 100644 --- a/CGAL_Core/include/CGAL/export/CORE.h +++ b/CGAL_Core/include/CGAL/export/CORE.h @@ -18,7 +18,7 @@ * Sylvain Pion * Vikram Sharma * - * WWW URL: http://cs.nyu.edu/exact/ + * WWW URL: https://cs.nyu.edu/exact/ * Email: exact@cs.nyu.edu * * $URL$ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO.h b/CGAL_ImageIO/include/CGAL/ImageIO.h index 9c6b4281cc6..26ada2cfd76 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO.h @@ -24,7 +24,7 @@ #ifdef CGAL_USE_ZLIB #include -/* see http://www.gzip.org/zlib/ +/* see https://zlib.net/ for details and documentation */ #endif @@ -342,8 +342,8 @@ CGAL_IMAGEIO_EXPORT _image *_createImage(std::size_t x, std::size_t y, std::size GIS (CEA, IRISA, ENST 3D image format). See also: - http://www.dcs.ed.ac.uk/home/mxr/gfx/2d-hi.html and - http://www.gzip.org/zlib/ + https://www.martinreddy.net/gfx/2d-hi.html and + https://zlib.net/ @param name image file name or nullptr for stdin */ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/convert.h b/CGAL_ImageIO/include/CGAL/ImageIO/convert.h index 4cb73637c49..0119d73736d 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/convert.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/convert.h @@ -19,7 +19,7 @@ * * AUTHOR: * Gregoire Malandain (greg@sophia.inria.fr) - * http://www.inria.fr/epidaure/personnel/malandain/ + * https://www-sop.inria.fr/members/Gregoire.Malandain/ * * CREATION DATE: * June, 9 1998 diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer.h b/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer.h index 4fba58fb19b..9e35ebd637b 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer.h @@ -23,7 +23,7 @@ * * AUTHOR: * Gregoire Malandain (greg@sophia.inria.fr) - * http://www.inria.fr/epidaure/personnel/malandain/ + * https://www-sop.inria.fr/members/Gregoire.Malandain/ * * CREATION DATE: * June, 9 1998 diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/recline.h b/CGAL_ImageIO/include/CGAL/ImageIO/recline.h index b8ae7b398a3..588bd8d6434 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/recline.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/recline.h @@ -23,7 +23,7 @@ * * AUTHOR: * Gregoire Malandain (greg@sophia.inria.fr) - * http://www.inria.fr/epidaure/personnel/malandain/ + * https://www-sop.inria.fr/members/Gregoire.Malandain/ * * CREATION DATE: * June, 9 1998 diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/typedefs.h b/CGAL_ImageIO/include/CGAL/ImageIO/typedefs.h index c4c612cc6e3..a77de031f64 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/typedefs.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/typedefs.h @@ -19,7 +19,7 @@ * * AUTHOR: * Gregoire Malandain (greg@sophia.inria.fr) - * http://www.inria.fr/epidaure/personnel/malandain/ + * https://www-sop.inria.fr/members/Gregoire.Malandain/ * * CREATION DATE: * June, 9 1998 diff --git a/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt b/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt index e5c3467650f..922e4e8f9bd 100644 --- a/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt +++ b/CGAL_ipelets/doc/CGAL_ipelets/CGAL_ipelets.txt @@ -9,7 +9,7 @@ namespace CGAL { \section CGAL_ipeletsIntroduction Introduction -The Ipe extensible drawing editor (http://ipe.otfried.org) \cgalCite{schwarzkopf1995ede}, \cgalCite{ipe:man-09} +The Ipe extensible drawing editor (https://ipe.otfried.org/) \cgalCite{schwarzkopf1995ede}, \cgalCite{ipe:man-09} is a tool used by computational geometry researchers to produce 2D figures for inclusion in articles or presentations. The extensible adjective sheds a light on an important feature: the possibility for users to write small extensions (called ipelets) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index a93004ad293..737a52dfc14 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -17,6 +17,7 @@ #ifndef CGAL_CARTESIAN_FUNCTION_OBJECTS_H #define CGAL_CARTESIAN_FUNCTION_OBJECTS_H +#include #include #include #include @@ -445,14 +446,14 @@ namespace CartesianKernelFunctors { } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -591,14 +592,14 @@ namespace CartesianKernelFunctors { } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -668,28 +669,34 @@ namespace CartesianKernelFunctors { result_type operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const { - return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z(), - s.x(), s.y(), s.z() ), - ft); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z(), + s.x(), s.y(), s.z(), + num, den); + return CGAL::compare(num, den * ft); } result_type operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const { - return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z()), - ft); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z(), + num, den); + return CGAL::compare(num, den * ft); } result_type operator()(const Point_3& p, const Point_3& q, const FT& ft) const { - return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z() ), - ft); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + num, den); + return CGAL::compare(num, den * ft); } result_type @@ -1234,26 +1241,35 @@ namespace CartesianKernelFunctors { result_type operator()( const Point_3& p, const Point_3& q) const { - return squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z()); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + num, den); + return num / den; } result_type operator()( const Point_3& p, const Point_3& q, const Point_3& r) const { - return squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z()); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z(), + num, den); + return num / den; } result_type operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { - return squared_radiusC3(p.x(), p.y(), p.z(), - q.x(), q.y(), q.z(), - r.x(), r.y(), r.z(), - s.x(), s.y(), s.z()); + FT num, den; + squared_radiusC3(p.x(), p.y(), p.z(), + q.x(), q.y(), q.z(), + r.x(), r.y(), r.z(), + s.x(), s.y(), s.z(), + num, den); + return num / den; } }; @@ -2505,7 +2521,7 @@ namespace CartesianKernelFunctors { FT rsy = psz*qsx-psx*qsz; FT rsz = psx*qsy-psy*qsx; - // The following determinants can be developped and simplified. + // The following determinants can be developed and simplified. // // FT num_x = determinant(psy,psz,ps2, // qsy,qsz,qs2, @@ -3961,7 +3977,7 @@ namespace CartesianKernelFunctors { operator()(const Circle_3 &a, const Point_3 &p) const { return a.rep().has_on(p); } - result_type + Needs_FT operator()(const Sphere_3 &a, const Circle_3 &p) const { return a.rep().has_on(p); } @@ -4205,8 +4221,7 @@ namespace CartesianKernelFunctors { public: typedef typename K::Orientation result_type; - result_type - operator()(const Point_2& p, const Point_2& q, const Point_2& r) const + result_type operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return orientationC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y()); } diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h index 77fe5d05e7c..dbc973138c5 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h @@ -142,11 +142,12 @@ centroidC3( const FT &px, const FT &py, const FT &pz, template < class FT > CGAL_KERNEL_MEDIUM_INLINE -FT +void squared_radiusC3(const FT &px, const FT &py, const FT &pz, - const FT &qx, const FT &qy, const FT &qz, - const FT &rx, const FT &ry, const FT &rz, - const FT &sx, const FT &sy, const FT &sz) + const FT &qx, const FT &qy, const FT &qz, + const FT &rx, const FT &ry, const FT &rz, + const FT &sx, const FT &sy, const FT &sz, + FT &num, FT &den) { // Translate p to origin to simplify the expression. FT qpx = qx-px; @@ -163,29 +164,30 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz, FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); FT num_x = determinant(qpy,qpz,qp2, - rpy,rpz,rp2, - spy,spz,sp2); + rpy,rpz,rp2, + spy,spz,sp2); FT num_y = determinant(qpx,qpz,qp2, - rpx,rpz,rp2, - spx,spz,sp2); + rpx,rpz,rp2, + spx,spz,sp2); FT num_z = determinant(qpx,qpy,qp2, - rpx,rpy,rp2, - spx,spy,sp2); - FT den = determinant(qpx,qpy,qpz, - rpx,rpy,rpz, - spx,spy,spz); - CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) ); + rpx,rpy,rp2, + spx,spy,sp2); + FT dden = determinant(qpx,qpy,qpz, + rpx,rpy,rpz, + spx,spy,spz); + CGAL_kernel_assertion( ! CGAL_NTS is_zero(dden) ); - return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) - + CGAL_NTS square(num_z)) / CGAL_NTS square(2 * den); + num = CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z); + den = CGAL_NTS square(2 * dden); } template < class FT > CGAL_KERNEL_MEDIUM_INLINE -FT +void squared_radiusC3(const FT &px, const FT &py, const FT &pz, - const FT &qx, const FT &qy, const FT &qz, - const FT &sx, const FT &sy, const FT &sz) + const FT &qx, const FT &qy, const FT &qz, + const FT &sx, const FT &sy, const FT &sz, + FT &num, FT &den) { // Translate s to origin to simplify the expression. FT psx = px-sx; @@ -207,14 +209,14 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz, FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy) - qs2 * determinant(psx,psy,rsx,rsy); - FT den = determinant(psx,psy,psz, - qsx,qsy,qsz, - rsx,rsy,rsz); + FT dden = determinant(psx,psy,psz, + qsx,qsy,qsz, + rsx,rsy,rsz); - CGAL_kernel_assertion( den != 0 ); + CGAL_kernel_assertion( dden != 0 ); - return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) - + CGAL_NTS square(num_z)) / CGAL_NTS square(2 * den); + num = CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z); + den = CGAL_NTS square(2 * dden); } template @@ -305,11 +307,13 @@ squared_distanceC3( const FT &px, const FT &py, const FT &pz, template < class FT > CGAL_KERNEL_INLINE -FT +void squared_radiusC3( const FT &px, const FT &py, const FT &pz, - const FT &qx, const FT &qy, const FT &qz) + const FT &qx, const FT &qy, const FT &qz, + FT &num, FT &den) { - return squared_distanceC3(px, py, pz, qx, qy, qz) / 4; + num = squared_distanceC3(px, py, pz, qx, qy, qz); + den = FT(4); } template < class FT > diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h index 8765d0cb587..0bb67083388 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h @@ -754,7 +754,7 @@ power_side_of_bounded_power_sphereC3( } // return the sign of the power test of weighted point (rx,ry,rz,rw) - // with respect to the smallest sphere orthogoanal to + // with respect to the smallest sphere orthogonal to // p,q template< class FT > typename Same_uncertainty_nt::type @@ -764,20 +764,19 @@ power_side_of_bounded_power_sphereC3( const FT &rx, const FT &ry, const FT &rz, const FT &rw) { FT FT2(2); - FT FT4(4); FT dpx = px - qx; FT dpy = py - qy; FT dpz = pz - qz; FT dpw = pw - qw; FT dp2 = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + CGAL_NTS square(dpz); - FT drx = rx - (px + qx)/FT2; - FT dry = ry - (py + qy)/FT2; - FT drz = rz - (pz + qz)/FT2; - FT drw = rw - (pw + qw)/FT2; + FT drx = FT2 * rx - (px + qx); + FT dry = FT2 * ry - (py + qy); + FT drz = FT2 * rz - (pz + qz); + FT drw = FT2 * rw - (pw + qw); FT dr2 = CGAL_NTS square(drx) + CGAL_NTS square(dry) + CGAL_NTS square(drz); FT dpr = dpx*drx + dpy*dry +dpz*drz; return enum_cast( - - CGAL_NTS sign (dr2 - dp2/FT4 + dpr*dpw/dp2 - drw )); + - CGAL_NTS sign (dr2*dp2 - dp2*dp2 + FT2*dpr*dpw - FT2*drw*dp2 )); } } // namespace CGAL diff --git a/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt b/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt index 41a5e7b9db4..740788d9b14 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt +++ b/Circular_kernel_2/doc/Circular_kernel_2/Circular_kernel_2.txt @@ -90,7 +90,7 @@ also added more functionality in 2008. This work was 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 +(ECG - Effective Computational Geometry for Curves and Surfaces) and by the IST Programme of the 6th Framework Programme of the EU as a STREP (FET Open Scheme) Project under Contract No IST-006413 diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h index bf00857272b..a66bd69bf63 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h @@ -16,7 +16,7 @@ // (ACS -- Algorithms for Complex Shapes) // Description of the file format can be found at the following address: -// http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf #ifndef CGAL_IO_DXF_READER_H #define CGAL_IO_DXF_READER_H diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h index 4da1adc4c96..900dd9aed87 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h @@ -16,8 +16,7 @@ // (ACS -- Algorithms for Complex Shapes) // Descriptions of the file format can be found at -// http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ -// http://www.tnt.uni-hannover.de/soft/compgraph/fileformats/docs/DXF.ascii +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf #ifndef CGAL_IO_DXF_READER_DOUBLES_H #define CGAL_IO_DXF_READER_DOUBLES_H diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h index 84672c295f7..d0ace79c85c 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_variant_reader.h @@ -17,7 +17,7 @@ // (ACS -- Algorithms for Complex Shapes) // Description of the file format can be found at the following address: -// http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf #ifndef CGAL_IO_DXF_VARIANT_READER_H #define CGAL_IO_DXF_VARIANT_READER_H diff --git a/Classification/doc/Classification/Classification.txt b/Classification/doc/Classification/Classification.txt index 2c4c11eee49..10157e274ff 100644 --- a/Classification/doc/Classification/Classification.txt +++ b/Classification/doc/Classification/Classification.txt @@ -528,7 +528,10 @@ The following example: \section Classification_history History -This package is based on a research code by [Florent Lafarge](https://www-sop.inria.fr/members/Florent.Lafarge/) that was generalized, extended and packaged by [Simon Giraudot](http://geometryfactory.com/who-we-are/) in \cgal 4.12. %Classification of surface meshes and of clusters were introduced in \cgal 4.13. The Neural Network classifier was introduced in \cgal 4.14. +This package is based on a research code by [Florent Lafarge](https://www-sop.inria.fr/members/Florent.Lafarge/) +that was generalized, extended and packaged by [Simon Giraudot](https://geometryfactory.com/who-we-are/) +in \cgal 4.12. %Classification of surface meshes and of clusters were introduced in \cgal 4.13. +The Neural Network classifier was introduced in \cgal 4.14. diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 58ada384336..423f49aae1c 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -542,7 +542,7 @@ Let d0\f$ \in \f$ D be a dart. Given i, 1 \f$ \leq \f$ i \section Combinatorial_mapDesign Design and Implementation History -The code of this package is inspired by Moka, a 3D topological modeler mainly developed by Frédéric Vidil and Guillaume Damiand (http://moka-modeller.sourceforge.net/). However, Moka was based on Generalized maps (and not Combinatorial maps), and the design was not \cgal "compatible". Thus, Guillaume Damiand started to develop a totally new package by mixing ideas taken from Moka with the design of the Halfedge data structure package of \cgal. Andreas Fabri and Sébastien Loriot contributed to the design, the coding, and to the documentation of the package, and Laurent Rineau helped for the design. Emma Michel contributed to the manual. Monique Teillaud and Bernd Gärtner contributed to the manual by giving useful remarks, really numerous and detailed for Monique. Ken Arroyo Ohori contributed to the two reverse orientation functions. +The code of this package is inspired by Moka, a 3D topological modeler mainly developed by Frédéric Vidil and Guillaume Damiand (https://moka-modeller.sourceforge.net/). However, Moka was based on Generalized maps (and not Combinatorial maps), and the design was not \cgal "compatible". Thus, Guillaume Damiand started to develop a totally new package by mixing ideas taken from Moka with the design of the Halfedge data structure package of \cgal. Andreas Fabri and Sébastien Loriot contributed to the design, the coding, and to the documentation of the package, and Laurent Rineau helped for the design. Emma Michel contributed to the manual. Monique Teillaud and Bernd Gärtner contributed to the manual by giving useful remarks, really numerous and detailed for Monique. Ken Arroyo Ohori contributed to the two reverse orientation functions. */ } /* namespace CGAL */ diff --git a/Combinatorial_map/include/CGAL/Compact_container_with_index.h b/Combinatorial_map/include/CGAL/Compact_container_with_index.h index 37d555793b6..a87122500fc 100644 --- a/Combinatorial_map/include/CGAL/Compact_container_with_index.h +++ b/Combinatorial_map/include/CGAL/Compact_container_with_index.h @@ -752,9 +752,12 @@ public: return false; } - bool owns_dereferencable(const_iterator cit) const + bool owns_dereferenceable(const_iterator cit) const { return cit!=end() && owns(cit); } + CGAL_DEPRECATED bool owns_dereferencable(const_iterator cit) const + { return owns_dereferenceable(cit); } + /** Reserve method to ensure that the capacity of the Compact_container be * greater or equal than a given value n. */ diff --git a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt index fd1c27ca210..7fa7625b04f 100644 --- a/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt +++ b/Convex_hull_2/doc/Convex_hull_2/PackageDescription.txt @@ -53,13 +53,11 @@ upper hull of a set of points. \cgalCRPSection{Assertions} -The assertion flags for the convex hull and extreme point algorithms -use `CH` in their names (e.g., `CGAL_CH_NO_POSTCONDITIONS`). For the convex hull algorithms, the postcondition check tests only convexity (if not disabled), but not containment of the input points in the polygon or polyhedron defined by the output points. The latter is considered an expensive checking and can be enabled by -defining `CGAL_CH_CHECK_EXPENSIVE`. +defining `CGAL_CHECK_EXPENSIVE`. \cgalCRPSection{Concepts} @@ -105,4 +103,3 @@ defining `CGAL_CH_CHECK_EXPENSIVE`. */ - diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h index ae896d3e374..455c2ce3fcf 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -252,7 +252,7 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, region3.push_back( *e); region4.push_back( *n); - CGAL_ch_postcondition_code( ForwardIterator save_first = first; ) + CGAL_postcondition_code( ForwardIterator save_first = first; ) int duplicated_exteme_points = (std::get<0>(ranges)==std::get<1>(ranges)?1:0) + (std::get<1>(ranges)==std::get<2>(ranges)?1:0) + @@ -323,12 +323,12 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, res, ch_traits); } - CGAL_ch_postcondition_code( first = save_first; ) - CGAL_ch_postcondition( \ + CGAL_postcondition_code( first = save_first; ) + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h deleted file mode 100644 index 1706f796e9f..00000000000 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1999 Max-Planck-Institute Saarbruecken (Germany). -// 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) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_ch_assertion -#undef CGAL_ch_assertion_msg -#undef CGAL_ch_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_ch_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_ch_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_assertion_code(CODE) -#else -# define CGAL_ch_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_assertion_code(CODE) CODE -# define CGAL_ch_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_exactness_assertion -#undef CGAL_ch_exactness_assertion_msg -#undef CGAL_ch_exactness_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_assertion(EX) (static_cast(0)) -# define CGAL_ch_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_assertion_code(CODE) -#else -# define CGAL_ch_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_assertion_code(CODE) CODE -# define CGAL_ch_exactness_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_expensive_assertion -#undef CGAL_ch_expensive_assertion_msg -#undef CGAL_ch_expensive_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_assertion(EX) (static_cast(0)) -# define CGAL_ch_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_assertion_code(CODE) -#else -# define CGAL_ch_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_assertion_code(CODE) CODE -# define CGAL_ch_expensive_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -#undef CGAL_ch_expensive_exactness_assertion -#undef CGAL_ch_expensive_exactness_assertion_msg -#undef CGAL_ch_expensive_exactness_assertion_code - -#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_ch_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_ch_expensive_exactness_assertions 1 -#endif // CGAL_CH_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_ch_precondition -#undef CGAL_ch_precondition_msg -#undef CGAL_ch_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_ch_precondition(EX) (static_cast(0)) -# define CGAL_ch_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_precondition_code(CODE) -#else -# define CGAL_ch_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_precondition_code(CODE) CODE -# define CGAL_ch_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_exactness_precondition -#undef CGAL_ch_exactness_precondition_msg -#undef CGAL_ch_exactness_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_precondition(EX) (static_cast(0)) -# define CGAL_ch_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_precondition_code(CODE) -#else -# define CGAL_ch_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_precondition_code(CODE) CODE -# define CGAL_ch_exactness_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_expensive_precondition -#undef CGAL_ch_expensive_precondition_msg -#undef CGAL_ch_expensive_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_precondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_precondition_code(CODE) -#else -# define CGAL_ch_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_precondition_code(CODE) CODE -# define CGAL_ch_expensive_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -#undef CGAL_ch_expensive_exactness_precondition -#undef CGAL_ch_expensive_exactness_precondition_msg -#undef CGAL_ch_expensive_exactness_precondition_code - -#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_ch_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_ch_expensive_exactness_preconditions 1 -#endif // CGAL_CH_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_ch_postcondition -#undef CGAL_ch_postcondition_msg -#undef CGAL_ch_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_ch_postcondition(EX) (static_cast(0)) -# define CGAL_ch_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_postcondition_code(CODE) -#else -# define CGAL_ch_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_postcondition_code(CODE) CODE -# define CGAL_ch_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_exactness_postcondition -#undef CGAL_ch_exactness_postcondition_msg -#undef CGAL_ch_exactness_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_ch_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_postcondition_code(CODE) -#else -# define CGAL_ch_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_postcondition_code(CODE) CODE -# define CGAL_ch_exactness_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_expensive_postcondition -#undef CGAL_ch_expensive_postcondition_msg -#undef CGAL_ch_expensive_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_postcondition_code(CODE) -#else -# define CGAL_ch_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_postcondition_code(CODE) CODE -# define CGAL_ch_expensive_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -#undef CGAL_ch_expensive_exactness_postcondition -#undef CGAL_ch_expensive_exactness_postcondition_msg -#undef CGAL_ch_expensive_exactness_postcondition_code - -#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_ch_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_ch_expensive_exactness_postconditions 1 -#endif // CGAL_CH_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_ch_warning -#undef CGAL_ch_warning_msg -#undef CGAL_ch_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_ch_warning(EX) (static_cast(0)) -# define CGAL_ch_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_warning_code(CODE) -#else -# define CGAL_ch_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_warning_code(CODE) CODE -# define CGAL_ch_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_exactness_warning -#undef CGAL_ch_exactness_warning_msg -#undef CGAL_ch_exactness_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_ch_exactness_warning(EX) (static_cast(0)) -# define CGAL_ch_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_exactness_warning_code(CODE) -#else -# define CGAL_ch_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_exactness_warning_code(CODE) CODE -# define CGAL_ch_exactness_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_expensive_warning -#undef CGAL_ch_expensive_warning_msg -#undef CGAL_ch_expensive_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_warning(EX) (static_cast(0)) -# define CGAL_ch_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_warning_code(CODE) -#else -# define CGAL_ch_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_warning_code(CODE) CODE -# define CGAL_ch_expensive_warnings 1 -#endif // CGAL_CH_NO_WARNINGS - - -#undef CGAL_ch_expensive_exactness_warning -#undef CGAL_ch_expensive_exactness_warning_msg -#undef CGAL_ch_expensive_exactness_warning_code - -#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_ch_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_ch_expensive_exactness_warning_code(CODE) -#else -# define CGAL_ch_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_ch_expensive_exactness_warning_code(CODE) CODE -# define CGAL_ch_expensive_exactness_warnings 1 -#endif // CGAL_CH_NO_WARNINGS diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h index cd48b9b9e67..180f44f7e7d 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_bykat_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -116,11 +116,11 @@ ch_bykat(InputIterator first, InputIterator last, r = R.back(); R.pop_back(); } } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ P.begin(), P.end(), \ res.output_so_far_begin(), res.output_so_far_end(), \ @@ -255,11 +255,11 @@ ch_bykat_with_threshold(InputIterator first, InputIterator last, r = R.back(); R.pop_back(); } } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ Pbegin, Pend, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h index c72f79f4c90..0f484f2b72b 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_eddy_impl.h @@ -20,7 +20,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -44,7 +44,7 @@ ch__recursive_eddy(List& L, Left_turn_2 left_turn = ch_traits.left_turn_2_object(); Less_xy_2 less_xy = ch_traits.less_xy_2_object(); - CGAL_ch_precondition( \ + CGAL_precondition( \ std::find_if(a_it, b_it, \ [&left_turn, a_it, b_it](const Point_2& p) { return left_turn(*b_it, *a_it, p); }) \ @@ -137,9 +137,9 @@ ch_eddy(InputIterator first, InputIterator last, ch__recursive_eddy( L, e, w, ch_traits); - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( L.begin(), w, ch_traits) ); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( first, last, \ L.begin(), w, ch_traits ) ); diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h index d30fccdc8e3..1fdef8d9d0c 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_graham_andrew_impl.h @@ -21,7 +21,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include #include @@ -42,11 +42,11 @@ ch_graham_andrew_scan( BidirectionalIterator first, BidirectionalIterator alpha; BidirectionalIterator beta; BidirectionalIterator iter; - CGAL_ch_precondition( first != last ); - CGAL_ch_precondition( std::next(first) != last ); + CGAL_precondition( first != last ); + CGAL_precondition( std::next(first) != last ); --last; - CGAL_ch_precondition( *first != *last ); + CGAL_precondition( *first != *last ); S.push_back( last ); S.push_back( first ); Left_turn left_turn = ch_traits.left_turn_2_object(); @@ -78,7 +78,7 @@ ch_graham_andrew_scan( BidirectionalIterator first, alpha = beta; stack_rev_iter = S.rbegin(); beta = *++stack_rev_iter; - CGAL_ch_assertion(S.size() >= 2); + CGAL_assertion(S.size() >= 2); } S.push_back( iter ); beta = alpha; @@ -98,11 +98,11 @@ ch_graham_andrew_scan( BidirectionalIterator first, #endif // no postconditions ... for ( ++stack_iter; stack_iter != S.end(); ++stack_iter) { *res = **stack_iter; ++res; } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_chain_check_2( \ first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ @@ -123,7 +123,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, { typedef typename Traits::Left_turn_2 Left_turn; - CGAL_ch_precondition_code( + CGAL_precondition_code( typedef typename Traits::Equal_2 Equal_2; Equal_2 equal_points = ch_traits.equal_2_object(); ) @@ -134,11 +134,11 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, BidirectionalIterator alpha; BidirectionalIterator beta; BidirectionalIterator iter; - CGAL_ch_precondition( first != last ); - CGAL_ch_precondition( std::next(first) != last ); + CGAL_precondition( first != last ); + CGAL_precondition( std::next(first) != last ); --last; - CGAL_ch_precondition(! equal_points(*first,*last) ); + CGAL_precondition(! equal_points(*first,*last) ); S.push_back( last ); S.push_back( first ); @@ -168,7 +168,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first, alpha = beta; stack_rev_iter = S.rbegin(); beta = *++stack_rev_iter; - CGAL_ch_assertion(S.size() >= 2); + CGAL_assertion(S.size() >= 2); } S.push_back( iter ); beta = alpha; @@ -213,11 +213,11 @@ ch_graham_andrew( InputIterator first, #endif // no postconditions ... ch__ref_graham_andrew_scan( V.begin(), V.end(), res, ch_traits); ch__ref_graham_andrew_scan( V.rbegin(), V.rend(), res, ch_traits); - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( \ V.begin(), V.end(), \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h index 1ecdd0b7ea8..8710ea0a030 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_jarvis_impl.h @@ -21,7 +21,7 @@ #endif // CGAL_CH_NO_POSTCONDITIONS #include -#include +#include #include #include @@ -48,16 +48,16 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last, typedef typename Traits::Point_2 Point_2; Tee_for_output_iterator res(result); #endif // no postconditions ... - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ int count_points = 0; ) - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ for (ForwardIterator fit = first; fit!= last; ++fit) ++count_points; ) Less_rotate_ccw rotation_predicate = ch_traits.less_rotate_ccw_2_object( ); *res = start_p; ++res; - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ int constructed_points = 1; ) - CGAL_ch_exactness_assertion_code( \ + CGAL_exactness_assertion_code( \ Point previous_point = start_p; ) ForwardIterator it = std::min_element( first, last, @@ -65,26 +65,26 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last, {return rotation_predicate(start_p, p1, p2);} ); while (! equal_points(*it, stop_p) ) { - CGAL_ch_exactness_assertion( \ + CGAL_exactness_assertion( \ *it != previous_point ); - CGAL_ch_exactness_assertion_code( \ + CGAL_exactness_assertion_code( \ previous_point = *it; ) *res = *it; ++res; - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ ++constructed_points;) - CGAL_ch_assertion( \ + CGAL_assertion( \ constructed_points <= count_points + 1 ); it = std::min_element( first, last, [it, &rotation_predicate](const Point& p1, const Point& p2) {return rotation_predicate(*it, p1, p2);} ); } - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( res.output_so_far_begin(), \ res.output_so_far_end(), \ ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( first, last, \ res.output_so_far_begin(), res.output_so_far_end(), \ diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h index 4af027e992d..04e1e931f66 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_melkman_impl.h @@ -19,7 +19,7 @@ #include #endif // CGAL_CH_NO_POSTCONDITIONS -#include +#include #include #include @@ -37,19 +37,19 @@ ch_melkman( InputIterator first, InputIterator last, typename Traits::Left_turn_2 left_turn = ch_traits.left_turn_2_object(); Equal_2 equal_points = ch_traits.equal_2_object(); - CGAL_ch_assertion_code( \ + CGAL_assertion_code( \ typename Traits::Less_xy_2 less = ch_traits.less_xy_2_object(); ) std::deque< Point> Q; - CGAL_ch_expensive_postcondition_code( std::deque< Point> IN; ) + CGAL_expensive_postcondition_code( std::deque< Point> IN; ) if (first == last) return result; // 0 elements Point p = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(p); ) + CGAL_expensive_postcondition_code( IN.push_back(p); ) if (++first == last) { *result = p; ++result; return result; } // 1 element Point q = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(q); ) + CGAL_expensive_postcondition_code( IN.push_back(q); ) if (++first == last) // 2 elements { *result = p; ++result; @@ -63,11 +63,11 @@ ch_melkman( InputIterator first, InputIterator last, while (first != last) { r = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(r); ) + CGAL_expensive_postcondition_code( IN.push_back(r); ) // visited input sequence = p,..., q, r if ( left_turn(p,q,r)) { Q.push_back( q); break; } if ( left_turn(q,p,r)) { Q.push_front( q); break; } - CGAL_ch_assertion( less( p, q) ? less (p, r) : less( r, p)); + CGAL_assertion( less( p, q) ? less (p, r) : less( r, p)); q = r; ++first; } @@ -84,7 +84,7 @@ ch_melkman( InputIterator first, InputIterator last, while ( ++first != last) { r = *first; - CGAL_ch_expensive_postcondition_code( IN.push_back(r); ) + CGAL_expensive_postcondition_code( IN.push_back(r); ) if (left_turn( current, r, Q.front()) || left_turn( Q.back(), r, current)) // r outside cone Q.front(), current, Q.back() <=> @@ -110,9 +110,9 @@ ch_melkman( InputIterator first, InputIterator last, Q.push_back( current); // add last point to Q - CGAL_ch_postcondition( \ + CGAL_postcondition( \ is_ccw_strongly_convex_2( Q.begin(), Q.end(), ch_traits)); - CGAL_ch_expensive_postcondition( \ + CGAL_expensive_postcondition( \ ch_brute_force_check_2( IN.begin(),IN.end(), Q.begin(),Q.end(), ch_traits)); std::copy( Q.begin(), Q.end(), result); return result; diff --git a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt index cfe86e65064..acadb02ed7e 100644 --- a/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt +++ b/Convex_hull_3/doc/Convex_hull_3/PackageDescription.txt @@ -52,13 +52,11 @@ points in is strongly convex or not. This chapter describes the functions available for three dimensions. \cgalCRPSection{Assertions} -The assertion flags for the convex hull and extreme point algorithms -use `CH` in their names (e.g., `CGAL_CH_NO_POSTCONDITIONS`). For the convex hull algorithms, the postcondition check tests only convexity (if not disabled), but not containment of the input points in the polygon or polyhedron defined by the output points. The latter is considered an expensive checking and can be enabled by -defining `CGAL_CH_CHECK_EXPENSIVE`. +defining `CGAL_CHECK_EXPENSIVE`. \cgalClassifedRefPages diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h index 2edd7244422..a1311e87c5f 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h @@ -73,7 +73,6 @@ namespace CGAL std::unordered_map primal_vertices; - size_t n = 0; // First, computing the primal vertices for(Facet_const_handle fd : faces(_dual)){ @@ -111,7 +110,6 @@ namespace CGAL vertex_descriptor vd = add_vertex(primal); primal_vertices[fd] = vd; put(vpm, vd, ppp); - ++n; } // Then, add facets to the primal polyhedron @@ -283,4 +281,3 @@ namespace CGAL #include #endif // CGAL_HALFSPACE_INTERSECTION_3_H - diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 46d2082ab0b..18a11329308 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -565,7 +565,7 @@ farthest_outside_point(Face_handle f, std::list& outside_set, { typedef typename std::list::iterator Outside_set_iterator; - CGAL_ch_assertion(!outside_set.empty()); + CGAL_assertion(!outside_set.empty()); typename Traits::Plane_3 plane = traits.construct_plane_3_object()(f->vertex(0)->point(), @@ -682,7 +682,7 @@ ch_quickhull_3_scan(TDS_2& tds, border.erase(it); while(! border.empty()){ it = border.find(e.first->vertex(TDS_2::ccw(e.second))); - CGAL_ch_assertion(it != border.end()); + CGAL_assertion(it != border.end()); e = it->second; e.first->info() = 0; edges.push_back(e); @@ -758,9 +758,9 @@ void non_coplanar_quickhull_3(std::list& points, ch_quickhull_3_scan(tds, pending_facets, traits); //std::cout << "|V(tds)| = " << tds.number_of_vertices() << std::endl; -// CGAL_ch_expensive_postcondition(all_points_inside(points.begin(), +// CGAL_expensive_postcondition(all_points_inside(points.begin(), // points.end(),P,traits)); -// CGAL_ch_postcondition(is_strongly_convex_3(P, traits)); +// CGAL_postcondition(is_strongly_convex_3(P, traits)); } template diff --git a/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp b/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp index 55b29cf4435..3638c7b9ef0 100644 --- a/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp +++ b/Convex_hull_3/test/Convex_hull_3/degeneracy_test.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 19bd335a296..a885f8ecea2 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -27,7 +27,7 @@ else() endif() find_package(Doxygen) -find_package(Python3 COMPONENTS Interpreter) +find_package(Python3 REQUIRED COMPONENTS Interpreter) if(NOT DOXYGEN_FOUND) message(WARNING "Cannot build the documentation without Doxygen!") @@ -322,23 +322,22 @@ endif() set(CGAL_DOC_VERSION ${CGAL_CREATED_VERSION_NUM}) ## generate how_to_cite files -if(Python3_Interpreter_FOUND) - execute_process( - COMMAND ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py - ${CGAL_ROOT} ${CMAKE_BINARY_DIR} "${CGAL_BRANCH_BUILD}" - RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT) - if(NOT GENERATE_HOW_TO_CITE_RESULT EQUAL "0") - message(FATAL_ERROR "generate_how_to_cite did not exit correctly") - endif() - - configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib.in - ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib) - configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt.in - ${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt) - configure_file(${CMAKE_BINARY_DIR}/how_to_cite.html.in - ${CMAKE_BINARY_DIR}/how_to_cite.html) +execute_process( + COMMAND ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py + ${CGAL_ROOT} ${CMAKE_BINARY_DIR} "${CGAL_BRANCH_BUILD}" + RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT) +if(NOT GENERATE_HOW_TO_CITE_RESULT EQUAL "0") + message(FATAL_ERROR "generate_how_to_cite did not exit correctly") endif() +configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib.in + ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib) +configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt.in + ${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt) +configure_file(${CMAKE_BINARY_DIR}/how_to_cite.html.in + ${CMAKE_BINARY_DIR}/how_to_cite.html) + +# configure_file(${CGAL_DOC_RESOURCE_DIR}/BaseDoxyfile.in ${CGAL_DOC_DXY_DIR}/BaseDoxyfile) @@ -436,51 +435,50 @@ add_dependencies(Documentation_copy_doc_tags doc_pre) #total level doc dependencies add_dependencies(doc doc_post) -if(Python3_Interpreter_FOUND) - set(CGAL_DOC_TESTSUITE_SCRIPT "${CGAL_DOC_SCRIPT_DIR}/testsuite.py") + +set(CGAL_DOC_TESTSUITE_SCRIPT "${CGAL_DOC_SCRIPT_DIR}/testsuite.py") + +add_custom_target( + doc_with_postprocessing + ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py + --output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR}) +add_dependencies(doc_with_postprocessing doc) + +if(CGAL_DOC_CREATE_LOGS) + add_custom_target( + Documentation_test + ${Python3_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir + ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR}) + add_dependencies(Documentation_test doc) add_custom_target( - doc_with_postprocessing - ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py - --output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR}) - add_dependencies(doc_with_postprocessing doc) + Documentation_test_publish + ${Python3_EXECUTABLE} + ${CGAL_DOC_TESTSUITE_SCRIPT} + --output-dir + ${CGAL_DOC_OUTPUT_DIR} + --doc-log-dir + ${CGAL_DOC_LOG_DIR} + --publish + ${CGAL_DOC_PUBLISH_DIR} + --do-copy-results) + add_dependencies(Documentation_test_publish doc) - if(CGAL_DOC_CREATE_LOGS) - add_custom_target( - Documentation_test - ${Python3_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir - ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR}) - add_dependencies(Documentation_test doc) + add_custom_target( + doc_and_publish_testsuite + ${Python3_EXECUTABLE} + ${CGAL_DOC_TESTSUITE_SCRIPT} + --output-dir + ${CGAL_DOC_OUTPUT_DIR} + --doc-log-dir + ${CGAL_DOC_LOG_DIR} + --publish + ${CGAL_DOC_PUBLISH_DIR} + --do-copy-results + --cgal-version + "${CGAL_FULL_VERSION}" + --version-to-keep + 10) + add_dependencies(doc_and_publish_testsuite doc_with_postprocessing) - add_custom_target( - Documentation_test_publish - ${Python3_EXECUTABLE} - ${CGAL_DOC_TESTSUITE_SCRIPT} - --output-dir - ${CGAL_DOC_OUTPUT_DIR} - --doc-log-dir - ${CGAL_DOC_LOG_DIR} - --publish - ${CGAL_DOC_PUBLISH_DIR} - --do-copy-results) - add_dependencies(Documentation_test_publish doc) - - add_custom_target( - doc_and_publish_testsuite - ${Python3_EXECUTABLE} - ${CGAL_DOC_TESTSUITE_SCRIPT} - --output-dir - ${CGAL_DOC_OUTPUT_DIR} - --doc-log-dir - ${CGAL_DOC_LOG_DIR} - --publish - ${CGAL_DOC_PUBLISH_DIR} - --do-copy-results - --cgal-version - "${CGAL_FULL_VERSION}" - --version-to-keep - 10) - add_dependencies(doc_and_publish_testsuite doc_with_postprocessing) - - endif() endif() diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 1a6fb78e4cb..0583952c360 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -145,64 +145,19 @@ To disable all checks in the library, the flag `CGAL_NDEBUG` can be set. Note that the standard flag `NDEBUG` sets `CGAL_NDEBUG`, but it also affects the `assert` macro. -To enable expensive and exactness checks, respectively, the compile-time -flags `CGAL_CHECK_EXPENSIVE` - -and `CGAL_CHECK_EXACTNESS` - -have to be supplied. However, exactness checks should only be turned on if +To enable expensive and exactness checks, respectively, the preprocessor macros +`CGAL_CHECK_EXPENSIVE` and `CGAL_CHECK_EXACTNESS` +have to be defined. However, exactness checks should only be turned on if the computation is done with some exact number type. \section secchecks_controlling Controlling checks at a finer granularity The macros and related compile-time flags described so far all operate -on the whole library. Sometimes the user may want to have a more -selective control. \cgal offers the possibility to turn checks on -and off on a per-package basis. Therefore a package-specific term is -inserted in the macro names directly after the \cgal prefix, -e.g., `CGAL_kernel_assertion()`. Similarly, the uppercase -term is used for the compile-time flags; -e.g., `CGAL_KERNEL_NO_WARNINGS` switches off the warnings -in only the kernel. Other packages have their own specific -terms as documented in the corresponding chapters of the -reference manual. - -For a new package you will first have to create a suitable header file -with all macro definitions. This is done with the shell script -cgal_create_assertions.sh, to be found in the -scripts directory. - -The following command will create a file optimisation_assertions.h: - -

- sh cgal_create_assertions.sh optimisation - -
- -You should place the generated file in the proper directory (and possibly -rename it). Then you can use the checks in the following fashion. - -\code{.cpp} - #include - - void optimisation_foo( int i) - { - CGAL_optimisation_precondition_msg( i == 42, "Only 42 allowed!"); - // ... - } -\endcode - -The documentation of your new package has to name the term chosen to be -part of the package-specific macros in -order to enable the user to selectively turn off and on the checks of -your package. For example, in the documentation of the optimisation -package you can find a sentence similar to the following. -
- The optimisation code uses the term OPTIMISATION for the checks; - e.g., setting the compile time flag - `CGAL_OPTIMISATION_NO_PRECONDITIONS` switches off precondition - checking in the optimisation code. -
+on the whole library. \cgal offers the possibility to turn checks on +and off just for the kernel. Kernel assertions are stated using the +macro `CGAL_kernel_assertion()`, and they can be disabled by defining +the macros `CGAL_KERNEL_NO_ASSERTIONS` or `CGAL_NO_ASSERTIONS`. +See \ref secchecks "the section Checks in STL Extensions", for details. \section secchecks_cgal_assume Suppress warnings using CGAL_assume. @@ -230,7 +185,7 @@ MSVC][msvc-assume], or [`__builtin_unreachable`][builtin-unreachable] recognized by both clang and g++. [msvc-assume]: https://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx -[builtin-unreachable]: http://clang.llvm.org/docs/LanguageExtensions.html#builtin-unreachable +[builtin-unreachable]: https://clang.llvm.org/docs/LanguageExtensions.html#builtin-unreachable \section secexception_handling Exception handling @@ -238,7 +193,7 @@ Some parts of the library use exceptions, but there is no general specific policy concerning exception handling in \cgal. It is nevertheless good to target exception safety, as much as possible. Good references on exception safety are: Appendix E of \cgalCite{cgal:s-cpl-97} (also available at -http://www.stroustrup.com/3rd_safe0.html), +https://www.stroustrup.com/3rd_safe0.html), and \cgalCite{cgal:a-esgc-98} (also available at https://www.boost.org/community/exception_safety.html). Any destructor which might throw an exception, including a destructor which diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt index b7450d5cd3d..bb7567c4858 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_iterators_and_circulators.txt @@ -42,7 +42,7 @@ Thus we will not give a full description of these concept here but only a few hints about how to use and write handle, iterators and circulators in \cgal. Developers should consult the above-mentioned references to become familiar with the iterator, circulator and handle concepts. In particular, the notions of iterator and circulator ranges, -dereferencable and past-the-end values, +dereferenceable and past-the-end values, mutable and constant iterators and circulators, and the different categories (forward, bidirectional, random-access, etc.) of iterators and circulators, are fundamental. diff --git a/Documentation/doc/Documentation/License.txt b/Documentation/doc/Documentation/License.txt index cb272b4180f..1eaf49026dd 100644 --- a/Documentation/doc/Documentation/License.txt +++ b/Documentation/doc/Documentation/License.txt @@ -19,7 +19,7 @@ based on GPLed \cgal data structures, obliges you to distribute the source code of your software under the GPL. The exact license terms can be found at the Free Software Foundation -web site: http://www.gnu.org/copyleft/gpl.html. +web site: https://www.gnu.org/licenses/gpl-3.0.html. \section licensesLGPL GNU LGPL @@ -29,7 +29,7 @@ In contrast to the GPL, there is no obligation to distribute the source code of software you build on top of LGPLed \cgal data structures. The exact license terms can be found at the Free Software Foundation web site: -http://www.gnu.org/copyleft/lesser.html. +https://www.gnu.org/licenses/lgpl-3.0.html. \section licensesRationale Rationale of the License Choice @@ -46,7 +46,7 @@ The package overview states for each package under which license it is distribut Users who cannot comply with the Open Source license terms can buy individual data structures under various commercial licenses from GeometryFactory: -http://www.geometryfactory.com/. License fees paid by commercial +https://www.geometryfactory.com/. License fees paid by commercial customers are reinvested in R\&D performed by the \cgal project partners, as well as in evolutive maintenance. diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt index d74dcdaf7b9..b981472df6a 100644 --- a/Documentation/doc/Documentation/Third_party.txt +++ b/Documentation/doc/Documentation/Third_party.txt @@ -11,11 +11,11 @@ supporting C++14 or later. | Operating System | Compiler | | :---------- | :--------------- | -| Linux | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{http://gcc.gnu.org/}} | -| | `Clang` \cgalFootnote{\cgalFootnoteCode{http://clang.llvm.org/}} compiler version 13.0.1 | -| \ms Windows | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{http://gcc.gnu.org/}} | +| Linux | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | +| | `Clang` \cgalFootnote{\cgalFootnoteCode{https://clang.llvm.org/}} compiler version 13.0.1 | +| \ms Windows | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | | | \ms Visual `C++` 14.0, 15.9, 16.10, 17.0 (\visualstudio 2015, 2017, 2019, and 2022)\cgalFootnote{\cgalFootnoteCode{https://visualstudio.microsoft.com/}} | -| MacOS X | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{http://gcc.gnu.org/}} | +| MacOS X | \gnu `g++` 10.2.1 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} | | | Apple `Clang` compiler versions 10.0.1, 12.0.5, and 13.0.0 | @@ -131,7 +131,7 @@ Overview page. In order to use Eigen in \cgal programs, the executables should be linked with the CMake imported target `CGAL::Eigen3_support` provided in `CGAL_Eigen3_support.cmake`. -The \eigen web site is `http://eigen.tuxfamily.org`. +The \eigen web site is `https://eigen.tuxfamily.org`. \subsection thirdpartyOpenGR OpenGR @@ -213,7 +213,7 @@ the handling of \pdb data. In \cgal, the \esbtl is used in an example of the \ref PkgSkinSurface3 package. -It can be downloaded from `http://esbtl.sourceforge.net/`. +It can be downloaded from `https://esbtl.sourceforge.net/`. \subsection thirdpartyTBB Intel TBB @@ -309,7 +309,7 @@ The \glpk web site is `https://www. In \cgal, \scip provides an optional linear integer program solver in the \ref PkgPolygonalSurfaceReconstruction package. In order to use \scip in \cgal programs, the executables should be linked with the CMake imported target `CGAL::SCIP_support` provided in `CGAL_SCIP_support.cmake`. -The \scip web site is `http://scip.zib.de/`. +The \scip web site is `https://www.scipopt.org/`. \subsection thirdpartyOSQP OSQP diff --git a/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt b/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt index b40aaa1f509..06c056229ee 100644 --- a/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt +++ b/Documentation/doc/Documentation/Tutorials/Tutorial_hello_world.txt @@ -241,8 +241,8 @@ ch_graham_andrew( InputIterator first, There are two obvious questions: What can be used as argument for this template parameter? And why do we have template parameters at all? -To answer the first question, any model of the \cgal concept `Kernel` provides -what is required by the concept `ConvexHullTraits_2`. +To answer the first question, any \em model of the \cgal \em concept `Kernel` +provides what is required by the concept `ConvexHullTraits_2`. As for the second question, think about an application where we want to compute the convex hull of 3D points projected into the `yz` plane. Using @@ -265,8 +265,8 @@ given by a direction, which is hardwired in the class \section intro_concept Concepts and Models -In the previous section, we wrote that "Any model of the CGAL concept -Kernel provides what is required by the concept `ConvexHullTraits_2`. +In the previous section, we wrote that: any \em model of the \cgal \em concept +`Kernel` provides what is required by the concept `ConvexHullTraits_2`. A \em concept is a set of requirements on a type, namely that it has certain nested types, certain member functions, or comes with certain diff --git a/Documentation/doc/Documentation/advanced/Configuration_variables.txt b/Documentation/doc/Documentation/advanced/Configuration_variables.txt index f989032bbae..8434b496014 100644 --- a/Documentation/doc/Documentation/advanced/Configuration_variables.txt +++ b/Documentation/doc/Documentation/advanced/Configuration_variables.txt @@ -72,12 +72,12 @@ and will serverly limit performances. | Variable | Description | Type | %Default Value | | :- | :- | :- | :- | -| `CMAKE_BUILD_TYPE` | Indicates type of build. Possible values are 'Debug' or 'Release' | CMake | | -| `CMAKE_INSTALL_PREFIX`| Installation directory path | CMake | Debug | +| `CMAKE_BUILD_TYPE` | Indicates type of build. Possible values are 'Debug' or 'Release' | CMake | none | +| `CMAKE_INSTALL_PREFIX`| Installation directory path | CMake | platform-dependent | | `CMAKE_C_COMPILER` | Full-path to the executable corresponding to the C compiler to use. | CMake | platform-dependent | | `CMAKE_CXX_COMPILER` | Full-path to the executable corresponding to the C++ compiler to use. | CMake | platform-dependent | | `CXX` | Idem | Environment | Idem | -| `BUILD_SHARED_LIBS` | Whether to build shared or static libraries. | CMake | TRUE | +| `BUILD_SHARED_LIBS` | Whether to build shared or static libraries. | CMake | ON | \subsection installation_variables_building Variables Used Only When Building Programs (Such as Demos or Examples) diff --git a/Documentation/doc/Documentation/advanced/Installation.txt b/Documentation/doc/Documentation/advanced/Installation.txt index ab58f2a1083..933565ad78f 100644 --- a/Documentation/doc/Documentation/advanced/Installation.txt +++ b/Documentation/doc/Documentation/advanced/Installation.txt @@ -78,7 +78,7 @@ might need these \cgal-libraries and thus their dependencies. See the page \subsection installation_debugrelease Debug vs. Release The CMake variable `CMAKE_BUILD_TYPE` indicates how to build the executables. -It accepts the values `Debug` or `Release`. Note that the default value is `Debug`, since it is +It accepts the values `Debug` or `Release`. Note that the default value is an empty string, since it is default value in `CMake`. If you do not plan on debugging, it is important to set the variable to `Release` for performance reasons. @@ -137,7 +137,9 @@ Providing information and pressing *Configure* goes on until all entries are grayed. You are now ready to press *Generate*. Once this is done, you can quit `cmake-gui`. -If you do not need to debug, you should set the variable `CMAKE_BUILD_TYPE` to `Release`. +Without an explicit `CMAKE_BUILD_TYPE`, `CMake` does not add any additional build flags. +This will result in a default build without any debug symbols, and without any optimizations. +You should set the variable `CMAKE_BUILD_TYPE` to `Debug` to compile with debug symbols, or `Release` to enable optimizations. \subsection installation_configuring_cmd Configuring CGAL with the cmake Command-Line Tool diff --git a/Documentation/doc/Documentation/main.txt b/Documentation/doc/Documentation/main.txt index 085a2ad83b6..2026356b76c 100644 --- a/Documentation/doc/Documentation/main.txt +++ b/Documentation/doc/Documentation/main.txt @@ -35,7 +35,7 @@ Head over to \ref general_intro to learn how to obtain, install, and use \cgal. \cgal is distributed under a dual-license scheme. \cgal can be used together with Open Source software free of charge. Using \cgal in other contexts can be done by obtaining a commercial license from -[GeometryFactory](http://www.geometryfactory.com). For more details +[GeometryFactory](https://www.geometryfactory.com). For more details see the \ref license "License" page.

Acknowledgement

diff --git a/Documentation/doc/biblio/cgal_manual.bib b/Documentation/doc/biblio/cgal_manual.bib index 1c49fe6ffd2..34858e1e6b3 100644 --- a/Documentation/doc/biblio/cgal_manual.bib +++ b/Documentation/doc/biblio/cgal_manual.bib @@ -8,7 +8,7 @@ % - Entries are sorted alphabetically by their key % % - The key is created following the same rules as geombib, see -% http://compgeom.cs.uiuc.edu/~jeffe/compgeom/biblios.html +% https://jeffe.cs.illinois.edu/teaching/compgeom/ % % Here are roughly the rules: % initials of authors' last names '-' initials of 5 first title words @@ -264,7 +264,7 @@ Boissonnat} pages = {67--91}, volume = {4}, issue = {1}, - url = {http://dx.doi.org/10.1007/s11786-010-0043-4}, + url = {https://dx.doi.org/10.1007/s11786-010-0043-4}, year = {2010} } @@ -279,7 +279,7 @@ Boissonnat} pages = {45--66}, volume = {4}, issue = {1}, - url = {http://dx.doi.org/10.1007/s11786-010-0042-5}, + url = {https://dx.doi.org/10.1007/s11786-010-0042-5}, year = {2010} } @@ -335,8 +335,8 @@ Boissonnat} ,author = {Gavin Bell and Anthony Parisi and Mark Pesce} ,title = {VRML The Virtual Reality Modeling Language: Version 1.0 Specification} - ,howpublished = {\url{http://www.web3d.org/standards}} - ,url = "http://www.web3d.org/standards" + ,howpublished = {\url{https://www.web3d.org/standards}} + ,url = "https://www.web3d.org/standards" ,month = {May 26} ,year = 1995 ,update = "13.04 lrineau" @@ -674,7 +674,7 @@ Mourrain and Monique Teillaud" year = "1996", issn = "0377-2217", doi = "DOI: 10.1016/0377-2217(94)00366-1", - url = "http://www.sciencedirect.com/science/article/B6VCT-3VW8NPR-11/2/3cf4525c68d79c055676541418264043", + url = "https://www.sciencedirect.com/science/article/abs/pii/0377221794003661", keywords = "Convex hull problem, Frame, Linear programming, Data envelopment analysis, Redundancy" } @@ -791,7 +791,7 @@ Teillaud" @Misc{ cgal:e-esmr, title = {{EPFL} statue model repository}, howpublished = {{EPFL} Computer Graphics and Geometry Laboratory}, - url = {http://lgg.epfl.ch/statues_dataset.php} + url = {https://lgg.epfl.ch/statues_dataset.php} } @inproceedings{ cgal:eddhls-maam-95 @@ -995,7 +995,7 @@ Teillaud" ,number = {B 98-05} ,year = 1998 ,month = apr - ,url = {http://www.inf.fu-berlin.de/inst/pubs/tr-b-98-05.abstract.html} + ,url = {https://www.inf.fu-berlin.de/inst/pubs/tr-b-98-05.abstract.html} ,update = "98.06 schoenherr" } @@ -1008,7 +1008,7 @@ Teillaud" ,number = {B 98-04} ,year = 1998 ,month = apr - ,url = {http://www.inf.fu-berlin.de/inst/pubs/tr-b-98-04.abstract.html} + ,url = {https://www.inf.fu-berlin.de/inst/pubs/tr-b-98-04.abstract.html} ,update = "98.06 schoenherr" } @@ -1020,7 +1020,7 @@ Teillaud" ,number = {B 97-03} ,year = 1997 ,month = jun - ,url = {http://www.inf.fu-berlin.de/inst/pubs/tr-b-97-03.abstract.html} + ,url = {https://www.inf.fu-berlin.de/inst/pubs/tr-b-97-03.abstract.html} ,update = "97.06 schoenherr, 98.02 schoenherr, 98.06 schoenherr" } @@ -1061,7 +1061,7 @@ Teillaud" ,edition = {1.0.1} ,month = {June} ,year = {1999} - ,url = {http://clisp.cons.org/~haible/packages-cln.html} + ,url = {https://www.ginac.de/CLN/} ,update = "99.06 pion" } @@ -1297,7 +1297,7 @@ Teillaud" (full paper will be available shortly)}, YEAR = {2005}, MONTH = {November}, - URL = {http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics} + URL = {https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics} } @Article{ cgal:l-tmbrc-91, @@ -1555,7 +1555,7 @@ TITLE = {Intersecting Quadrics\,: An Efficient and Exact Implementation}, BOOKTITLE = {{ACM Symposium on Computational Geometry - SoCG'2004, Brooklyn, NY}}, YEAR ={ 2004}, MONTH ={ Jun}, -URL = {http://www.loria.fr/publications/2004/A04-R-021/A04-R-021.ps}, +URL = {https://www.loria.fr/publications/2004/A04-R-021/A04-R-021.ps}, ABSTRACT = {We present the first complete, exact and efficient C++ implementation of a method for parameterizing the intersection of two implicit quadrics with integer coefficients of arbitrary size. It is based on the near-optimal algorithm recently introduced by Dupont et al.~\cite{dupont03a}. Unlike existing implementations, it correctly identifies and parameterizes all the connected components of the intersection in all the possible cases, returning parameterizations with rational functions whenever such parameterizations exist. In addition, the coefficient field of the parameterizations is either minimal or involves one possibly unneeded square root.}, } @@ -1567,9 +1567,9 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio booktitle = {SEA}, year = {2009}, pages = {209-220}, - ee = {http://dx.doi.org/10.1007/978-3-642-02011-7_20}, + ee = {https://link.springer.com/chapter/10.1007/978-3-642-02011-7_20}, crossref = {cgal:v-ea-09}, - bibsource = {DBLP, http://dblp.uni-trier.de}, + bibsource = {DBLP, https://dblp.org/}, update = "09.11 penarand" } @@ -1582,8 +1582,8 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio year = "2011", note = "Advances in \{LIDAR\} Data Processing and Applications ", issn = "0924-2716", - doi = "http://dx.doi.org/10.1016/j.isprsjprs.2011.09.008", - url = "http://www.sciencedirect.com/science/article/pii/S0924271611001055", + doi = "https://dx.doi.org/10.1016/j.isprsjprs.2011.09.008", + url = "https://www.sciencedirect.com/science/article/abs/pii/S0924271611001055?via%3Dihub", author = "Clément Mallet and Frédéric Bretar and Michel Roux and Uwe Soergel and Christian Heipke" } @@ -1688,7 +1688,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio volume = {33}, number = {5}, issn = {1467-8659}, - url = {http://dx.doi.org/10.1111/cgf.12446}, + url = {https://onlinelibrary.wiley.com/doi/10.1111/cgf.12446}, doi = {10.1111/cgf.12446}, pages = {205--215}, year = {2014} @@ -1715,7 +1715,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio ,title = {The {LEDA} {U}ser {M}anual} ,organization = {Max-Planck-Insitut f\"ur Informatik} ,address = {66123 Saarbr\"ucken, Germany} - ,url = {http://www.mpi-sb.mpg.de/LEDA/leda.html} + ,url = {https://domino.mpi-inf.mpg.de/internet/reports.nsf/efc044f1568a0058c125642e0064c817/cff150e000ddc461c12562a80045cb82/$FILE/MPI-I-95-1-002.pdf} ,update = "99.05 schirra, 00.09 hert" } @@ -1724,7 +1724,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio ,title = {The {LEDA} {U}ser {M}anual} ,organization = {Algorithmic Solutions} ,address = {66123 Saarbr\"ucken, Germany} - ,url = {http://www.algorithmic-solutions.info/leda_manual/MANUAL.html} + ,url = {https://www.algorithmic-solutions.info/leda_manual/MANUAL.html} } @article{ cgal:mog-vbcfe-11 @@ -1979,7 +1979,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio title = {{MPFI} - The Multiple Precision Floating-Point Interval Library}, howpublished = {{R}evol, {N}athalie and {R}ouillier, {F}abrice}, - url = {http://perso.ens-lyon.fr/nathalie.revol/software.html}, + url = {https://perso.ens-lyon.fr/nathalie.revol/software.html}, update = "09.11 penarand" } @@ -2022,7 +2022,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio ,journal = "Comput. Geom. Theory Appl." , volume = 38 , pages = "100--110" - , url = "http://dx.doi.org/10.1016/j.comgeo.2006.11.008" + , url = "https://www.sciencedirect.com/science/article/pii/S0925772107000193?via%3Dihub" , publisher = "Elsevier Science Publishers B. V." ,update = "09.02 lrineau" } @@ -2298,8 +2298,8 @@ location = {Salt Lake City, Utah, USA} volume = {5526}, year = {2009}, isbn = {978-3-642-02010-0}, - ee = {http://dx.doi.org/10.1007/978-3-642-02011-7}, - bibsource = {DBLP, http://dblp.uni-trier.de}, + ee = {https://link.springer.com/book/10.1007/978-3-642-02011-7}, + bibsource = {DBLP, https://dblp.org/}, update = "09.11 penarand" } @@ -2368,7 +2368,7 @@ location = {Salt Lake City, Utah, USA} ,key = {VRML2} ,title = {The Virtual Reality Modeling Language Specification: Version 2.0, {ISO}/{IEC} {CD} 14772} - ,url = {http://www.web3d.org/documents/specifications/14772/V2.0/index.html} + ,url = {https://www.web3d.org/documents/specifications/14772/V2.0/index.html} ,month = {December} ,year = 1997 ,update = "13.04 lrineau" @@ -2503,7 +2503,6 @@ location = {Salt Lake City, Utah, USA} editor = "L{\'{a}}szl{\'{o}} Szirmay Kalos", pages = "210--218", year = "1998", - url = "http://citeseer.ist.psu.edu/article/felkel98straight.html" } @inproceedings{ cgal:ee-rrccpp-98, @@ -2512,7 +2511,7 @@ location = {Salt Lake City, Utah, USA} booktitle = "Symposium on Computational Geometry", pages = "58--67", year = "1998", - url = "http://citeseer.ist.psu.edu/eppstein98raising.html" + url = "https://jeffe.cs.illinois.edu/pubs/cycles.html" } @inproceedings{ cgal:ld-agrm-03, @@ -2525,11 +2524,9 @@ booktitle = {The 11-th International Conference in Central Europe year = 2003, volume = 11, issn = {ISSN 1213-6972}, -url = "http://wscg.zcu.cz/wscg2003/Papers_2003/G67.pdf" +url = "https://wscg.zcu.cz/wscg2003/Papers_2003/G67.pdf" } - - @InProceedings{cgal:k-vdc-06, author = {Menelaos I. Karavelas}, title = {Voronoi diagrams in {\sc Cgal}}, @@ -2576,7 +2573,7 @@ year = {1998}, pages = {69-79}, ee = {http://link.springer.de/link/service/series/0558/bibs/1766/17660069.htm}, crossref = {cgal:jlm-isgp-98}, -bibsource = {DBLP, http://dblp.uni-trier.de}, +bibsource = {DBLP, https://dblp.org/}, url = "https://www.boost.org/community/exception_safety.html" } @@ -2624,7 +2621,7 @@ url = "https://www.boost.org/community/exception_safety.html" volume = {1766}, year = {2000}, isbn = {3-540-41090-2}, - bibsource = {DBLP, http://dblp.uni-trier.de} + bibsource = {DBLP, https://dblp.org/} } @inproceedings{Kazhdan06, @@ -2719,14 +2716,14 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni AUTHOR = {Otfried Cheong}, EDITION = {6.0pre32}, YEAR = {2009}, - URL = {http://ipe.otfried.org/} + URL = {https://ipe.otfried.org/} } @misc{cgal:t-ocdl-05, key = "opcode", author = {P. Terdiman}, title = "{{OPCODE 3D} Collision Detection library}", - note = "http://www.codercorner.com/Opcode.htm", + note = "https://www.codercorner.com/Opcode.htm", year = {2005} } @@ -2806,7 +2803,7 @@ ADDRESS = "Saarbr{\"u}cken, Germany" @misc{abbott-qir-06, author = "J. Abbott", title = "Quadratic Interval Refinement for Real Roots", - URL = "http://www.dima.unige.it/~abbott/", + URL = "https://www.dima.unige.it/~abbott/", year= "2006", note = "Poster presented at the 2006 Int.\ Symp.\ on Symb.\ and Alg.\ Comp.\ (ISSAC 2006)"} @@ -3035,9 +3032,9 @@ pages = "458--473" booktitle = {FOCS}, year = {1985}, pages = {155-164}, - ee = {http://doi.ieeecomputersociety.org/10.1109/SFCS.1985.65}, + ee = {https://doi.ieeecomputersociety.org/10.1109/SFCS.1985.65}, crossref = {DBLP:conf/focs/FOCS26}, - bibsource = {DBLP, http://dblp.uni-trier.de} + bibsource = {DBLP, https://dblp.org/} } @article{dtl-voasp-83, @@ -3061,8 +3058,8 @@ pages = "207--221" volume = {abs/1403.3905}, url = {https://arxiv.org/abs/1403.3905}, timestamp = {Wed, 17 Sep 2014 16:30:16 +0200}, - biburl = {http://dblp.uni-trier.de/rec/bib/journals/corr/BungiuHHHK14}, - bibsource = {dblp computer science bibliography, http://dblp.org} + biburl = {https://dblp.uni-trier.de/rec/bib/journals/corr/BungiuHHHK14}, + bibsource = {dblp computer science bibliography, https://dblp.org/} } @book{botsch2010PMP, diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib index 270f537e139..3a19d0dccbb 100644 --- a/Documentation/doc/biblio/geom.bib +++ b/Documentation/doc/biblio/geom.bib @@ -78,7 +78,7 @@ , title = "IRIT $6.0$ User's Manual" , organization = "Technion" , year = 1996 -, url = "http://www.cs.technion.ac.il/~irit" +, url = "https://www.cs.technion.ac.il/~irit" , update = "98.07 bibrelex" } @@ -1925,7 +1925,7 @@ cell neighborhood in $O(m)$ time." , type = "Project Proposal (U. S. Army Research Office grant DAAH04-96-1-0013)" , institution = "Center for Geometric Computing" , year = 1995 -, url = "http://www.cs.brown.edu/cgc/" +, url = "https://www.cs.brown.edu/cgc/" , update = "98.07 bibrelex, 97.03 tamassia" } @@ -6908,7 +6908,7 @@ cell neighborhood in $O(m)$ time." @misc{a-dcgs- , author = "Nina Amenta" , title = "Directory of Computational Geometry Software" -, url = "http://www.geom.umn.edu/software/cglist/" +, url = "https://www.geom.uiuc.edu/software/cglist/" , update = "97.03 tamassia" } @@ -13110,7 +13110,6 @@ It is highly suitable for parallelization." , institution = "INRIA" , address = "BP93, 06902 Sophia-Antipolis, France" , year = 1994 -, url = "http://www.inria.fr/RRRT/RR-2306" , precedes = "abdpy-esdus-97" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers" , abstract = "We propose a method to evaluate signs of $2\times 2$ and @@ -14473,7 +14472,7 @@ whereas standard (polynomial) splines do not. Contains pseudocode." , number = 4 , year = 1995 , pages = "568--572" -, url = "http://www.cs.brown.edu/cgc/papers/bclt-nmaaw-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bclt-nmaaw-95.ps.gz" , keywords = "algorithm animation, Java, Web, WWW, graph drawing, CGC, Brown" , update = "97.03 tamassia, 96.09 tamassia" } @@ -14485,7 +14484,7 @@ whereas standard (polynomial) splines do not. Contains pseudocode." , nickname = "AVI '96" , year = 1996 , pages = "203--212" -, url = "http://www.cs.brown.edu/cgc/papers/bclt-aawww-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bclt-aawww-96.ps.gz" , keywords = "algorithm animation, Java, Web, WWW, CGC, Brown" , update = "97.03 tamassia, 96.09 tamassia" } @@ -14496,7 +14495,7 @@ whereas standard (polynomial) splines do not. Contains pseudocode." , booktitle = "Proc. 12th Annu. ACM Sympos. Comput. Geom." , year = 1996 , pages = "C3--C4" -, url = "http://www.cs.brown.edu/cgc/papers/bclt-agaow-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bclt-agaow-96.ps.gz" , keywords = "algorithm animation, Java, Web, WWW, CGC, Brown" , cites = "bclt-nmaaw-95, ZZZ" , update = "97.11 bibrelex, 97.03 tamassia, 96.09 tamassia, 96.05 efrat" @@ -14509,7 +14508,7 @@ whereas standard (polynomial) splines do not. Contains pseudocode." , nickname = "AVI '96" , year = 1996 , pages = "248--250" -, url = "http://www.cs.brown.edu/cgc/papers/bclt-maas-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bclt-maas-96.ps.gz" , keywords = "algorithm animation, Java, Web, WWW, CGC, Brown" , update = "97.03 tamassia, 96.09 tamassia" } @@ -18585,7 +18584,6 @@ the interior. Contains pseudocode." , institution = "INRIA" , address = "BP93, 06902 Sophia-Antipolis, France" , year = 1995 -, url = "http://www.inria.fr/RRRT/RR-2626" , precedes = "bdds-cscot-97" , update = "99.11 bibrelex, 99.07 devillers, 98.11 devillers, 97.03 devillers, 96.01 devillers" , abstract = "This note presents a non trivial combination of two techniques previously used with randomized incremental algorithms: the lazy cleaning scheme \cite{bds-lric-94} to maintain structures with `non local' definition and the $O(n\log^{\star}n)$ acceleration when some additional information about the data is known \cite{s-sfira-91,cct-rpatd-92,d-rysoa-92}. Authors assume that the reader is somehow familiar with this techniques. @@ -21935,7 +21933,7 @@ where $d > 3 \sqrt 3$ denotes the distance between S and T." , number = 7 , year = 1998 , pages = "1--31" -, url = "http://www.cs.brown.edu/publications/jgaa/accepted/98/Biedl98.2.7.ps.gz" +, url = "https://www.cs.brown.edu/publications/jgaa/accepted/98/Biedl98.2.7.ps.gz" , succeeds = "b-nlbog-96" , update = "00.03 vismara" } @@ -23872,7 +23870,6 @@ In [BSBL93], the synthesis problem has been solved for a , address = "Valbonne, France" , month = apr , year = 1991 -, url = "http://www.inria.fr/RRRT/RR-1415" , keywords = "Delaunay triangulation, Voronoi diagrams, output-sensitive algorithms, shape reconstructions, shelling, tomography" , precedes = "bcdt-osc3d-91i, bcdt-oscdt-96" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.05 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers" @@ -23930,7 +23927,6 @@ of the output, and the extra storage is {$O(n)$}." , number = 2160 , institution = "INRIA" , year = 1994 -, url = "http://www-sop.inria.fr/RRRT/RR-2160.html" , precedes = "bcdkl-sppbd-99" , update = "99.11 devillers, 99.07 devillers, 98.03 mitchell" } @@ -24176,7 +24172,6 @@ must lie in the halfplanes delimited by the query lines." , address = "Sophia-Antipolis, France" , month = oct , year = 1990 -, url = "http://www.inria.fr/RRRT/RR-1293" , precedes = "bdp-cu3ct-91" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers, 93.09 milone+mitchell" } @@ -24203,7 +24198,6 @@ must lie in the halfplanes delimited by the query lines." , institution = "INRIA Sophia-Antipolis" , address = "Valbonne, France" , year = 1990 -, url = "http://www.inria.fr/RRRT/RR-1285" , succeeds = "bt-hrodt-86" , precedes = "bdsty-olgag-91i" , update = "99.11 bibrelex, 99.07 devillers, 98.07 bibrelex, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers, 93.09 milone+mitchell" @@ -24271,7 +24265,6 @@ arrangements of curves in the plane and others." , institution = "INRIA Sophia-Antipolis" , address = "Valbonne, France" , year = 1990 -, url = "http://www.inria.fr/RRRT/RR-1207" , keywords = "randomized algorithms, higher order Voronoi diagrams, dynamic algorithms" , succeeds = "bdt-olcho-90, bt-hrodt-86" , precedes = "bdt-schov-93" @@ -24430,7 +24423,7 @@ the computational geometry algorithms library CGAL." , address = "Valbonne, France" , month = apr , year = 1992 -, url = "http://www-sop.inria.fr/cgi-bin/wais_ra_sophia?question=1697" +, url = "https://www-sop.inria.fr/cgi-bin/wais_ra_sophia?question=1697" , keywords = "shape reconstruction, medical images, Delaunay triangulation" , update = "99.07 devillers, 95.09 devillers, 95.01 devillers, 93.09 held" } @@ -24643,7 +24636,6 @@ present a polynomial-time exact algorithm to solve this problem." , number = 3825 , institution = "INRIA" , year = 1999 -, url = "http://www.inria.fr/RRRT/RR-3825" , cites = "b-oafsi-95, bo-arcgi-79, bs-ealcs-99, bp-rpsis-, c-stsar-94, ce-oails-92, cs-arscg-89, afl-rracg-98, k-ah-92, lpt-rpqid-99, p-iaeia-99, ps-cgi-90, s-ri-99, y-tegc-97, y-rgc-97" , update = "00.03 devillers" , abstract = "We propose several @@ -25563,7 +25555,7 @@ present a polynomial-time exact algorithm to solve this problem." , number = "RT-INF-9-96" , institution = "Dip. Discipline Scientifiche, Sez. Informatica, Univ. Roma III" , year = 1996 -, url = "http://www.cs.brown.edu/cgc/papers/bdll-pcrt-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bdll-pcrt-96.ps.gz" , keywords = "graph drawing, proximity, CGC, Brown" , update = "97.03 tamassia" } @@ -26988,7 +26980,7 @@ and solids on dynamically evolving grids without remeshing." , title = "Optimal Compaction of Orthogonal Representations" , booktitle = "CGC Workshop on Geometric Computing" , year = 1998 -, url = "http://www.cs.brown.edu/cgc/cgc98/" +, url = "https://www.cs.brown.edu/cgc/cgc98/" , keywords = "graph drawing, planar, orthogonal" , update = "98.11 tamassia" } @@ -27016,7 +27008,7 @@ and solids on dynamically evolving grids without remeshing." , publisher = "Springer-Verlag" , year = 1997 , pages = "45--52" -, url = "http://www.cs.brown.edu/cgc/papers/bgt-gdtsw-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/bgt-gdtsw-97.ps.gz" , keywords = "graph drawing, system, WWW, orthogonal, planarization, CGC, Brown" , update = "98.07 vismara, 97.03 tamassia" } @@ -27448,7 +27440,6 @@ and solids on dynamically evolving grids without remeshing." , number = 3758 , institution = "INRIA" , year = 1999 -, url = "http://www.inria.fr/RRRT/RR-3758" , archive = "XXX:cs.CG/9907025" , cites = "h-bevv-56, bcddy-acchs-96" , update = "99.11 devillers" @@ -31078,7 +31069,7 @@ determinants." , publisher = "Springer-Verlag" , year = 1997 , pages = "63--75" -, url = "http://www.cs.brown.edu/cgc/papers/cgkt-oaars-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/cgkt-oaars-97.ps.gz" , keywords = "graph drawing, upward, tree, planar, straight-line, orthogonal, CGC, Brown" , update = "98.07 agarwal, 98.03 smid, 97.11 bibrelex, 97.03 tamassia" } @@ -31421,7 +31412,7 @@ determinants." , site = "Waterloo, Canada" , year = 1993 , pages = "67--72" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation, exact arithmetic" , cites = "m-cacau-89, dbs-gttd-92, fm-nsala-91, fv-eeacg-93, h-gsm-89, kln-edtur-91, m-vigau-88t, m-cacau-89, m-rfldd-90, m-rflp-89, fw-lnum-93, si-cvdom-89, f-pcg-93, ZZZ" , update = "98.11 bibrelex, 97.03 daniels, 93.09 milone+mitchell" @@ -31730,7 +31721,7 @@ determinants." , title = "Finding Basis Functions for Pyramidal Finite Elements" , booktitle = "CGC Workshop on Geometric Computing" , year = 1998 -, url = "http://www.cs.brown.edu/cgc/cgc98/" +, url = "https://www.cs.brown.edu/cgc/cgc98/" , update = "98.11 tamassia" } @@ -35104,7 +35095,7 @@ The algorithms can be extended to 3D with more complex data structures." , booktitle = "Proc. 6th ACM-SIAM Sympos. Discrete Algorithms" , year = 1995 , pages = "139--149" -, url = "http://www.cs.brown.edu/cgc/papers/cggtvv-emga-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/cggtvv-emga-95.ps.gz" , update = "97.03 tamassia, 95.05 tamassia, 95.01 tamassia" } @@ -35159,7 +35150,7 @@ The algorithms can be extended to 3D with more complex data structures." , volume = 25 , year = 1996 , pages = "207--233" -, url = "http://www.cs.brown.edu/cgc/papers/cpt-uadpl-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/cpt-uadpl-96.ps.gz" , succeeds = "cpt-uadpl-93" , update = "97.03 tamassia, 96.05 smid, 95.01 tamassia" } @@ -35259,7 +35250,7 @@ The algorithms can be extended to 3D with more complex data structures." , volume = 7 , year = 1997 , pages = "85--121" -, url = "http://www.cs.brown.edu/cgc/papers/ct-ospml-.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ct-ospml-.ps.gz" , keywords = "Shortest Path, Minimum-Link Path, dynamic algorithm, CGC, Brown" , succeeds = "ct-ospml-94i" , update = "98.07 mitchell, 97.11 bibrelex, 97.07 devillers, 97.03 tamassia, 96.09 tamassia, 95.01 tamassia" @@ -36242,7 +36233,7 @@ avoids overlap. This is useful in cartography." , booktitle = "Proc. 12th Annu. ACM Sympos. Comput. Geom." , year = 1996 , pages = "319--328" -, url = "http://www.cs.brown.edu/cgc/papers/cgt-cdgtt-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/cgt-cdgtt-96.ps.gz" , keywords = "graph drawing, straight-line, 3D, convex, CGC, Brown" , cites = "a-lbvsc-63, bh-olpgf-87, bo-lwbl-87, con-dpgn-85, cyn-lacdp-84, ck-cgd3c-93, cn-mwgdp-95, cp-ltadp-95, celr-tdgd-95, c-re-82, cw-mmap-90, cw-sfmps-82, dg-caitd-95, fpp-sssfe-88, fpp-hdpgg-90, dett-adgab-94, dtt-arsdp-92, dtv-olcpt-95, ds-ltati-92, eg-dspg-96, esw-tkbtd-95, f-slrpg-48, fhhklsww-dgphr-93, gt-pdara-94, gt-anda-87, g-cp-67, hr-udfs-94, hrs-cchpc-92, ht-dgtc-73, ht-ept-74, hk-prga-92, jj-3dlrg-95, k-dpguc-96, k-dpgul-92, ls-cavg-92, ld-cpdt3-95, lrt-gnd-79, lt-apst-80, mp-arpg-94, m-orfdf-64, ps-cgi-85, r-3dvpi-95, r-e3vpi-95, s-epgg-90, st-ce3cp-92, s-cm-51, sr-vudtd-34, t-pdfip-80, t-prg-84, t-crg-60, t-hdg-63, w-mspp-82, ZZZ" , update = "98.11 bibrelex, 97.11 bibrelex, 97.03 tamassia, 96.09 tamassia" @@ -37879,7 +37870,7 @@ data. Contains C code." , number = 5 , year = 1995 , pages = "970--1001" -, url = "http://www.cs.brown.edu/cgc/papers/cdtt-dgdts-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/cdtt-dgdts-95.ps.gz" , keywords = "graph drawing, dynamic, planar, trees, series-parallel" , succeeds = "cdttb-fdgd-92" , update = "97.03 tamassia, 96.09 tamassia, 95.09 tamassia, 95 tamassia" @@ -37972,7 +37963,7 @@ data. Contains C code." , volume = 13 , year = 1995 , pages = "245--265" -, url = "http://www.cs.brown.edu/cgc/papers/ct-det-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ct-det-95.ps.gz" , succeeds = "ct-detta-91" , update = "97.03 tamassia, 95.01 tamassia, 95.01 tamassia" } @@ -41130,7 +41121,7 @@ Contains C code." , booktitle = "Proc. 1st ACM Workshop on Appl. Comput. Geom." , year = 1996 , pages = "33--38" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "layout, nesting, placement, Minkowski sum, configuration space" , comments = "to appear in Lecture Notes in Computer Science; submitted to Internat. J. Comput. Geom. Appl." @@ -41143,7 +41134,7 @@ Contains C code." , booktitle = "Proc. 6th Canad. Conf. Comput. Geom." , year = 1994 , pages = "225--230" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "layout, packing, nesting, placement, reachability, Minkowski sum, configuration space, decomposition" , cites = "dmr-fmaap-93, f-savd-87, l-tdvdl-80, lm-ccp-93, ZZZ" , update = "98.11 bibrelex, 97.03 daniels, 94.09 jones" @@ -41155,7 +41146,7 @@ Contains C code." , booktitle = "Proc. 6th ACM-SIAM Sympos. Discrete Algorithms" , year = 1995 , pages = "205--214" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "packing, layout, placement, nesting, Minkowski sum, configuration space" , update = "97.03 daniels, 96.09 agarwal, 96.05 mitchell" } @@ -41208,7 +41199,7 @@ Contains C code." , site = "Waterloo, Canada" , year = 1993 , pages = "322--327" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "optimization, monotone matrices, polygons, inclusion" , precedes = "dmr-flaap -97" , cites = "akmsw-gamsa-87, as-facle-87, aw-cg-88, c-tsplt-90i, cdl-cler-86, kk-altag-90, mos-fmrio-85, mdl-amm-91, mdl-pcnpc-92, ow-rv-88, ps-cgi-85, srw-gsv-cccg-91, nhl-merp-84, wy-ocsp-88, ZZZ" @@ -41221,7 +41212,7 @@ Contains C code." , booktitle = "Proc. 8th Canad. Conf. Comput. Geom." , year = 1996 , pages = "196--201" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "concave, polygons, decomposition" , update = "97.03 agarwal+daniels, 96.09 mitchell" } @@ -43601,7 +43592,7 @@ Contains C code." , month = aug , year = 2000 , pages = "??--??" -, url = "http://cs.smith.edu/~orourke/papers.html" +, url = "https://www.science.smith.edu/~jorourke/papers.php" , cites = "ddo-ppnph2d-00" , update = "01.04 icking, 00.11 smid, 00.07 orourke" } @@ -43682,7 +43673,7 @@ Contains C code." , month = jan , year = 1999 , pages = "891--892" -, url = "http://www.siam.org/meetings/da99/" +, url = "https://archive.siam.org/meetings/da99/" , update = "99.07 orourke" } @@ -43759,7 +43750,7 @@ Contains C code." , address = "Northampton, MA, USA" , month = oct , year = 2001 -, url = "http://arXiv.org/abs/cs/0110054/" +, url = "https://arxiv.org/abs/cs/0110054" , succeeds = "deeho-vusp-01" , update = "01.11 orourke" } @@ -43773,7 +43764,7 @@ Contains C code." , address = "Northampton, MA, USA" , month = jul , year = 2001 -, url = "http://arXiv.org/abs/cs/0107023/" +, url = "https://arXiv.org/abs/cs/0107023/" , update = "01.11 orourke" } @@ -44318,7 +44309,6 @@ Contains C code." , number = 3451 , institution = "INRIA" , year = 1998 -, url = "http://www.inria.fr/RRRT/RR-3451" , precedes = "d-ddt-99" , update = "99.11 bibrelex, 99.07 devillers, 98.11 devillers" , abstract = "This paper present how space of spheres and shelling can be used to delete efficiently a point from d-dimensional triangulation. In 2-dimension, if k is the degree of the deleted vertex, the complexity is $O(k\log k)$, but we notice that this number apply only to low cost operations; time consuming computations are done only a linear number of times. This algorithm can be viewed as a variation of Heller algorithm which is popular in the geographic information system community. Unfortunately Heller algorithm is false as explained in this paper." @@ -44382,7 +44372,6 @@ minimum spanning tree)." , institution = "INRIA Sophia-Antipolis" , address = "Valbonne, France" , year = 1992 -, url = "http://www.inria.fr/RRRT/RR-1619" , keywords = "randomized algorithms, Delaunay triangulation, practical issue, degenerate cases" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers" } @@ -44408,7 +44397,6 @@ minimum spanning tree)." , institution = "INRIA Sophia-Antipolis" , address = "Valbonne, France" , year = 1990 -, url = "http://www.inria.fr/RRRT/RR-1179" , keywords = "polygon placement, contact configurations" , precedes = "d-scspa-93" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers, 94.05 devillers" @@ -44740,7 +44728,6 @@ respectively, we obtain a speedup of $\frac p{\log p}$." , institution = "INRIA Sophia-Antipolis" , address = "Valbonne, France" , year = 1992 -, url = "http://www.inria.fr/RRRT/RR-1620" , precedes = "dmt-ssgtu-92i" , update = "99.11 bibrelex, 99.07 devillers, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers" } @@ -45657,7 +45644,7 @@ dimensions. Constants are small, and are given in the paper." , publisher = "Springer-Verlag" , year = 1997 , pages = "76--91" -, url = "http://www.cs.brown.edu/cgc/papers/dglpttvv-ddges-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dglpttvv-ddges-97.ps.gz" , keywords = "graph drawing, upward, experiments, CGC, Brown" , update = "98.07 patrignani+tamassia+vismara, 97.11 bibrelex, 97.03 tamassia" } @@ -45680,7 +45667,7 @@ dimensions. Constants are small, and are given in the paper." , type = "Manuscript" , institution = "Dept. of Computer Sci., Brown University" , year = 1996 -, url = "http://www.cs.brown.edu/cgc/papers/dglttv-ecfgd-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dglttv-ecfgd-96.ps.gz" , keywords = "graph drawing, experiments, orthogonal" , precedes = "dglttv-ecfgd-97" , update = "97.03 tamassia, 96.09 tamassia" @@ -45694,7 +45681,7 @@ dimensions. Constants are small, and are given in the paper." , volume = 7 , year = 1997 , pages = "303--325" -, url = "http://www.cs.brown.edu/cgc/papers/dglttv-ecfgd-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dglttv-ecfgd-96.ps.gz" , keywords = "graph drawing, experiments, orthogonal, CGC, Brown" , succeeds = "dglttv-ecfgd-96" , update = "98.07 patrignani+tamassia+vismara, 97.07 devillers, 97.03 tamassia, 96.09 tamassia" @@ -45706,7 +45693,7 @@ dimensions. Constants are small, and are given in the paper." , booktitle = "Proc. 11th Annu. ACM Sympos. Comput. Geom." , year = 1995 , pages = "306--315" -, url = "http://www.cs.brown.edu/cgc/papers/dglttv-ectgd-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dglttv-ectgd-95.ps.gz" , keywords = "graph drawing, experiments, orthogonal" , cites = "bcn-cdder-92, bfn-wigdp-85, bnt-ladfd-86, bbdl-tealf-91, bk-bhogd-94, con-dpgn-85, cp-ltadp-90, celr-tdgd-95, dh-dgnus-89, fpp-sssfe-88, fr-scpdt-84, dett-adgab-94, dgst-ads-90, dlv-sorod-93, dlt-pepg-84, eg-rpdfb-94, eg-glbdb-95, fr-gdfdp-91, gs-ssa-79, gnv-dptdd-88, h-celag-94, h-ggpig-95, jemwdt-npgda-91, jm-mpsne-96, k-vaor-89, kk-adgug-89, k-dpgul-92, k-adpg-93, k-mcvr-93, kb-pgap-92, l-aeglv-80, lmp-sbeac-94, lmps-trm1b-90, lms-gtrre-91, lms-la3be-93, nt-fapsd-84, pt-iabod-95, r-nmdpg-87, rt-rplbo-86, s-mncpe-84, stt-mvuhs-81, t-eggmn-87, tdb-agdrd-88, tt-uavrp-86, tt-pgelt-89, tt-gd-95, t-dgds-88, t-hdg-63, v-ucvc-81, w-npagt-90, w-cblsg-85, w-dpg-82, ZZZ" , update = "01.04 icking, 98.11 bibrelex, 98.03 bibrelex, 97.03 tamassia, 96.09 tamassia, 95.05 tamassia" @@ -45820,7 +45807,7 @@ dimensions. Constants are small, and are given in the paper." , publisher = "Springer-Verlag" , year = 1996 , pages = "178--189" -, url = "http://www.cs.brown.edu/cgc/papers/dlw-swp-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dlw-swp-96.ps.gz" , keywords = "graph drawing" , update = "98.11 bibrelex, 97.11 bibrelex, 97.03 tamassia, 96.09 tamassia" } @@ -45842,7 +45829,7 @@ dimensions. Constants are small, and are given in the paper." , journal = "J. Graph Algorithms Appl." , volume = "3:4" , year = 1999 -, url = "http://www.cs.brown.edu/publications/jgaa/papers.html" +, url = "https://www.cs.brown.edu/publications/jgaa/papers.html" , update = "00.03 vismara" } @@ -46114,7 +46101,7 @@ dimensions. Constants are small, and are given in the paper." , publisher = "Springer-Verlag" , year = 1996 , pages = "81--91" -, url = "http://www.cs.brown.edu/cgc/papers/dtv-osrdp-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/dtv-osrdp-96.ps.gz" , update = "99.11 bibrelex, 98.07 vismara, 97.03 tamassia" } @@ -48478,7 +48465,7 @@ conjecture posed by O'Rourke and Supowit \cite{os-snhpd-83}." , address = "Northampton, MA, USA" , month = oct , year = 2001 -, url = "http://arXiv.org/abs/cs/0110059/" +, url = "https://arXiv.org/abs/cs/0110059/" , comments = "Answers a question posed in bls-wcnfp-99" , update = "01.11 orourke" } @@ -49693,7 +49680,7 @@ library." , author = "E. Durand" , title = "Quasitiler 3.0 documentation" , year = 1994 -, url = "http//www.geom.umn.edu/apps/quasitiler/about.html" +, url = "http://www.geom.uiuc.edu/apps/quasitiler/about.html" , update = "97.11 bibrelex" } @@ -50766,7 +50753,7 @@ library." , volume = 6 , year = 1996 , pages = "145--156" -, url = "http://www.cs.brown.edu/cgc/papers/elt-adhg-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/elt-adhg-96.ps.gz" , succeeds = "elt-adhg-92" , update = "97.03 tamassia, 96.09 devillers" } @@ -54611,7 +54598,7 @@ algebraic geometry." @misc{e-ga- , author = "David Eppstein" , title = "Geometry in Action" -, url = "http://www.ics.uci.edu/~eppstein/geom.html" +, url = "https://www.ics.uci.edu/~eppstein/geom.html" , update = "97.03 tamassia" } @@ -55925,7 +55912,7 @@ between all the vertices of the polygons." , site = "Pacific Grove, CA" , year = 1994 , pages = "498--502" -, url = "http://ptolemy.eecs.berkeley.edu" +, url = "https://ptolemy.berkeley.edu/" , update = "98.03 bibrelex" } @@ -59800,7 +59787,7 @@ reflection formula and derives a surprising relationship between them." , month = jun , year = 1991 , pages = "334--341" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "arrangements, implementing algorithms, robust geometric computation" , cites = "cgl-pgd-83, eg-tsa-86, eos-calha-86, f-smpst-90, gt-tgt-87, g-as-72, gss-egbra-89, gs-pmgsc-85, h-pargc-89, hhk-tirgc-88, hk-prga-89, k-rmrs-89, lm-cschu-90, m-dpggt-89, m-vigau-88p, m-vigau-88a, m-utcpc-89, si-gafpa-88, si-cvd10-89, ZZZ" , update = "98.11 bibrelex, 97.11 bibrelex, 97.03 daniels" @@ -63930,7 +63917,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , volume = 6 , year = 1996 , pages = "333--356" -, url = "http://www.cs.brown.edu/cgc/papers/ggt-aoutd-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ggt-aoutd-96.ps.gz" , keywords = "graph drawing, tree, planar, upward" , succeeds = "ggt-aeutd-93" , update = "97.03 devillers+tamassia" @@ -63956,7 +63943,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , publisher = "Springer-Verlag" , year = 1997 , pages = "201--216" -, url = "http://www.cs.brown.edu/cgc/papers/gt-nmcfa-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gt-nmcfa-97.ps.gz" , keywords = "graph drawing, planar, orthogonal, grid" , update = "99.03 vismara, 97.03 tamassia, 96.09 tamassia" } @@ -63971,7 +63958,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , publisher = "Springer-Verlag" , year = 1994 , pages = "12--21" -, url = "http://www.cs.brown.edu/cgc/papers/gt-agd-94.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gt-agd-94.ps.gz" , keywords = "graph drawing" , update = "97.11 bibrelex, 97.03 tamassia, 94.05 tamassia" } @@ -63991,8 +63978,8 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , type = "Manuscript" , institution = "Dept. of Computer Sci., Brown University" , year = 1996 -, note = "Available at \url{http://www.cs.brown.edu/people/rt/fadiva/giotto3d.html}" -, url = "http://www.cs.brown.edu/people/rt/fadiva/giotto3d.html" +, note = "Available at \url{https://www.cs.brown.edu/people/rt/fadiva/giotto3d.html}" +, url = "https://www.cs.brown.edu/people/rt/fadiva/giotto3d.html" , keywords = "graph drawing, 3D" , update = "97.03 tamassia, 96.09 tamassia" } @@ -64015,7 +64002,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , series = "Lecture Notes Comput. Sci." , publisher = "Springer-Verlag" , year = 1997 -, url = "http://www.cs.brown.edu/cgc/papers/gt-gsvhs-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gt-gsvhs-97.ps.gz" , keywords = "graph drawing, upward, 3D, CGC, Brown" , update = "99.11 bibrelex, 97.03 tamassia" } @@ -64059,7 +64046,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , publisher = "Springer-Verlag" , year = 1995 , pages = "286--297" -, url = "http://www.cs.brown.edu/cgc/papers/gt-ccurp-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gt-ccurp-95.ps.gz" , keywords = "graph drawing, planar, upward, rectilinear, orthogonal, NP-hardness" , update = "97.03 tamassia, 95.01 tamassia" } @@ -64085,7 +64072,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , volume = 12 , year = 1995 , pages = "109--133" -, url = "http://www.cs.brown.edu/cgc/papers/gt-upt-95.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gt-upt-95.ps.gz" , keywords = "graph drawing, planar, upward, survey" , update = "97.03 tamassia, 96.09 tamassia, 95.09 tamassia, 95.05 tamassia" } @@ -64100,7 +64087,7 @@ Complete thesis available only on microfilm from Harvard, since Harvard did not , publisher = "Springer-Verlag" , year = 1996 , pages = "12--26" -, url = "http://www.cs.brown.edu/cgc/papers/gtv-dc-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/gtv-dc-96.ps.gz" , keywords = "graph drawing, 3D, straight-line" , update = "97.03 smid+tamassia" } @@ -68869,7 +68856,7 @@ generated in O(dn2d+1) time. We present a simple proof that the (d - , title = "{GMP}, The {GNU} Multiple Precision Arithmetic Library" , edition = "2.0.2" , year = 1996 -, url = "http://gmplib.org/" +, url = "https://gmplib.org/" , update = "02.03 devillers, 00.03 devillers" } @@ -70364,7 +70351,7 @@ cos, etc." , number = "Report B 96-11" , institution = "Institut {f\"ur} Informatik, Freie Universit{\"a}t Berlin" , year = 1996 -, url = "http://www.inf.fu-berlin.de/pub/reports/tr-b-96-11.ps.gz, http://www.inf.fu-berlin.de/inst/pubs/tr-b-96-11.abstract.html" +, url = "https://www.inf.fu-berlin.de/pub/reports/tr-b-96-11.ps.gz, https://www.inf.fu-berlin.de/inst/pubs/tr-b-96-11.abstract.html" , update = "98.03 mitchell" } @@ -73908,7 +73895,7 @@ useful for geometric modeling or for ray tracing." , title = "Algebraic Topology" , publisher = "Cambridge University Press" , year = 2001 -, url = "http://www.math.cornell.edu/~hatcher/" +, url = "https://www.math.cornell.edu/~hatcher/" , update = "01.11 orourke" } @@ -76153,7 +76140,7 @@ processing. Contains C code." , type = "Manuscript" , institution = "Universit{\"a}t Passau, Innstra\ss e 33, 94030 Passau, Germany" , year = 1996 -, url = "http://www.uni-passau.de/~himsolt/Graphlet/GML" +, url = "https://www.uni-passau.de/~himsolt/Graphlet/GML" , keywords = "graph drawing" , update = "96.09 tamassia" } @@ -84058,7 +84045,7 @@ fitting method." , number = 1 , year = 1997 , pages = "1--25" -, url = "http://www.cs.brown.edu/publications/jgaa/accepted/97/JuengerMutzel97.1.1.ps.gz" +, url = "https://www.cs.brown.edu/publications/jgaa/accepted/97/JuengerMutzel97.1.1.ps.gz" , keywords = "graph drawing, straight-line, planarization, crossings, experiments" , succeeds = "jm-eha2s-96" , update = "99.07 vismara, 98.07 tamassia+vismara" @@ -84900,7 +84887,7 @@ fitting method." , month = aug , year = 2000 , pages = "139--146" -, url = "http://cs.smith.edu/~orourke/ShortestPaths/" +, url = "https://www.science.smith.edu/~jorourke/ShortestPaths//" , keywords = "shortest paths" , update = "02.03 icking, 01.11 orourke, 01.04 icking+orourke, 00.11 smid, 00.07 orourke" } @@ -85234,7 +85221,7 @@ fitting method." , number = 2 , year = 1997 , pages = "81--88" -, url = "http://www.cs.brown.edu/cgc/papers/kltt-arvrt-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/kltt-arvrt-97.ps.gz" , keywords = "graph drawing, visibility, tree, CGC, Brown" , update = "98.11 tamassia, 97.03 tamassia" } @@ -86661,7 +86648,6 @@ the R*-tree." , number = 2874 , institution = "INRIA" , year = 1996 -, url = "http://www.inria.fr/rrrt/rr-2874.html" , update = "02.03 devillers, 97.11 bibrelex" , abstract = "A set of objects is $k$-pierceable if there exists a set of $k$ poin ts such that each object is pierced by (contains) at least one of these points. Finding the smallest integer $k$ such that a set is $k$-pierceable is NP-complete. In this technical report, we present efficient algorithms for findi ng a piercing set (i.e., a set of $k$ points as above) for several classes of convex objects and small values of $k$. In some of the cases, our algorithms imply known as well as new Helly-type theorems, thus adding to previous results of Danzer and Gr{\"u}nbaum who studied the case of axis-parallel boxes. The problems studied here are related to the collection of optimization problems in which one seeks the smallest scaling factor of a centrally symmetric convex object $K$, so that a set of points can be covered by $k$ congruent homothets of $K$." } @@ -91777,7 +91763,7 @@ some 2 curves cross exponentially many times." , nickname = "WAFR '98" , year = 1998 , pages = "to appear" -, url = "http://www.cs.unc.edu/~dm/collision.html" +, url = "https://www.cs.unc.edu/~dm/collision.html" , update = "98.11 bibrelex, 98.07 bibrelex, 98.03 mitchell" } @@ -95357,7 +95343,7 @@ addition to their own purposes before conducting the conversion." , number = 5 , year = 1996 , pages = "253--260" -, url = "http://www.cs.brown.edu/cgc/papers/ll-domwt-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ll-domwt-96.ps.gz" , keywords = "graph drawing, planar, minimum weight triangulation" , update = "98.11 tamassia, 97.03 tamassia, 96.01 liotta" } @@ -95372,7 +95358,7 @@ addition to their own purposes before conducting the conversion." , publisher = "Springer-Verlag" , year = 1996 , pages = "373--384" -, url = "http://www.cs.brown.edu/cgc/papers/ll-hdomw-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ll-hdomw-96.ps.gz" , keywords = "graph drawing" , update = "97.03 tamassia, 96.09 tamassia" } @@ -95399,7 +95385,7 @@ addition to their own purposes before conducting the conversion." , publisher = "Springer-Verlag" , year = 1997 , pages = "286--302" -, url = "http://www.cs.brown.edu/cgc/papers/ll-pdog-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/ll-pdog-97.ps.gz" , keywords = "graph drawing, proximity, CGC, Brown" , update = "98.07 tamassia, 97.03 tamassia" } @@ -96347,7 +96333,7 @@ addition to their own purposes before conducting the conversion." , booktitle = "Proc. 9th Annu. ACM Sympos. Comput. Geom." , year = 1993 , pages = "153--162" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "optimization, CAD, CAM, packing, layout, linear programming, motion planning, separation, configuration space, Minkowski sum" , cites = "aks-oa1dt-90, b-amdsn-89, bb-msbdc-88, c-crmp-87, dhks-isccd-90, grs-kfcg-83, hss-cmpmi-84, kos-cmsrp-91i, l-sisri-84, m-hphc-90, mdl-amm-91, mdl-pcnpc-92, mw-cdrca-88, mfs-2dcmc-87, p-ccmsp-87, pb-cmfm-88, sss-tdczr-86, sp-cppca-92, w-otdcs-85, ZZZ" , update = "98.07 bibrelex, 98.03 bibrelex, 97.03 daniels, 93.09 rote" @@ -96360,7 +96346,7 @@ addition to their own purposes before conducting the conversion." , volume = 84 , year = 1995 , pages = "539--561" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "layout, packing, placement, linear programming, motion planning, Minkowski sum, configuration space" , update = "97.03 daniels" } @@ -96371,7 +96357,7 @@ addition to their own purposes before conducting the conversion." , booktitle = "Proc. 6th Annu. ACM Sympos. Comput. Geom." , year = 1990 , pages = "235--243" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , precedes = "lm-cschu-92" , cites = "f-smpst-89, g-eadch-72, gss-egbra-89, m-cacau-89, m-dpggt-89, m-vigau-88p, si-cvd10-89, ZZZ" @@ -96385,7 +96371,7 @@ addition to their own purposes before conducting the conversion." , volume = 8 , year = 1992 , pages = "345--364" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , succeeds = "lm-cschu-90" , update = "97.03 daniels" @@ -96398,7 +96384,7 @@ addition to their own purposes before conducting the conversion." , site = "Waterloo, Canada" , year = 1993 , pages = "7--11" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "packing, layout, motion planning, PSPACE" , cites = "cosw-cds-84, hss-cmpmi-84, lm-cancp-93, ZZZ" , update = "98.11 bibrelex, 98.03 mitchell, 97.03 daniels, 93.09 milone+mitchell" @@ -97363,7 +97349,7 @@ rectilinear polygon." , publisher = "Springer-Verlag" , year = 1997 , pages = "135--146" -, url = "http://www.cs.brown.edu/cgc/papers/lttv-argd-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/lttv-argd-97.ps.gz" , keywords = "graph drawing, proximity, CGC, Brown" , update = "98.07 tamassia, 97.03 tamassia" } @@ -104690,7 +104676,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 5th Annu. ACM Sympos. Comput. Geom." , year = 1989 , pages = "197--207" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , cites = "acm-aacad-88, acm-cad1b-84, acm-cad2a-84, c-qercf-75, cr-tlcra-88, em-sstcd-87, gy-frcg-86, hhk-tirgc-88, hhk-rsops-87, h-pargc-88, k-rmrs-89, kln-edtur-89, m-vigau-88a, m-vigau-88t, otu-nsga-87, r-paff-80, gss-egbra-89, ss-pmp2g-83, ss-ccsm-85, ss-pponp-88, s-aefsm-87, t-dmeag-51, y-gctsp-88, ZZZ" , update = "98.03 bibrelex, 97.03 daniels" @@ -104702,7 +104688,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 30th Annu. IEEE Sympos. Found. Comput. Sci." , year = 1989 , pages = "500--505" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , update = "98.03 agarwal, 97.03 daniels" } @@ -104713,7 +104699,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 7th Canad. Conf. Comput. Geom." , year = 1995 , pages = "79--84" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "computer graphics, simulation, physically-based modeling, linear programming, Minkowski sum, configuration space" , update = "97.03 daniels, 95.09 jones" } @@ -104725,7 +104711,7 @@ used in many computational geometry algorithms. Contains C++ code." , year = 1996 , pages = "129--136" , note = "Proc. SIGGRAPH '96" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "computer graphics, animation, physically-based modeling, linear programming, Minkowski sum, configuration space" , update = "97.03 daniels" } @@ -104737,7 +104723,7 @@ used in many computational geometry algorithms. Contains C++ code." , site = "Waterloo, Canada" , year = 1993 , pages = "473--478" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , cites = "ck-acp-70, b-tends-67, cs-arscg-89, e-acg-87, f-smpst-90, f-savd-87, fm-nsala-91, ghms-apsml-91, hhk-tirgc-88, iss-nriac-92, l-knnvd-82, ld-gvdp-81, lm-cschu-90, m-vigau-88a, m-cacau-89, ms-saps-92, sh-cpp-75, si-cvd10-89, ls-ippvd-87, ls-pptmc-87, m-dpggt-89, ZZZ" , update = "98.11 bibrelex, 97.03 daniels, 93.09 milone+mitchell" @@ -104750,7 +104736,7 @@ used in many computational geometry algorithms. Contains C++ code." , volume = 25 , number = 9 , year = 1993 -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "algorithms, polygons, geometric modeling" , update = "98.03 agarwal, 97.03 daniels, 96.05 pascucci" } @@ -104771,7 +104757,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 2nd Canad. Conf. Comput. Geom." , year = 1990 , pages = "40--45" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation, geometric rounding" , cites = "ZZZ" , update = "98.07 bibrelex, 97.03 daniels" @@ -104783,7 +104769,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Abstracts 1st Canad. Conf. Comput. Geom." , year = 1989 , pages = 12 -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation, geometric rounding" , update = "97.03 daniels" } @@ -104794,7 +104780,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 28th Annu. ACM Sympos. Theory Comput." , year = 1996 , pages = "109--118" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "layout, packing, placement, nesting, concave, polygons, Minkowski sum, configuration space" , update = "97.03 daniels" } @@ -104857,7 +104843,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 3rd Canad. Conf. Comput. Geom." , year = 1991 , pages = "243--246" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "layout, nesting, placement, optimization" , update = "97.03 daniels" } @@ -104868,7 +104854,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 4th Canad. Conf. Comput. Geom." , year = 1992 , pages = "236--243" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "concave, polygons, layout, nesting, packing, optimization, Minkowski sum, configuration space" , cites = "dhks-isccd-90, g-ctfsr-86, grs-kfcg-83, kos-cmsrp-91i, ml-sipat-91, mdl-amm-91, s-iamm-82, tw-cmm-73, nh-aplpg-84, s-iamm-88, ZZZ" , update = "98.07 bibrelex, 97.03 daniels" @@ -104881,7 +104867,7 @@ used in many computational geometry algorithms. Contains C++ code." , site = "Waterloo, Canada" , year = 1993 , pages = "485--490" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "geometric modeling, quaternion arithmetic, basis reduction, integer programming, exact arithmetic" , precedes = "mm-roaom-97" , cites = "cdr-rrmrg-92, c-sede-92, crss-igbra-91, e-sap-80, fw-eeacg-92, h-eq-69, kln-edtur-89, mn-fccrp-90a, m-rfldd-90, r-srsrf-77, lll-fprc-82, l-atngc-86, ls-gbra-92, m-rflp-89, s-qrm-78" @@ -104894,7 +104880,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 6th Annu. ACM Sympos. Comput. Geom." , year = 1990 , pages = "244--252" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , precedes = "mn-fccrp-90a" , cites = "gj-cigtn-79, gps-crotr-89, h-gsm-89, m-rflp-89, mn-fccrp-90a, m-utcpc-89, s-fprgo-89, tt-pgelt-89, ZZZ" @@ -104910,7 +104896,7 @@ used in many computational geometry algorithms. Contains C++ code." , month = sep , year = 1990 , pages = "753--769" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , succeeds = "mn-fccrp-90i" , update = "98.11 bibrelex, 97.03 daniels" @@ -104943,7 +104929,7 @@ used in many computational geometry algorithms. Contains C++ code." , booktitle = "Proc. 7th Canad. Conf. Comput. Geom." , year = 1995 , pages = "55--60" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation, shortest-path rounding, nonuniform grids, geometric modeling, geometric rounding" , update = "97.03 daniels, 95.09 jones" } @@ -104989,7 +104975,7 @@ used in many computational geometry algorithms. Contains C++ code." , volume = 37 , year = 1988 , pages = "377--401" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "robust geometric computation" , succeeds = "m-vigau-88p, m-vigau-88t" , update = "98.11 bibrelex, 97.03 daniels, 95.01 devillers" @@ -105010,7 +104996,7 @@ used in many computational geometry algorithms. Contains C++ code." , volume = 7 , year = 1997 , pages = "25--35" -, url = "http://www.cs.miami.edu/~vjm/papers.html" +, url = "https://www.cs.miami.edu/home/vjm/papers.html" , keywords = "geometric modeling, quaternion arithmetic, basis reduction, integer programming, exact arithmetic" , succeeds = "mm-roaom-93" , update = "97.03 daniels" @@ -109344,11 +109330,11 @@ problems in computational geometry is presented." , update = "96.01 held+mitchell" } -@article{nan2017polyfit, - title = {PolyFit: Polygonal Surface Reconstruction from Point Clouds}, - author = {Nan, Liangliang and Wonka, Peter}, - journal = {ICCV}, - year = {2017} +@article{nan2017polyfit, + title = {PolyFit: Polygonal Surface Reconstruction from Point Clouds}, + author = {Nan, Liangliang and Wonka, Peter}, + journal = {ICCV}, + year = {2017} } @article{nhl-merp-84 @@ -110721,7 +110707,6 @@ envelope of line segments." , number = 1 , year = 1998 , pages = "39--66" -, url = "http://www.inria.fr/RRRT/RR-2575" , succeeds = "ny-oscha-94" , update = "99.11 bibrelex, 99.07 devillers, 98.07 devillers" , abstract = "A set of planar objects is said to be of type $m$ if the @@ -111527,7 +111512,6 @@ encapsulated PostScript" , address = "France" , year = 1998 , note = "TU-0606" -, url = "http://www.inria.fr/RRRT/TU-0606" , keywords = "doctoral thesis" , update = "00.03 devillers" } @@ -113167,7 +113151,7 @@ small) triangulation of a convex polyhedron is NP-complete. Their 3SAT-reduction , edition = "2nd" , publisher = "Cambridge University Press" , year = 1998 -, url = "http://cs.smith.edu/~orourke/books/compgeom.html" +, url = "https://www.science.smith.edu/~jorourke/books/compgeom.html" , comments = "Printed 28 Sep 1998" , update = "01.11 orourke, 99.11 bibrelex, 98.11 orourke" , annote = "Textbook" @@ -113362,8 +113346,8 @@ small) triangulation of a convex polyhedron is NP-complete. Their 3SAT-reduction , month = jun , year = 2000 , note = "LANL arXiv cs.CG/0006035 v3, - \url{http://cs.smith.edu/~orourke/papers.html}" -, url = "http://cs.smith.edu/~orourke/papers.html" + \url{https://www.science.smith.edu/~jorourke/papers.php}" +, url = "https://www.science.smith.edu/~jorourke/papers.php" , archive = "LANL arXiv cs.CG/0006035 v3" , keywords = "polygonal chains, polytopes, polyhedra" , cites = "c-cses-89, s-usedkkk-21" @@ -117683,7 +117667,6 @@ both for rendering and for modeling. Contains C code." , address = "France" , year = 1999 , note = "TU-0619" -, url = "http://www.inria.fr/rrrt/tu-0619.html" , keywords = "doctoral thesis" , update = "02.03 devillers, 00.03 devillers" } @@ -128644,7 +128627,7 @@ Contains C code." , type = "Technical {Report}" , institution = "Courant Institute, New York University" , year = 1996 -, url = "http://cs.nyu.edu" +, url = "https://cs.nyu.edu/" , update = "97.11 bibrelex" } @@ -136211,7 +136194,7 @@ Contains C code." , number = 9 , year = 1990 , pages = "27--39" -, url = "http://www.cc.gatech.edu/gvu/softviz/algoanim/xtango.html" +, url = "https://www.cc.gatech.edu/gvu/ii/softvis/algoanim/xtango.html" , update = "96.01 tamassia" } @@ -139116,7 +139099,7 @@ code." , number = 1 , year = 1996 , pages = "23--26" -, url = "http://www.cs.brown.edu/cgc/papers/t-ds-96.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/t-ds-96.ps.gz" , keywords = "data structures, survey" , update = "97.03 tamassia" } @@ -139145,7 +139128,7 @@ code." @misc{t-gd- , author = "Roberto Tamassia" , title = "Graph Drawing" -, url = "http://www.cs.brown.edu/people/rt/gd.html" +, url = "http://graphdrawing.org/index.html" , update = "98.07 tamassia" } @@ -139159,7 +139142,7 @@ code." , address = "Boca Raton, FL" , year = 1997 , pages = "815--832" -, url = "http://www.cs.brown.edu/cgc/papers/t-gd-97.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/t-gd-97.ps.gz" , keywords = "graph drawing, survey" , update = "97.11 orourke, 97.07 orourke, 97.03 tamassia" } @@ -139254,7 +139237,7 @@ code." , publisher = "CRC Press" , year = 1997 , pages = "86--110" -, url = "http://www.cs.brown.edu/cgc/papers/tc-ds-.ps.gz" +, url = "https://www.cs.brown.edu/cgc/papers/tc-ds-.ps.gz" , keywords = "data structures, survey" , update = "97.03 tamassia" } @@ -139289,7 +139272,7 @@ code." , number = 4 , year = 1996 , pages = "591--606" -, url = "http://www.cs.brown.edu/people/rt/sdcr/report.html" +, url = "https://www.cs.brown.edu/people/rt/sdcr/report.html" , update = "98.07 tamassia+vismara, 97.03 tamassia" , annote = "short form of taacddfdhopsstvw-sdcg-96" } @@ -141035,7 +141018,7 @@ code." , title = "Hexahedral decomposition of polyhedra" , month = oct , year = 1993 -, url = "http://www.ics.uci.edu/~eppstein/gina/Thurston-hexahedra" +, url = "https://www.ics.uci.edu/~eppstein/gina/Thurston-hexahedra" , update = "97.11 bibrelex" } @@ -144105,7 +144088,7 @@ of geometric optics." @misc{v-qfemg-95 , author = "S. Vavasis" , title = "QMG: a finite element mesh generation package" -, url = "http://www.cs.cornell.edu/Info/People/vavasis/qmg-home.html" +, url = "https://www.cs.cornell.edu/info/people/vavasis/qmg-home.html" , update = "97.11 bibrelex" } @@ -151845,7 +151828,7 @@ amplification and suppression of local contrast. Contains C code." , keywords = {Computer Science - Computational Geometry, Computer Science - Data Structures and Algorithms} , year = 2012 , month = may -, adsurl = {http://adsabs.harvard.edu/abs/2012arXiv1205.5434H} +, adsurl = {https://ui.adsabs.harvard.edu/abs/2012arXiv1205.5434H/abstract} , adsnote = {Provided by the SAO/NASA Astrophysics Data System} } @@ -152040,7 +152023,7 @@ pages = {179--189} Booktitle = {24rd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA)}, Year = {2013}, Pages = {1646--1655}, - Url = {http://jeffe.cs.illinois.edu/pubs/pdf/dehn.pdf} + Url = {https://jeffe.cs.illinois.edu/pubs/pdf/dehn.pdf} } @InProceedings{lr-hts-12, @@ -152059,7 +152042,7 @@ pages = {179--189} Volume = {45}, Pages = {215--224}, Year = {2012}, - Url = {http://monge.univ-mlv.fr/~colinde/pub/09edgewidth.pdf} + Url = {https://monge.univ-mlv.fr/~colinde/pub/09edgewidth.pdf} @inproceedings{tang2009interactive, title={Interactive Hausdorff distance computation for general polygonal models}, diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 2c1a87d69a6..3d749fa16b6 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -1,7 +1,7 @@ # Doxyfile 1.8.13 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen (https://www.doxygen.nl/) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. @@ -20,7 +20,7 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# built into libc) for the transcoding. See https://www.gnu.org/software/libiconv/ # for the list of possible encodings. # The default value is: UTF-8. @@ -349,7 +349,10 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" @@ -406,7 +409,7 @@ EXTENSION_MAPPING = txt=C++ # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -448,7 +451,7 @@ BUILTIN_STL_SUPPORT = YES CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -831,7 +834,7 @@ LAYOUT_FILE = ${CGAL_DOC_RESOURCE_DIR}/DoxygenLayoutPackage.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -919,7 +922,7 @@ INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -1135,7 +1138,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1280,7 +1283,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1339,7 +1342,7 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in @@ -1384,7 +1387,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/default.aspx) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1460,7 +1463,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1468,8 +1471,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: https//doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1477,23 +1479,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: https//doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: https//doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https//doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1598,7 +1598,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1610,7 +1610,7 @@ USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output/index.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1625,7 +1625,7 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. +# MathJax from https://www.mathjax.org before deployment. # The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1641,7 +1641,7 @@ MATHJAX_EXTENSIONS = TeX/AMSmath \ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output/index.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1688,7 +1688,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1701,7 +1701,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1888,7 +1888,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -2071,7 +2071,7 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures the # structure of the code including all documentation. Note that this feature is # still experimental and incomplete at the moment. # The default value is: NO. @@ -2268,7 +2268,7 @@ CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the +# https://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. @@ -2290,7 +2290,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2445,7 +2445,7 @@ DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). diff --git a/Documentation/doc/resources/1.8.13/footer.html b/Documentation/doc/resources/1.8.13/footer.html index a1ef3c24ea8..9aab1a87eea 100644 --- a/Documentation/doc/resources/1.8.13/footer.html +++ b/Documentation/doc/resources/1.8.13/footer.html @@ -8,14 +8,14 @@ move the footer to the bottom of the page. -->
      $navpath
    diff --git a/Documentation/doc/resources/1.8.13/header.html b/Documentation/doc/resources/1.8.13/header.html index 8c8b86f5b9d..aaa5e95ea30 100644 --- a/Documentation/doc/resources/1.8.13/header.html +++ b/Documentation/doc/resources/1.8.13/header.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.13/header_package.html b/Documentation/doc/resources/1.8.13/header_package.html index 544fd3ced7f..9e6fe125d50 100644 --- a/Documentation/doc/resources/1.8.13/header_package.html +++ b/Documentation/doc/resources/1.8.13/header_package.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.13/menu_version.js b/Documentation/doc/resources/1.8.13/menu_version.js index 94aa6388f05..929adeeea31 100644 --- a/Documentation/doc/resources/1.8.13/menu_version.js +++ b/Documentation/doc/resources/1.8.13/menu_version.js @@ -7,8 +7,8 @@ var all_versions = [ 'master', 'latest', - '5.5', - '5.4.2', + '5.5.1', + '5.4.3', '5.3.2', '5.2.4', '5.1.5', diff --git a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in index f436e62be4c..1a59e5d2d97 100644 --- a/Documentation/doc/resources/1.8.14/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.14/BaseDoxyfile.in @@ -1,7 +1,7 @@ # Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen (https://www.doxygen.nl/) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. @@ -350,7 +350,10 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -401,7 +404,7 @@ EXTENSION_MAPPING = txt=C++ # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -1330,7 +1333,7 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in @@ -1598,7 +1601,7 @@ USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output/index.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1629,7 +1632,7 @@ MATHJAX_EXTENSIONS = TeX/AMSmath \ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output/index.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -2059,7 +2062,7 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures # the structure of the code including all documentation. Note that this feature # is still experimental and incomplete at the moment. # The default value is: NO. @@ -2263,7 +2266,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2418,7 +2421,7 @@ DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). diff --git a/Documentation/doc/resources/1.8.14/footer.html b/Documentation/doc/resources/1.8.14/footer.html index a1ef3c24ea8..379470c59e2 100644 --- a/Documentation/doc/resources/1.8.14/footer.html +++ b/Documentation/doc/resources/1.8.14/footer.html @@ -8,14 +8,14 @@ move the footer to the bottom of the page. -->
      $navpath
    diff --git a/Documentation/doc/resources/1.8.14/header.html b/Documentation/doc/resources/1.8.14/header.html index 8c8b86f5b9d..aaa5e95ea30 100644 --- a/Documentation/doc/resources/1.8.14/header.html +++ b/Documentation/doc/resources/1.8.14/header.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.14/header_package.html b/Documentation/doc/resources/1.8.14/header_package.html index 89f76a8a441..f429c63135d 100644 --- a/Documentation/doc/resources/1.8.14/header_package.html +++ b/Documentation/doc/resources/1.8.14/header_package.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.14/menu_version.js b/Documentation/doc/resources/1.8.14/menu_version.js index 94aa6388f05..929adeeea31 100644 --- a/Documentation/doc/resources/1.8.14/menu_version.js +++ b/Documentation/doc/resources/1.8.14/menu_version.js @@ -7,8 +7,8 @@ var all_versions = [ 'master', 'latest', - '5.5', - '5.4.2', + '5.5.1', + '5.4.3', '5.3.2', '5.2.4', '5.1.5', diff --git a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in index dfffc15a705..f950a6836db 100644 --- a/Documentation/doc/resources/1.8.20/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.20/BaseDoxyfile.in @@ -1,7 +1,7 @@ # Doxyfile 1.8.20 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen (https://www.doxygen.nl/) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. @@ -372,7 +372,11 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -1679,7 +1683,7 @@ USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output/index.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1710,7 +1714,7 @@ MATHJAX_EXTENSIONS = TeX/AMSmath \ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output/index.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -2142,7 +2146,7 @@ DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures # the structure of the code including all documentation. Note that this feature # is still experimental and incomplete at the moment. # The default value is: NO. @@ -2346,7 +2350,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2501,7 +2505,7 @@ DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). diff --git a/Documentation/doc/resources/1.8.20/footer.html b/Documentation/doc/resources/1.8.20/footer.html index cd9ad4553bc..28e5afe0f39 100644 --- a/Documentation/doc/resources/1.8.20/footer.html +++ b/Documentation/doc/resources/1.8.20/footer.html @@ -7,13 +7,13 @@ move the footer to the bottom of the page. --> diff --git a/Documentation/doc/resources/1.8.20/header.html b/Documentation/doc/resources/1.8.20/header.html index 50e4e4dcb49..c0530eec8bf 100644 --- a/Documentation/doc/resources/1.8.20/header.html +++ b/Documentation/doc/resources/1.8.20/header.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.20/header_package.html b/Documentation/doc/resources/1.8.20/header_package.html index 007d84e7b10..d2a1ed6051b 100644 --- a/Documentation/doc/resources/1.8.20/header_package.html +++ b/Documentation/doc/resources/1.8.20/header_package.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.8.20/menu_version.js b/Documentation/doc/resources/1.8.20/menu_version.js index 94aa6388f05..929adeeea31 100644 --- a/Documentation/doc/resources/1.8.20/menu_version.js +++ b/Documentation/doc/resources/1.8.20/menu_version.js @@ -7,8 +7,8 @@ var all_versions = [ 'master', 'latest', - '5.5', - '5.4.2', + '5.5.1', + '5.4.3', '5.3.2', '5.2.4', '5.1.5', diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 2aa14b65920..10f3050a8f3 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -1,7 +1,7 @@ # Doxyfile 1.8.4 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen (https://www.doxygen.nl/) for a project. # # All text after a double hash (##) is considered a comment and is placed # in front of the TAG it is preceding . @@ -20,7 +20,7 @@ # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. +# https://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 @@ -356,6 +356,10 @@ ALIASES+= "cgalParamType{1}=
  • Type: \1
  • " ALIASES+= "cgalParamDefault{1}=
  • %Default: \1
  • " ALIASES+= "cgalParamExtra{1}=
  • Extra: \1
  • " ALIASES+= "cgalParamNEnd= \htmlonly[block] \endhtmlonly " +ALIASES+= "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" +ALIASES+= "cgalParamSectionEnd=\cgalParamNEnd" +ALIASES+= "cgalParamPrecondition{1}=
  • Precondition: \1
  • " + # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding @@ -405,7 +409,7 @@ EXTENSION_MAPPING = # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all # comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you # can mix doxygen, HTML, and XML commands with Markdown formatting. # Disable only in case of backward compatibilities issues. @@ -750,7 +754,7 @@ LAYOUT_FILE = ${CGAL_DOC_RESOURCE_DIR}/DoxygenLayoutPackage.xml # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# https://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. Do not use # file names with spaces, bibtex cannot handle them. @@ -823,7 +827,7 @@ INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# into libc) for the transcoding. See https://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 @@ -1001,7 +1005,7 @@ REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You +# tagging system (see https://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO @@ -1106,7 +1110,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. +# see https://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. @@ -1247,25 +1251,25 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters +# https//doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see -# +# # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = @@ -1273,7 +1277,7 @@ QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. -# +# # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = @@ -1357,7 +1361,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the +# (see https://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you may also need to install MathJax separately and @@ -1380,7 +1384,7 @@ MATHJAX_FORMAT = HTML-CSS # the MathJax Content Delivery Network so you can quickly see the result without # installing MathJax. # However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. +# copy of MathJax from https://www.mathjax.org before deployment. MATHJAX_RELPATH = ../../MathJax/ @@ -1556,7 +1560,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. +# https://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain @@ -1846,7 +1850,7 @@ CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# https://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. diff --git a/Documentation/doc/resources/1.8.4/footer.html b/Documentation/doc/resources/1.8.4/footer.html index 8b23c63651f..5c8bc85e026 100644 --- a/Documentation/doc/resources/1.8.4/footer.html +++ b/Documentation/doc/resources/1.8.4/footer.html @@ -5,14 +5,14 @@
      $navpath
    diff --git a/Documentation/doc/resources/1.8.4/header.html b/Documentation/doc/resources/1.8.4/header.html index a98007ec2a5..8ffa7e46ea8 100644 --- a/Documentation/doc/resources/1.8.4/header.html +++ b/Documentation/doc/resources/1.8.4/header.html @@ -1,5 +1,5 @@ - + @@ -46,8 +46,8 @@ $mathjax onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    -
    diff --git a/Documentation/doc/resources/1.8.4/header_package.html b/Documentation/doc/resources/1.8.4/header_package.html index 4b3ae0e7cc2..e47f3e9a158 100644 --- a/Documentation/doc/resources/1.8.4/header_package.html +++ b/Documentation/doc/resources/1.8.4/header_package.html @@ -1,5 +1,5 @@ - + @@ -63,8 +63,8 @@ $mathjax onmouseout="return searchBox.OnSearchSelectHide()" alt=""/>
    @@ -116,7 +116,7 @@ var searchBox = new SearchBox("searchBox", "../Manual/search",false,'Search');
    -
    diff --git a/Documentation/doc/resources/1.8.4/menu_version.js b/Documentation/doc/resources/1.8.4/menu_version.js index 94aa6388f05..929adeeea31 100644 --- a/Documentation/doc/resources/1.8.4/menu_version.js +++ b/Documentation/doc/resources/1.8.4/menu_version.js @@ -7,8 +7,8 @@ var all_versions = [ 'master', 'latest', - '5.5', - '5.4.2', + '5.5.1', + '5.4.3', '5.3.2', '5.2.4', '5.1.5', diff --git a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in index 7293184c812..775ba2ce757 100644 --- a/Documentation/doc/resources/1.9.3/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.9.3/BaseDoxyfile.in @@ -1,7 +1,7 @@ # Doxyfile 1.9.3 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. +# doxygen (https://www.doxygen.nl/) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. @@ -372,7 +372,10 @@ ALIASES = "cgal=%CGAL" \ "cgalParamType{1}=
  • Type: \1
  • " \ "cgalParamDefault{1}=
  • %Default: \1
  • " \ "cgalParamExtra{1}=
  • Extra: \1
  • " \ - "cgalParamNEnd= \htmlonly[block] \endhtmlonly " + "cgalParamNEnd= \htmlonly[block] \endhtmlonly " \ + "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \ + "cgalParamSectionEnd=\cgalParamNEnd" \ + "cgalParamPrecondition{1}=
  • Precondition: \1
  • " # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -1685,7 +1688,7 @@ USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# https://docs.mathjax.org/en/latest/output/index.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1716,7 +1719,7 @@ MATHJAX_EXTENSIONS = TeX/AMSmath \ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: https://docs.mathjax.org/en/latest/output/index.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -2148,7 +2151,7 @@ DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures # the structure of the code including all documentation. Note that this feature # is still experimental and incomplete at the moment. # The default value is: NO. @@ -2258,7 +2261,7 @@ PREDEFINED = DOXYGEN_RUNNING \ "CGAL_NP_TEMPLATE_PARAMETERS_2=NamedParameters2 = CGAL::parameters::Default_named_parameter" \ "CGAL_NP_CLASS_2=NamedParameters2" \ CGAL_DEPRECATED - + # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2344,7 +2347,7 @@ HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO # The default value is: NO. @@ -2504,7 +2507,7 @@ DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: -# http://www.graphviz.org/)). +# https://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). diff --git a/Documentation/doc/resources/1.9.3/footer.html b/Documentation/doc/resources/1.9.3/footer.html index cd9ad4553bc..28e5afe0f39 100644 --- a/Documentation/doc/resources/1.9.3/footer.html +++ b/Documentation/doc/resources/1.9.3/footer.html @@ -7,13 +7,13 @@ move the footer to the bottom of the page. --> diff --git a/Documentation/doc/resources/1.9.3/header.html b/Documentation/doc/resources/1.9.3/header.html index 50e4e4dcb49..c0530eec8bf 100644 --- a/Documentation/doc/resources/1.9.3/header.html +++ b/Documentation/doc/resources/1.9.3/header.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.9.3/header_package.html b/Documentation/doc/resources/1.9.3/header_package.html index 007d84e7b10..d2a1ed6051b 100644 --- a/Documentation/doc/resources/1.9.3/header_package.html +++ b/Documentation/doc/resources/1.9.3/header_package.html @@ -1,6 +1,6 @@ - + diff --git a/Documentation/doc/resources/1.9.3/menu_version.js b/Documentation/doc/resources/1.9.3/menu_version.js index e8a424f40cd..929adeeea31 100644 --- a/Documentation/doc/resources/1.9.3/menu_version.js +++ b/Documentation/doc/resources/1.9.3/menu_version.js @@ -7,8 +7,9 @@ var all_versions = [ 'master', 'latest', - '5.4', - '5.3.1', + '5.5.1', + '5.4.3', + '5.3.2', '5.2.4', '5.1.5', '5.0.4', diff --git a/Documentation/doc/scripts/generate_how_to_cite.py b/Documentation/doc/scripts/generate_how_to_cite.py index e1108d6a51f..470c71d4e45 100644 --- a/Documentation/doc/scripts/generate_how_to_cite.py +++ b/Documentation/doc/scripts/generate_how_to_cite.py @@ -46,7 +46,7 @@ software. If you want to cite the \cgal Library or project as a whole, please -- cite: \cgal, Computational Geometry Algorithms Library, https://www.cgal.org +- cite: \cgal, Computational Geometry Algorithms Library, https://www.cgal.org - use the first bibtex entry from the file how_to_cite_cgal.bib. ## Citing the User and Reference Manual ## @@ -65,7 +65,7 @@ If you want to refer to \cgal manual, please cite the appropriate The \cgal Project. \cgal User and Reference Manual. \cgal Editorial Board, ${CGAL_CREATED_VERSION_NUM} edition, ${CGAL_BUILD_YEAR4}. -[ bib | +[ bib | http ] @@ -80,7 +80,7 @@ result_txt_footer=r""" """ pre_html=r""" - + diff --git a/Documentation/doc/scripts/html_output_post_processing.py b/Documentation/doc/scripts/html_output_post_processing.py index 44d15aa6d70..5402d7bc50f 100755 --- a/Documentation/doc/scripts/html_output_post_processing.py +++ b/Documentation/doc/scripts/html_output_post_processing.py @@ -55,7 +55,7 @@ def write_out_html(d, fn): f = codecs.open(fn, 'w', encoding='utf-8') # this is the normal doxygen doctype, which is thrown away by pyquery f.write('\n') - f.write('') + f.write('') if d.html() is not None: f.write(d.html()) f.write('\n') @@ -85,7 +85,7 @@ def clean_doc(): for fn in duplicate_files: os.remove(fn) -# from http://stackoverflow.com/a/1597755/105672 +# from https://stackoverflow.com/a/1597755/105672 def re_replace_in_file(pat, s_after, fname): # first, see if the pattern is even in the file. with codecs.open(fname, encoding='utf-8') as f: diff --git a/Filtered_kernel/TODO b/Filtered_kernel/TODO index 477746d7bce..7e1b5441ad9 100644 --- a/Filtered_kernel/TODO +++ b/Filtered_kernel/TODO @@ -140,7 +140,7 @@ except we could merge stuff with Olivier's Fixed ! So the good choice seems to be to have data stored in each predicate object, and having the kernel store a predicate object for each predicate. Then the orientation_2_object() simply returns a reference to it. - + Then it means algorithms should use one "global" object per predicate (e.g. one orientation object for a whole Triangulation). Except for cases where they actually want different contexts. diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel.h b/Filtered_kernel/include/CGAL/Filtered_kernel.h index 7e7c21ef79f..182ba3c4d99 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel.h @@ -81,13 +81,16 @@ struct Filtered_kernel_base Approximate_kernel approximate_kernel() const { return {}; } // We change the predicates. -#define CGAL_Kernel_pred(P, Pf) \ - typedef Filtered_predicate P; \ +#define CGAL_Kernel_pred_RT_or_FT(P, Pf) \ + typedef Filtered_predicate_RT_FT P; \ P Pf() const { return P(); } -#define CGAL_Kernel_pred_RT(P, Pf) \ - typedef Filtered_predicate P; \ - P Pf() const { return P(); } +#define CGAL_Kernel_pred(P, Pf) CGAL_Kernel_pred_RT_or_FT(P, Pf) // We don't touch the constructions. #define CGAL_Kernel_cons(Y,Z) diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h index ac57decb63e..e9428fd2917 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h @@ -21,7 +21,7 @@ #include #include -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf namespace CGAL { diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h index 44a3ae05669..2b0ef97d7fc 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h @@ -26,7 +26,7 @@ #include -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf namespace CGAL { @@ -509,6 +509,8 @@ public: (pts[i][1] >= b.ymin() && pts[i][1] <= b.ymax()) && (pts[i][2] >= b.zmin() && pts[i][2] <= b.zmax()) ) { + // If any of the three points of the triangle is inside the bbox, + // then the box and triangle intersect. return true; } @@ -520,6 +522,21 @@ public: } } + // If the bbox of the triangle does not intersect `b`, then the bbox and + // the triangle do not intersect. + for(int i=0; i< 3; ++i) { + double triangle_bbox_min = pts[0][i]; + double triangle_bbox_max = triangle_bbox_min; + for(int j=1; j<3; ++j) { + if(pts[j][i] < triangle_bbox_min) + triangle_bbox_min = pts[j][i]; + if(pts[j][i] > triangle_bbox_max) + triangle_bbox_max = pts[j][i]; + } + if(triangle_bbox_min > b.max_coord(i) || triangle_bbox_max < b.min_coord(i)) + return false; + } + // copy of the regular code with do_axis_intersect_aux_impl statically filtered auto do_axis_intersect_aux_impl = [](double alpha, double beta, double c_alpha, double c_beta) -> Uncertain { diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate.h b/Filtered_kernel/include/CGAL/Filtered_predicate.h index 2adad47f329..8cbcaa2835a 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate.h @@ -19,6 +19,8 @@ #include #include +#include + namespace CGAL { // This template class is a wrapper that implements the filtering for any @@ -84,15 +86,8 @@ public: template result_type - operator()(const Args&... args) const; -}; - -template - template -typename Filtered_predicate::result_type -Filtered_predicate:: operator()(const Args&... args) const -{ + { CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG { @@ -109,8 +104,76 @@ Filtered_predicate:: Protect_FPU_rounding p(CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); return ep(c2e(args)...); -} + } +}; -} //namespace CGAL +template +class Filtered_predicate_RT_FT +{ + C2E_RT c2e_rt; + C2E_FT c2e_ft; + C2A c2a; + EP_RT ep_rt; + EP_FT ep_ft; + AP ap; + + using Ares = typename Remove_needs_FT::Type; + +public: + using result_type = typename Remove_needs_FT::Type; + +private: + template + struct Call_operator_needs_FT + { + using Actual_approx_res = decltype(ap(c2a(std::declval())...)); + using Approx_res = std::remove_cv_t >; + enum { value = std::is_same >::value }; + }; + + template ::value>* = nullptr> + result_type call(const Args&... args) const { return ep_ft(c2e_ft(args)...); } + + template ::value>* = nullptr> + result_type call(const Args&... args) const { return ep_rt(c2e_rt(args)...); } + +public: + // ## Important note + // + // If you want to remove of rename that member function template `needs_FT`, + // please also change the lines with + // `CGAL_GENERATE_MEMBER_DETECTOR(needs_FT);` + // or `has_needs_FT` in + // the file `Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h`. + template + bool needs_FT(const Args&...) const { return Call_operator_needs_FT::value; } + + template + result_type + operator()(const Args&... args) const + { + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); + // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG + { + Protect_FPU_rounding p; + try + { + Ares res = ap(c2a(args)...); + if (is_certain(res)) + return get_certain(res); + } + catch (Uncertain_conversion_exception&) {} + } + CGAL_BRANCH_PROFILER_BRANCH(tmp); + Protect_FPU_rounding p(CGAL_FE_TONEAREST); + CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); + + return call(args...); + } +}; + +} // namespace CGAL #endif // CGAL_FILTERED_PREDICATE_H diff --git a/Filtered_kernel/include/CGAL/Lazy_kernel.h b/Filtered_kernel/include/CGAL/Lazy_kernel.h index c88f93e3acf..08a6ebb41a0 100644 --- a/Filtered_kernel/include/CGAL/Lazy_kernel.h +++ b/Filtered_kernel/include/CGAL/Lazy_kernel.h @@ -89,7 +89,7 @@ protected: // Exact_kernel = exact kernel that will be made lazy // Kernel = lazy kernel -// the Generic base simplies applies the generic magic functor stupidly. +// the Generic base simply applies the generic magic functor stupidly. // then the real base fixes up a few special cases. template < typename EK_, typename AK_, typename E2A_, typename Kernel_ > class Lazy_kernel_generic_base : protected internal::Enum_holder diff --git a/Generalized_map/doc/Generalized_map/Generalized_map.txt b/Generalized_map/doc/Generalized_map/Generalized_map.txt index 09ad37a4946..0b08884f40a 100644 --- a/Generalized_map/doc/Generalized_map/Generalized_map.txt +++ b/Generalized_map/doc/Generalized_map/Generalized_map.txt @@ -551,7 +551,7 @@ Let d0 \f$ \in \f$ D be a dart. Given i, 0 \f$ \leq \f$ \section Generalized_mapDesign Design and Implementation History -The code of this package followed the code of Combinatorial maps and was inspired by Moka, a 3D topological modeler that uses 3D generalized maps (http://moka-modeller.sourceforge.net/). +The code of this package followed the code of Combinatorial maps and was inspired by Moka, a 3D topological modeler that uses 3D generalized maps (https://moka-modeller.sourceforge.net/). */ } /* namespace CGAL */ diff --git a/Generator/doc/Generator/CGAL/Random.h b/Generator/doc/Generator/CGAL/Random.h index a09f18cf1e1..abf2e0da6ab 100644 --- a/Generator/doc/Generator/CGAL/Random.h +++ b/Generator/doc/Generator/CGAL/Random.h @@ -5,7 +5,7 @@ namespace CGAL { The class `Random` is a random numbers generator. It generates uniformly distributed random `bool`, `int` and `double`. It can be used as the random number generating function object in the -\stl algorithm `std::random_shuffle`. +\stl algorithm `std::random_shuffle()`. Instances of `Random` can be seen as input streams. Different streams are independent of each other, i.e.\ the sequence of @@ -23,10 +23,10 @@ the same time, even if a fixed seed has been chosen. \cgalHeading{Implementation} -We use the boost random library function `boost::rand48` to generate the random +We use the boost random library function `boost::rand48()` to generate the random numbers. -\sa `CGAL::get_default_random` +\sa `CGAL::get_default_random()` */ diff --git a/Generator/doc/Generator/CGAL/point_generators_2.h b/Generator/doc/Generator/CGAL/point_generators_2.h index 86110aa1ba8..459e856ac8d 100644 --- a/Generator/doc/Generator/CGAL/point_generators_2.h +++ b/Generator/doc/Generator/CGAL/point_generators_2.h @@ -31,7 +31,7 @@ are needed from `rnd` for each point. \sa `CGAL::points_on_square_grid_2()` \sa `CGAL::random_selection()` \sa `CGAL::random_selection()` -\sa `std::random_shuffle` +\sa `std::random_shuffle()` */ template @@ -90,7 +90,7 @@ the \f$ n\f$ points. \sa `CGAL::points_on_cube_grid_3()` \sa `CGAL::random_collinear_points_2()` \sa `CGAL::random_selection()` -\sa `std::random_shuffle` +\sa `std::random_shuffle()` */ template @@ -126,7 +126,7 @@ Returns the value of `first2` after inserting the \f$ n\f$ points. \sa `CGAL::points_on_segment_2()` \sa `CGAL::points_on_square_grid_2()` \sa `CGAL::random_selection()` -\sa `std::random_shuffle` +\sa `std::random_shuffle()` */ template @@ -685,7 +685,7 @@ endpoints are specified upon construction. The points are equally spaced. \cgalModels `PointGenerator` -\sa `CGAL::points_on_segment` +\sa `CGAL::points_on_segment_2` \sa `CGAL::Random_points_in_disc_2` \sa `CGAL::Random_points_in_square_2` \sa `CGAL::Random_points_in_triangle_2` diff --git a/Generator/doc/Generator/Concepts/CombinationElement.h b/Generator/doc/Generator/Concepts/CombinationElement.h index cacb6013439..fc9712bb25c 100644 --- a/Generator/doc/Generator/Concepts/CombinationElement.h +++ b/Generator/doc/Generator/Concepts/CombinationElement.h @@ -8,7 +8,7 @@ A CombinationElement can be used as template parameter for the class \cgalHasModel Pointers \cgalHasModel Random access iterators -\sa `Combination_enumerator` +\sa `CGAL::Combination_enumerator` */ @@ -76,8 +76,3 @@ int operator-(const CombinationElement & e2); /// @} }; /* end CombinationElement */ - - - - - diff --git a/Generator/doc/Generator/Generator.txt b/Generator/doc/Generator/Generator.txt index fe9e9acc0c7..3e2e4e3c856 100644 --- a/Generator/doc/Generator/Generator.txt +++ b/Generator/doc/Generator/Generator.txt @@ -18,7 +18,7 @@ Two kinds of point generators are provided: first, random point generators and second deterministic point generators. Most random point generators and a few deterministic point generators are provided as input iterators. The input iterators model an infinite sequence of -points. The function `CGAL::copy_n()` can be used to copy a +points. The algorithm `std::copy_n` can be used to copy a finite sequence. The iterator adaptor `Counting_iterator` can be used to create finite iterator ranges. diff --git a/Generator/include/CGAL/Random_polygon_2_sweep.h b/Generator/include/CGAL/Random_polygon_2_sweep.h index 2aa4102bbb1..84cb7ad5818 100644 --- a/Generator/include/CGAL/Random_polygon_2_sweep.h +++ b/Generator/include/CGAL/Random_polygon_2_sweep.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -156,9 +156,9 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const #if defined(CGAL_POLY_GENERATOR_DEBUG) std::cout << "less_than_in_tree; new: " << new_edge.as_int() << " tree edge: " << tree_edge.as_int() << std::endl; #endif - CGAL_polygon_precondition( + CGAL_precondition( m_vertex_data->edges[tree_edge.as_int()].is_in_tree); - CGAL_polygon_precondition( + CGAL_precondition( !m_vertex_data->edges[new_edge.as_int()].is_in_tree); Vertex_index left, mid, right; m_vertex_data->left_and_right_index(left, right, tree_edge); @@ -172,10 +172,10 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const case RIGHT_TURN: return false; case COLLINEAR: break; } - CGAL_polygon_assertion(m_vertex_data->less_xy_2( + CGAL_assertion(m_vertex_data->less_xy_2( m_vertex_data->point(left), m_vertex_data->point(mid))); - CGAL_polygon_assertion( m_vertex_data->less_xy_2( + CGAL_assertion( m_vertex_data->less_xy_2( m_vertex_data->point(mid), m_vertex_data->point(right))); m_vertex_data->is_simple_result = false; @@ -321,23 +321,23 @@ insertion_event(Tree *tree, Vertex_index prev_vt, std::pair result; if (left_turn) { result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; if (!this->is_simple_result) return false; result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; if (!this->is_simple_result) return false; } else { result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; if (!this->is_simple_result) return false; result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; if (!this->is_simple_result) return false; @@ -374,7 +374,7 @@ replacement_event(Tree *tree, Vertex_index cur_edge, Vertex_index next_edge) // check if continuation point is on the right side of neighbor segments typedef typename Tree::iterator It; Edge_data &td = edges[cur_edge.as_int()]; - CGAL_polygon_assertion(td.is_in_tree); + CGAL_assertion(td.is_in_tree); It cur_seg = td.tree_it; Vertex_index cur_vt = (td.is_left_to_right) ? next_edge : cur_edge; if (cur_seg != tree->begin()) { @@ -613,7 +613,7 @@ void make_simple_polygon(Iterator points_begin, Iterator points_end, #if defined(CGAL_POLY_GENERATOR_DEBUG) std::cout << "To swap: " << swap_interval.first << " " << swap_interval.second << std::endl; - CGAL_polygon_assertion(swap_interval.first >= -1 && + CGAL_assertion(swap_interval.first >= -1 && swap_interval.second >= -1 && swap_interval.first < size && swap_interval.second < size); diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index e24b3e21d42..c18f2566d36 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -961,9 +961,7 @@ MainWindow::on_actionLloyd_optimization_triggered() } CGAL::lloyd_optimize_mesh_2(cdt, - max_iteration_number = nb, - seeds_begin = m_seeds.begin(), - seeds_end = m_seeds.end()); + CGAL::parameters::number_of_iterations(nb).seeds(m_seeds)); // default cursor QApplication::restoreOverrideCursor(); diff --git a/GraphicsView/doc/GraphicsView/fig_src/uml-design.graphml b/GraphicsView/doc/GraphicsView/fig_src/uml-design.graphml index b4d866c7279..39d1878397c 100644 --- a/GraphicsView/doc/GraphicsView/fig_src/uml-design.graphml +++ b/GraphicsView/doc/GraphicsView/fig_src/uml-design.graphml @@ -1,5 +1,5 @@ - + diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index e353c8de66e..0599baf55d8 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -138,8 +138,8 @@ public Q_SLOTS: void setGridIsDrawn(bool draw = true) { if(!draw) { - grid_size=0; - g_axis_size=0; + grid_size = 0; + grid_axis_size = 0; } gridIsDrawn_ = draw; Q_EMIT gridIsDrawnChanged(draw); @@ -395,7 +395,7 @@ public: * returns the offset of the scene. * \see `setOffset()` */ - qglviewer::Vec offset()const; + const qglviewer::Vec& offset() const; public Q_SLOTS: void setFullScreen(bool fullScreen = true); @@ -411,7 +411,8 @@ protected: //@{ public: void drawArrow(double r, double R, int prec, - qglviewer::Vec from, qglviewer::Vec to, qglviewer::Vec color, std::vector &data); + const qglviewer::Vec& from, const qglviewer::Vec& to, + std::vector &data); void drawAxis(qreal l = 1.0); void drawGrid(qreal size= 1.0, int nbSubdivisions = 10); @@ -1180,27 +1181,31 @@ protected: enum VBO { Grid = 0, - Grid_axis, - Axis, + Grid_axis_x, Grid_axis_y, + Axis_x, Axis_y, Axis_z, Pivot_point, VBO_size }; + enum VAO { GRID = 0, - GRID_AXIS, - AXIS, + GRID_AXIS_X, GRID_AXIS_Y, + AXIS_X, AXIS_Y, AXIS_Z, PIVOT_POINT, VAO_size }; + QOpenGLShaderProgram rendering_program; - QOpenGLShaderProgram rendering_program_light; QOpenGLVertexArrayObject vaos[VAO_size]; QVector vbos; + std::size_t grid_size; - std::size_t g_axis_size; + std::size_t grid_axis_size; std::size_t axis_size; + QOpenGLFramebufferObject* stored_fbo; + //S n a p s h o t QImage* takeSnapshot(qglviewer::SnapShotBackground background_color, QSize finalSize, double oversampling, bool expand); diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 1e10b72d0b0..7b88310b16d 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -217,9 +217,7 @@ void CGAL::QGLViewer::initializeGL() { QSurfaceFormat cur_f = QOpenGLContext::currentContext()->format(); const char* rt =(cur_f.renderableType() == QSurfaceFormat::OpenGLES) ? "GLES" : "GL"; - qDebug()<<"Using context " - <getModelViewProjectionMatrix(mat); + + QMatrix4x4 mvpMatrix; for(int i=0; i < 16; i++) { - mvpMatrix.data()[i] = (float)mat[i]; + mvpMatrix.data()[i] = float(mat[i]); } + QMatrix4x4 mvMatrix; for(int i=0; i < 16; i++) { mvMatrix.data()[i] = float(camera()->orientation().inverse().matrix()[i]); } + + rendering_program.bind(); + vaos[GRID].bind(); rendering_program.setUniformValue("mvp_matrix", mvpMatrix); rendering_program.setUniformValue("color", QColor(::Qt::lightGray)); glDrawArrays(GL_LINES, 0, static_cast(grid_size)); vaos[GRID].release(); - rendering_program.release(); - rendering_program_light.bind(); - vaos[GRID_AXIS].bind(); + vaos[GRID_AXIS_X].bind(); + rendering_program.setUniformValue("color", QColor(::Qt::red)); +// glEnable(GL_POLYGON_OFFSET_FILL); +// glPolygonOffset(0.0f,-0.0f); + glDrawArrays(GL_TRIANGLES, 0, static_cast(grid_axis_size/3)); + vaos[GRID_AXIS_X].release(); + + vaos[GRID_AXIS_Y].bind(); + rendering_program.setUniformValue("color", QColor(::Qt::green)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(grid_axis_size/3)); + vaos[GRID_AXIS_Y].release(); - rendering_program_light.setUniformValue("mvp_matrix", mvpMatrix); - rendering_program_light.setUniformValue("mv_matrix", mvMatrix); - glDrawArrays(GL_TRIANGLES, 0, static_cast(g_axis_size/9)); - vaos[GRID_AXIS].release(); -// glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(3.0f,-3.0f); //A x i s CGAL::qglviewer::Camera::Type camera_type = camera()->type(); + camera()->setType(CGAL::qglviewer::Camera::ORTHOGRAPHIC); for(int i=0; i < 16; i++) { @@ -3143,15 +2999,14 @@ void CGAL::QGLViewer::drawVisualHints() { mvpMatrix.setToIdentity(); mvpMatrix.ortho(-1,1,-1,1,-1,1); mvpMatrix = mvpMatrix*mvMatrix; - rendering_program_light.setUniformValue("mvp_matrix", mvpMatrix); - rendering_program_light.setUniformValue("mv_matrix", mvMatrix); + rendering_program.setUniformValue("mvp_matrix", mvpMatrix); + camera()->setType(camera_type); - vaos[AXIS].bind(); + + // The viewport and the scissor are changed to fit the upper right corner. + // Original values are saved. int viewport[4]; int scissor[4]; - - // The viewport and the scissor are changed to fit the upper right - // corner. Original values are saved. glGetIntegerv(GL_VIEWPORT, viewport); glGetIntegerv(GL_SCISSOR_BOX, scissor); @@ -3159,12 +3014,25 @@ void CGAL::QGLViewer::drawVisualHints() { int size = 100; glViewport(width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); glScissor (width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); - glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 9)); + + vaos[AXIS_X].bind(); + rendering_program.setUniformValue("color", QColor(::Qt::red)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 3)); + vaos[AXIS_X].release(); + + vaos[AXIS_Y].bind(); + rendering_program.setUniformValue("color", QColor(::Qt::green)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 3)); + vaos[AXIS_Y].release(); + + vaos[AXIS_Z].bind(); + rendering_program.setUniformValue("color", QColor(::Qt::blue)); + glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 3)); + vaos[AXIS_Z].release(); + // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]); - vaos[AXIS].release(); - rendering_program_light.release(); //P i v o t - P o i n t if (visualHint_ & 1) @@ -3178,31 +3046,39 @@ void CGAL::QGLViewer::drawVisualHints() { vertices.push_back(y); vertices.push_back(0); } + rendering_program.bind(); vaos[PIVOT_POINT].bind(); vbos[Pivot_point].bind(); + vbos[Pivot_point].allocate(vertices.data(),static_cast(vertices.size()*sizeof(float))); rendering_program.enableAttributeArray("vertex"); rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); vbos[Pivot_point].release(); + mvpMatrix.setToIdentity(); mvpMatrix.ortho(-1,1,-1,1,-1,1); - size=30*devicePixelRatio(); rendering_program.setUniformValue("mvp_matrix", mvpMatrix); + const auto point_2d = camera()->projectedCoordinatesOf(camera()->pivotPoint()); + size = 30 * devicePixelRatio(); + glViewport(GLint(point_2d.x*devicePixelRatio()-size/2), GLint((height() - point_2d.y)*devicePixelRatio()-size/2), size, size); glScissor (GLint(point_2d.x*devicePixelRatio()-size/2), GLint((height() - point_2d.y)*devicePixelRatio()-size/2), size, size); + rendering_program.setUniformValue("color", QColor(::Qt::black)); glDisable(GL_DEPTH_TEST); glDrawArrays(GL_LINES, 0, static_cast(4)); rendering_program.setUniformValue("color", QColor(::Qt::white)); glDrawArrays(GL_LINES, 0, static_cast(4)); glEnable(GL_DEPTH_TEST); + // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]); + vaos[PIVOT_POINT].release(); rendering_program.release(); } @@ -3230,26 +3106,29 @@ void CGAL::QGLViewer::resetVisualHints() { visualHint_ = 0; } //////////////////////////////////////////////////////////////////////////////// /*! Draws a 3D arrow between the 3D point \p from and the 3D point \p to. -\p data is filled with the three components of a point, then its normal, and then its color, which makes it filled like this: -[P1.x-P1.y-P1.z-N1.x-N1.y-N1.z-C1.r-C1.g-C1.b|P2.x-P2.y-P2.z-N2.x-N2.y-N2.z-C2.r-C2.g-C2.b|...] +\p data is filled with the three components of a point, which makes it filled like this: +[P1.x-P1.y-P1.z|P2.x-P2.y-P2.z|...] */ CGAL_INLINE_FUNCTION -void CGAL::QGLViewer::drawArrow(double r,double R, int prec, CGAL::qglviewer::Vec from, - CGAL::qglviewer::Vec to, CGAL::qglviewer::Vec color, - std::vector &data) { +void CGAL::QGLViewer::drawArrow(double r, double R, int prec, + const CGAL::qglviewer::Vec& from, const CGAL::qglviewer::Vec& to, + std::vector &data) { using std::cos; using std::sin; using std::acos; + CGAL::qglviewer::Vec temp = to-from; QVector3D dir = QVector3D(float(temp.x), float(temp.y), float(temp.z)); + QMatrix4x4 mat; mat.setToIdentity(); mat.translate(float(from.x), float(from.y), float(from.z)); mat.scale(dir.length()); + dir.normalize(); - float angle = 0.0; + float angle = 0.f; if(std::sqrt((dir.x()*dir.x()+dir.y()*dir.y())) > 1) - angle = 90.0f; + angle = 90.f; else angle = float(acos(dir.y()/std::sqrt(dir.lengthSquared()))*180.0/CGAL_PI); @@ -3261,55 +3140,36 @@ void CGAL::QGLViewer::drawArrow(double r,double R, int prec, CGAL::qglviewer::Ve const float Rf = static_cast(R); for(int d = 0; d<360; d+= 360/prec) { - float D = (float) (d * CGAL_PI / 180.); - float a = (float) std::atan(Rf / 0.33); - QVector4D p(0., 1., 0, 1.); - QVector4D n(Rf*sin(D), sin(a), Rf*cos(D), 1.); - QVector4D pR = mat*p; - QVector4D nR = mat*n; + float D = float(d * CGAL_PI / 180.); +// float a = float(std::atan(Rf / 0.33)); //point A1 + QVector4D p(0.f, 1.f, 0.f, 1.f); + QVector4D pR = mat*p; +// QVector4D n(Rf*sin(D), sin(a), Rf*cos(D), 1.f); +// QVector4D nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back((float)color.x); - data.push_back((float)color.y); - data.push_back((float)color.z); //point B1 p = QVector4D(Rf*sin(D), 0.66f, Rf* cos(D), 1.f); - n = QVector4D(sin(D), sin(a), cos(D), 1.); pR = mat*p; - nR = mat*n; +// n = QVector4D(sin(D), sin(a), cos(D), 1.); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back((float)color.x); - data.push_back((float)color.y); - data.push_back((float)color.z); + //point C1 D = float((d+360/prec)*CGAL_PI/180.0); p = QVector4D(Rf* sin(D), 0.66f, Rf* cos(D), 1.f); - n = QVector4D(sin(D), sin(a), cos(D), 1.0); pR = mat*p; - nR = mat*n; - +// n = QVector4D(sin(D), sin(a), cos(D), 1.f); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back((float)color.x); - data.push_back((float)color.y); - data.push_back((float)color.z); - } //cylinder @@ -3318,98 +3178,62 @@ void CGAL::QGLViewer::drawArrow(double r,double R, int prec, CGAL::qglviewer::Ve for(int d = 0; d<360; d+= 360/prec) { //point A1 - float D = float(d*CGAL_PI/180.0); + float D = float(d*CGAL_PI/180.); QVector4D p(rf*sin(D), 0.66f, rf*cos(D), 1.f); - QVector4D n(sin(D), 0.f, cos(D), 1.f); QVector4D pR = mat*p; - QVector4D nR = mat*n; - +// QVector4D n(sin(D), 0.f, cos(D), 1.f); +// QVector4D nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); + //point B1 - p = QVector4D(rf * sin(D),0,rf*cos(D), 1.0); - n = QVector4D(sin(D), 0, cos(D), 1.0); + p = QVector4D(rf * sin(D), 0.f, rf*cos(D), 1.f); pR = mat*p; - nR = mat*n; - - +// n = QVector4D(sin(D), 0.f, cos(D), 1.f); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); - //point C1 - D = float((d+360/prec)*CGAL_PI/180.0); - p = QVector4D(rf * sin(D),0,rf*cos(D), 1.0); - n = QVector4D(sin(D), 0, cos(D), 1.0); + + //point C1 + D = float((d + 360./prec) * CGAL_PI/180.0); + p = QVector4D(rf * sin(D), 0.f, rf*cos(D), 1.f); pR = mat*p; - nR = mat*n; +// n = QVector4D(sin(D), 0.f, cos(D), 1.f); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); + //point A2 - D = float((d+360/prec)*CGAL_PI/180.0); - - p = QVector4D(rf * sin(D),0,rf*cos(D), 1.0); - n = QVector4D(sin(D), 0, cos(D), 1.0); + D = float((d + 360./prec) * CGAL_PI/180.); + p = QVector4D(rf * sin(D), 0.f, rf*cos(D), 1.f); pR = mat*p; - nR = mat*n; +// n = QVector4D(sin(D), 0.f, cos(D), 1.f); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); + //point B2 p = QVector4D(rf * sin(D), 0.66f, rf*cos(D), 1.f); - n = QVector4D(sin(D), 0, cos(D), 1.0); pR = mat*p; - nR = mat*n; +// n = QVector4D(sin(D), 0.f, cos(D), 1.f); +// nR = mat*n; data.push_back(pR.x()); data.push_back(pR.y()); data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); - //point C2 - D = float(d*CGAL_PI/180.0); - p = QVector4D(rf * sin(D), 0.66f, rf*cos(D), 1.f); - n = QVector4D(sin(D), 0.f, cos(D), 1.f); - pR = mat*p; - nR = mat*n; - data.push_back(pR.x()); - data.push_back(pR.y()); - data.push_back(pR.z()); - data.push_back(nR.x()); - data.push_back(nR.y()); - data.push_back(nR.z()); - data.push_back(float(color.x)); - data.push_back(float(color.y)); - data.push_back(float(color.z)); + //point C2 + D = float(d * CGAL_PI/180.); + p = QVector4D(rf * sin(D), 0.66f, rf*cos(D), 1.f); + pR = mat*p; +// n = QVector4D(sin(D), 0.f, cos(D), 1.f); +// nR = mat*n; + data.push_back(pR.x()); + data.push_back(pR.y()); + data.push_back(pR.z()); } } @@ -3421,30 +3245,41 @@ positive X, Y and Z directions in the top right corner of the screen. X arrow is red, Y arrow is green and Z arrow is blue.*/ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::drawAxis(qreal length) { - std::vector data; - data.resize(0); - drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(length,0,0),CGAL::qglviewer::Vec(1,0,0), data); - drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,length,0),CGAL::qglviewer::Vec(0,1,0), data); - drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,0,length),CGAL::qglviewer::Vec(0,0,1), data); - rendering_program_light.bind(); - vaos[AXIS].bind(); - vbos[Axis].bind(); - vbos[Axis].allocate(data.data(), static_cast(data.size() * sizeof(float))); - rendering_program_light.enableAttributeArray("vertex"); - rendering_program_light.setAttributeBuffer("vertex",GL_FLOAT,0,3, - static_cast(9*sizeof(float))); + std::vector axis_x_data, axis_y_data, axis_z_data; - rendering_program_light.enableAttributeArray("normal"); - rendering_program_light.setAttributeBuffer("normal",GL_FLOAT,3*sizeof(float),3, - static_cast(9*sizeof(float))); + drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(length,0,0), axis_x_data); + drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,length,0), axis_y_data); + drawArrow(0.06,0.12,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,0,length), axis_z_data); - rendering_program_light.enableAttributeArray("colors"); - rendering_program_light.setAttributeBuffer("colors",GL_FLOAT,6*sizeof(float),3, - static_cast(9*sizeof(float))); - vbos[Axis].release(); - vaos[AXIS].release(); - axis_size = data.size(); - rendering_program_light.release(); + rendering_program.bind(); + + vaos[AXIS_X].bind(); + vbos[Axis_x].bind(); + vbos[Axis_x].allocate(axis_x_data.data(), static_cast(axis_x_data.size() * sizeof(float))); + rendering_program.enableAttributeArray("vertex"); + rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); + vbos[Axis_x].release(); + vaos[AXIS_X].release(); + + vaos[AXIS_Y].bind(); + vbos[Axis_y].bind(); + vbos[Axis_y].allocate(axis_y_data.data(), static_cast(axis_y_data.size() * sizeof(float))); + rendering_program.enableAttributeArray("vertex"); + rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); + vbos[Axis_y].release(); + vaos[AXIS_Y].release(); + + vaos[AXIS_Z].bind(); + vbos[Axis_z].bind(); + vbos[Axis_z].allocate(axis_z_data.data(), static_cast(axis_z_data.size() * sizeof(float))); + rendering_program.enableAttributeArray("vertex"); + rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); + vbos[Axis_z].release(); + vaos[AXIS_Z].release(); + + rendering_program.release(); + + axis_size = axis_x_data.size(); // == axis_y_data.size() == axis_z_data.size() } /*! Draws a grid in the XY plane, centered on (0,0,0) (defined in the current @@ -3455,66 +3290,70 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::drawGrid(qreal size, int nbSubdivisions) { //The Grid - std::vector v_Grid; + std::vector grid_data; for (int i=0; i<=nbSubdivisions; ++i) { - const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); - v_Grid.push_back(pos); - v_Grid.push_back(float(-size)); - v_Grid.push_back(0.f); + const float pos = float(size*(2.0*i/nbSubdivisions-1.0)); + grid_data.push_back(pos); + grid_data.push_back(float(-size)); + grid_data.push_back(0.f); - v_Grid.push_back(pos); - v_Grid.push_back(float(+size)); - v_Grid.push_back(0.f); + grid_data.push_back(pos); + grid_data.push_back(float(+size)); + grid_data.push_back(0.f); - v_Grid.push_back(float(-size)); - v_Grid.push_back(pos); - v_Grid.push_back(0.f); + grid_data.push_back(float(-size)); + grid_data.push_back(pos); + grid_data.push_back(0.f); - v_Grid.push_back( float(size)); - v_Grid.push_back( pos); - v_Grid.push_back( 0.f); + grid_data.push_back(float(size)); + grid_data.push_back(pos); + grid_data.push_back(0.f); } + rendering_program.bind(); vaos[GRID].bind(); vbos[Grid].bind(); - vbos[Grid].allocate(v_Grid.data(),static_cast(v_Grid.size()*sizeof(float))); + vbos[Grid].allocate(grid_data.data(),static_cast(grid_data.size()*sizeof(float))); rendering_program.enableAttributeArray("vertex"); rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); vbos[Grid].release(); vaos[GRID].release(); rendering_program.release(); - grid_size = v_Grid.size(); + grid_size = grid_data.size(); //The Axis - std::vector d_axis; - d_axis.resize(0); - //d_axis is filled by drawArrow always this way : V.x V.y V.z N.x N.y N.z C.r C.g C.b, so it is possible - //to use a single buffer with offset and stride - drawArrow(0.005*size,0.02*size,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(size,0,0),CGAL::qglviewer::Vec(1,0,0), d_axis); - drawArrow(0.005*size,0.02*size,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,size,0),CGAL::qglviewer::Vec(0,1,0), d_axis); + std::vector grid_axis_x_data, grid_axis_y_data; + grid_axis_x_data.reserve(270); // default subdivision parameter yields this amount + grid_axis_y_data.reserve(270); - rendering_program_light.bind(); - vaos[GRID_AXIS].bind(); - vbos[Grid_axis].bind(); - vbos[Grid_axis].allocate(d_axis.data(), static_cast(d_axis.size() * sizeof(float))); - rendering_program_light.enableAttributeArray("vertex"); - rendering_program_light.setAttributeBuffer("vertex",GL_FLOAT,0,3, - static_cast(9*sizeof(float))); + //axis_data is filled by drawArrow always this way : V.x V.y V.z + drawArrow(0.005,0.02,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(size,0,0), grid_axis_x_data); + drawArrow(0.005,0.02,10, CGAL::qglviewer::Vec(0,0,0),CGAL::qglviewer::Vec(0,size,0), grid_axis_y_data); - rendering_program_light.enableAttributeArray("normal"); - rendering_program_light.setAttributeBuffer("normal",GL_FLOAT,3*sizeof(float),3, - static_cast(9*sizeof(float))); + rendering_program.bind(); - rendering_program_light.enableAttributeArray("colors"); - rendering_program_light.setAttributeBuffer("colors",GL_FLOAT,6*sizeof(float),3, - static_cast(9*sizeof(float))); - vbos[Grid_axis].release(); + // X + vaos[GRID_AXIS_X].bind(); + vbos[Grid_axis_x].bind(); + vbos[Grid_axis_x].allocate(grid_axis_x_data.data(), static_cast(grid_axis_x_data.size() * sizeof(float))); + rendering_program.enableAttributeArray("vertex"); + rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); + vbos[Grid_axis_x].release(); + vaos[GRID_AXIS_X].release(); - vaos[GRID_AXIS].release(); - rendering_program_light.release(); + // Y + vaos[GRID_AXIS_Y].bind(); + vbos[Grid_axis_y].bind(); + vbos[Grid_axis_y].allocate(grid_axis_y_data.data(), static_cast(grid_axis_y_data.size() * sizeof(float))); + rendering_program.enableAttributeArray("vertex"); + rendering_program.setAttributeBuffer("vertex",GL_FLOAT,0,3); + vbos[Grid_axis_y].release(); + vaos[GRID_AXIS_Y].release(); - g_axis_size = d_axis.size(); + rendering_program.release(); + + grid_axis_size = grid_axis_x_data.size(); // == grid_axis_y_data.size() } //////////////////////////////////////////////////////////////////////////////// @@ -3545,7 +3384,7 @@ void CGAL::QGLViewer::setOffset(CGAL::qglviewer::Vec offset) } CGAL_INLINE_FUNCTION -CGAL::qglviewer::Vec CGAL::QGLViewer::offset()const +const CGAL::qglviewer::Vec& CGAL::QGLViewer::offset() const { return _offset; } @@ -3568,7 +3407,7 @@ void CGAL::QGLViewer::setSceneCenter(const CGAL::qglviewer::Vec ¢er) { CGAL_INLINE_FUNCTION void CGAL::QGLViewer::setSceneBoundingBox(const CGAL::qglviewer::Vec &min, - const CGAL::qglviewer::Vec &max) { + const CGAL::qglviewer::Vec &max) { camera()->setSceneBoundingBox(min + offset(), max + offset()); } @@ -3580,7 +3419,10 @@ void CGAL::QGLViewer::showEntireScene() { CGAL_INLINE_FUNCTION -QImage* CGAL::QGLViewer::takeSnapshot( CGAL::qglviewer::SnapShotBackground background_color, QSize finalSize, double oversampling, bool expand) +QImage* CGAL::QGLViewer::takeSnapshot(CGAL::qglviewer::SnapShotBackground background_color, + QSize finalSize, + double oversampling, + bool expand) { makeCurrent(); qreal aspectRatio = width() / static_cast(height()); @@ -3608,7 +3450,6 @@ QImage* CGAL::QGLViewer::takeSnapshot( CGAL::qglviewer::SnapShotBackground back QSize subSize(int(width()/oversampling), int(height()/oversampling)); QSize size=QSize(width(), height()); - qreal newAspectRatio = finalSize.width() / static_cast(finalSize.height()); qreal zNear = camera()->zNear(); diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h index 92afeab7ae1..e65eb447e2e 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h @@ -795,8 +795,7 @@ public: Assert_compile_time_tag(Supports_vertex_halfedge(), Tag_true()); Assert_compile_time_tag(Supports_halfedge_vertex(), Tag_true()); - unsigned int nb_erased_components = 0, - nb_isolated_vertices = 0; + unsigned int nb_erased_components = 0; // Gets list of connected components, ordered by size (i.e. number of vertices) std::vector components; @@ -818,13 +817,9 @@ public: else // if isolated vertex { vertices_erase(vertex); - nb_isolated_vertices++; } } -// if (nb_isolated_vertices > 0) -// std::cerr << " Erased " << nb_isolated_vertices << " isolated vertices\n"; - return nb_erased_components; } diff --git a/Heat_method_3/doc/Heat_method_3/PackageDescription.txt b/Heat_method_3/doc/Heat_method_3/PackageDescription.txt index f562ab1ce22..c13822436f1 100644 --- a/Heat_method_3/doc/Heat_method_3/PackageDescription.txt +++ b/Heat_method_3/doc/Heat_method_3/PackageDescription.txt @@ -1,13 +1,12 @@ // The Heat Method -/// \defgroup PkgHeatMethod Heat Method Reference +/// \defgroup PkgHeatMethodRef Heat Method Reference /// \defgroup PkgHeatMethodConcepts Concepts -/// \ingroup PkgHeatMethod - +/// \ingroup PkgHeatMethodRef /*! -\addtogroup PkgHeatMethod +\addtogroup PkgHeatMethodRef \cgalPkgDescriptionBegin{The Heat Method,PkgHeatMethod} \cgalPkgPicture{heat-method-small.png} @@ -17,8 +16,8 @@ \cgalPkgDesc{The package provides an algorithm that solves the single- or multiple-source shortest path problem by returning an approximation of the geodesic distance for all vertices of a triangle mesh to the closest vertex in a given set of -source vertices. } -\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethod} +source vertices.} +\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethodRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.14} diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h index 73d369695b1..b257c53843d 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h @@ -21,9 +21,9 @@ #include #include #include +#include #include #include -#include #include #ifdef CGAL_EIGEN3_ENABLED #include @@ -90,58 +90,56 @@ protected: Face_id_map face_id_map; public: + /*! + \brief Constructor + */ + Surface_mesh_geodesic_distances_3(const TriangleMesh& tm, + VertexPointMap vpm) + : vertex_id_map(get(Vertex_property_tag(), tm)), + face_id_map(get(Face_property_tag(), tm)), + v2v(tm), + tm(tm), + vpm(vpm) + { + build(); + } /*! \brief Constructor */ Surface_mesh_geodesic_distances_3(const TriangleMesh& tm) - : vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(get(vertex_point,tm)) + : Surface_mesh_geodesic_distances_3(tm, get(vertex_point, tm)) { build(); } - - /*! - \brief Constructor - */ - Surface_mesh_geodesic_distances_3(const TriangleMesh& tm, VertexPointMap vpm) - : vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(vpm) - { - build(); - } - - /** * returns the triangle mesh the algorithm is running on. */ - const TriangleMesh& triangle_mesh() const{ + const TriangleMesh& triangle_mesh() const + { return tm; } - private: - const Matrix& mass_matrix() const { return m_mass_matrix; } - const Matrix& cotan_matrix() const { return m_cotan_matrix; } - const VertexPointMap& vertex_point_map() const { return vpm; } - const Vertex_id_map& get_vertex_id_map() const { @@ -149,7 +147,6 @@ private: } public: - /** * adds `vd` to the source set, returning `false` iff `vd` is already in the set. */ @@ -176,7 +173,6 @@ public: } } - /** * removes `vd` from the source set, returning `true` iff `vd` was in the set. */ @@ -188,7 +184,6 @@ public: return (m_sources.erase(v2v(vd)) == 1); } - /** * clears the current source set. */ @@ -203,7 +198,6 @@ public: /** * returns the set of source vertices. */ - const Vertex_const_range& sources() const { @@ -211,7 +205,6 @@ public: } private: - double summation_of_edges() const { @@ -237,14 +230,12 @@ private: return edge_sum; } - double time_step() const { return m_time_step; } - void update_kronecker_delta() { @@ -263,14 +254,12 @@ private: m_kronecker.swap(K); } - const Matrix& kronecker_delta() const { return m_kronecker; } - void factor_cotan_laplace() { Matrix A, A0; @@ -293,7 +282,6 @@ private: } } - void compute_unit_gradient() { @@ -352,7 +340,6 @@ private: } } - void compute_divergence() { @@ -400,7 +387,6 @@ private: indexD.swap(m_index_divergence); } - // modifies m_solved_phi void value_at_source_set(const Vector& phi) @@ -432,7 +418,6 @@ private: m_solved_phi.swap(source_set_val); } - void factor_phi() { @@ -443,7 +428,6 @@ private: } } - void solve_phi() { @@ -456,7 +440,6 @@ private: value_at_source_set(phi); } - // this function returns a (number of vertices)x1 vector where // the ith index has the distance from the first vertex to the ith vertex const Vector& @@ -466,7 +449,6 @@ private: } public: - /** * Updates the distance property map after changes in the source set. **/ @@ -494,7 +476,6 @@ public: } private: - void build() { @@ -507,13 +488,16 @@ private: } m_source_change_flag = false; - CGAL_precondition(is_triangle_mesh(tm)); Index i = 0; for(vertex_descriptor vd : vertices(tm)){ put(vertex_id_map, vd, i++); } Index face_i = 0; for(face_descriptor fd : faces(tm)){ + // Do not use BGL's version because `tm` is not a valid halfedge graph due to its weird vertex descriptor: + // it fails checks such as halfedge(target(h, g), g) == h + CGAL_assertion_code(halfedge_descriptor hd = halfedge(fd, tm);) + CGAL_assertion(hd == next(next(next(hd,tm),tm),tm)); put(face_id_map, fd, face_i++); } dimension = static_cast(num_vertices(tm)); @@ -714,7 +698,7 @@ struct Base_helper /** - * \ingroup PkgHeatMethod + * \ingroup PkgHeatMethodRef * * Class `Surface_mesh_geodesic_distances_3` computes estimated geodesic distances for a set of source vertices where sources can be added and removed. * The class performs a preprocessing step that only depends on the mesh, so that the distance computation takes less @@ -788,6 +772,7 @@ class Surface_mesh_geodesic_distances_3 typedef typename Default::Get< VertexPointMap, typename boost::property_map< TriangleMesh, vertex_point_t>::const_type>::type Vertex_point_map; + typedef typename Default::Get::vertex_descriptor vertex_descriptor; #ifndef DOXYGEN_RUNNING @@ -906,7 +890,7 @@ public: }; #if defined(DOXYGEN_RUNNING) || defined(CGAL_EIGEN3_ENABLED) -/// \ingroup PkgHeatMethod +/// \ingroup PkgHeatMethodRef /// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given source vertex. /// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined. /// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph`. @@ -947,7 +931,7 @@ estimate_geodesic_distances(const TriangleMesh& tm, #endif -/// \ingroup PkgHeatMethod +/// \ingroup PkgHeatMethodRef /// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given set of source vertices. /// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined. /// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph` diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h index 4006dc23be3..cff7968bd7e 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h @@ -57,7 +57,6 @@ namespace internal { template bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) { - typedef typename Traits::Point_3 Point; typedef typename Traits::Vector_3 Vector_3; typename Traits::Construct_vector_3 construct_vector = traits.construct_vector_3_object(); @@ -66,13 +65,16 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) typename Traits::Construct_cross_product_vector_3 cross_product = traits.construct_cross_product_vector_3_object(); - typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type - vpm = get(boost::vertex_point, tm); + typedef typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type VPM; + typedef typename boost::property_traits::reference Point_ref; + + VPM vpm = get(boost::vertex_point, tm); + for (typename boost::graph_traits::face_descriptor f : faces(tm)) { - const Point p1 = get(vpm, target(halfedge(f, tm), tm)); - const Point p2 = get(vpm, target(next(halfedge(f, tm), tm), tm)); - const Point p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm)); + const Point_ref p1 = get(vpm, target(halfedge(f, tm), tm)); + const Point_ref p2 = get(vpm, target(next(halfedge(f, tm), tm), tm)); + const Point_ref p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm)); Vector_3 v = cross_product(construct_vector(p1, p2), construct_vector(p1, p3)); if(scalar_product(v, v) == 0.) return true; @@ -82,7 +84,8 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits) } template -struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor { +struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor +{ typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; halfedge_descriptor hd; @@ -99,6 +102,16 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor { explicit Intrinsic_Delaunay_triangulation_3_vertex_descriptor(const vertex_descriptor vd, const TriangleMesh& tm) : hd(halfedge(vd,tm)) {} + + bool operator==(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const + { + return hd == other.hd; + } + + bool operator!=(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const + { + return ! (*this == other); + } }; template @@ -121,7 +134,7 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor }; /** - * \ingroup PkgHeatMethod + * \ingroup PkgHeatMethodRef * * Class `Intrinsic_Delaunay_triangulation_3` is a remeshing algorithm to improve the approximation of the `Surface_mesh_geodesic_distances_3`. * It internally makes a copy of the triangle mesh, performs edge flips, and computes 2D vertex coordinates per face @@ -267,7 +280,7 @@ private: } - //returns true if edge is locally Delaunay (opposing angles are less than pi): + //returns `true` if edge is locally Delaunay (opposing angles are less than pi): //Two ways of doing this: taking angles directly (not good with virtual edges) //OR: taking edge length and using law of cosines, //The second way checks cotan weights @@ -340,7 +353,6 @@ private: void loop_over_edges(edge_stack stack, std::vector& marked_edges) { - int a = 0; while(!stack.empty()) { edge_descriptor ed = stack.top(); stack.pop(); @@ -351,7 +363,6 @@ private: //if the edge itself is not locally delaunay, go back if(!(is_edge_locally_delaunay(ed))) { if(!(is_border(ed,m_intrinsic_tm))) { - a++; change_edge_length(edge_i,ed); halfedge_descriptor hd = (halfedge(ed, m_intrinsic_tm)); CGAL::Euler::flip_edge(hd, m_intrinsic_tm); @@ -393,7 +404,8 @@ private: void build(VertexPointMap vpm) { - CGAL_precondition(is_triangle_mesh(m_intrinsic_tm)); + CGAL_precondition(is_empty(m_intrinsic_tm)); + CGAL_precondition(is_triangle_mesh(m_input_tm)); typename Traits::Compute_squared_distance_3 squared_distance = Traits().compute_squared_distance_3_object(); @@ -549,6 +561,8 @@ struct graph_traits::vertices_size_type vertices_size_type; + static vertex_descriptor null_vertex() { return vertex_descriptor(boost::graph_traits::null_halfedge()); } + static halfedge_descriptor null_halfedge() { return boost::graph_traits::null_halfedge(); } static face_descriptor null_face() { return boost::graph_traits::null_face(); } }; @@ -589,7 +603,7 @@ template Iterator_range >::vertex_iterator> vertices(const Intrinsic_Delaunay_triangulation_3& idt) - { +{ std::pair::vertex_iterator, typename boost::graph_traits::vertex_iterator> p = vertices(idt.triangle_mesh()); @@ -597,7 +611,7 @@ vertices(const Intrinsic_Delaunay_triangulation_3& idt) Fct fct(idt.triangle_mesh()); return make_range(boost::make_transform_iterator(p.first, fct), boost::make_transform_iterator(p.second,fct)); - } +} template Iterator_range::face_iterator> faces(const Intrinsic_Delaunay_triangulation_3& idt) - { - return make_range( faces(idt.triangle_mesh()) ); - } +{ + return make_range( faces(idt.triangle_mesh()) ); +} template @@ -659,7 +673,7 @@ template typename boost::graph_traits >::halfedge_descriptor halfedge(typename boost::graph_traits >::edge_descriptor ed, - const Intrinsic_Delaunay_triangulation_3& idt) + const Intrinsic_Delaunay_triangulation_3& idt) { return halfedge(ed, idt.triangle_mesh()); } @@ -684,6 +698,23 @@ next(typename boost::graph_traits >::ha return next(hd, idt.triangle_mesh()); } +template +typename boost::graph_traits >::halfedge_descriptor +prev(typename boost::graph_traits >::halfedge_descriptor hd, + const Intrinsic_Delaunay_triangulation_3& idt) +{ + return prev(hd, idt.triangle_mesh()); +} + +template +typename boost::graph_traits >::edge_descriptor +edge(typename boost::graph_traits >::halfedge_descriptor hd, + const Intrinsic_Delaunay_triangulation_3& idt) +{ + return edge(hd, idt.triangle_mesh()); +} template @@ -766,11 +797,11 @@ struct IDT_vertex_distance_property_map { friend void put(IDT_vertex_distance_property_map idtpm, key_type vd, - value_type v) + value_type val) { typename boost::graph_traits::vertex_descriptor tm_vd = target(vd.hd, idtpm.idt.triangle_mesh()); - put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), v); + put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), val); } }; diff --git a/Heat_method_3/package_info/Heat_method_3/dependencies b/Heat_method_3/package_info/Heat_method_3/dependencies index 50488d5544f..42f0881808e 100644 --- a/Heat_method_3/package_info/Heat_method_3/dependencies +++ b/Heat_method_3/package_info/Heat_method_3/dependencies @@ -4,14 +4,12 @@ Cartesian_kernel Circulator Distance_2 Distance_3 -Filtered_kernel Heat_method_3 Installation Interval_support Kernel_23 Modular_arithmetic Number_types -Polygon_mesh_processing Profiling_tools Property_map Random_numbers diff --git a/Hyperbolic_triangulation_2/TODO b/Hyperbolic_triangulation_2/TODO index 8f691736b3d..0bc3cc547d9 100644 --- a/Hyperbolic_triangulation_2/TODO +++ b/Hyperbolic_triangulation_2/TODO @@ -8,7 +8,7 @@ class Construct_hyperbolic_bisector_2 Hyperbolic_segment_2 operator()(Point_2 p, Point_2 q, Point_2 r) at the end the following lines are giving the wrong arc (wrong orientation), aren't they? - CGAL_triangulation_assertion(assign(pair,inters[1])); + CGAL_assertion(assign(pair,inters[1])); if ( Orientation_2()(approx_c,approx_a,approx_pinf) == POSITIVE ) return Circular_arc_2( *c_pq, pair.first, a); return Circular_arc_2( *c_pq, a, pair.first); diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/HDT2.cpp b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/HDT2.cpp index 1d32eba2c8f..bd76416342b 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/HDT2.cpp +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/HDT2.cpp @@ -1,7 +1,3 @@ -#include - -// CGAL headers - #define USE_CORE_EXPR_KERNEL #ifndef USE_CORE_EXPR_KERNEL @@ -17,14 +13,6 @@ #include #include -// Qt headers -#include -#include -#include -#include -#include -#include - // GraphicsView items and event filters (input classes) #include #include @@ -38,8 +26,19 @@ // the two base classes #include +// Qt headers +#include +#include +#include +#include +#include +#include + #include "ui_HDT2.h" +#include +#include +#include #ifndef USE_CORE_EXPR_KERNEL typedef CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2<> K; @@ -47,8 +46,9 @@ typedef CGAL::Hyperbolic_Delaunay_triangulation_traits_2<> K; #endif - +typedef K::FT FT; typedef K::Point_2 Point_2; +typedef K::Circle_2 Circle_2; typedef K::Iso_rectangle_2 Iso_rectangle_2; typedef CGAL::Hyperbolic_Delaunay_triangulation_2 Delaunay; @@ -61,6 +61,8 @@ class MainWindow : private: Delaunay dt; + Circle_2 p_disk = Circle_2(Point_2(0, 0), 1); + QGraphicsEllipseItem* disk; QGraphicsScene scene; @@ -75,7 +77,7 @@ private: public: MainWindow(); -public slots: +public Q_SLOTS: void processInput(CGAL::Object o); @@ -101,7 +103,7 @@ public slots: virtual void open(QString fileName); -signals: +Q_SIGNALS: void changed(); }; @@ -114,19 +116,16 @@ MainWindow::MainWindow() this->graphicsView->setAcceptDrops(false); // Add Poincaré disk - qreal origin_x = 0, origin_y = 0, radius = 1, diameter = 2*radius; + qreal origin_x = CGAL::to_double(p_disk.center().x()); + qreal origin_y = CGAL::to_double(p_disk.center().y()); + qreal radius = std::sqrt(CGAL::to_double(p_disk.squared_radius())); + qreal diameter = std::sqrt(CGAL::to_double(4 * p_disk.squared_radius())); qreal left_top_corner_x = origin_x - radius; qreal left_top_corner_y = origin_y - radius; qreal width = diameter, height = diameter; - disk = new QGraphicsEllipseItem(left_top_corner_x, left_top_corner_y, width, height); - - QPen pen; // creates a default pen - - pen.setWidthF(0.025); - pen.setBrush(Qt::black); + QPen pen(::Qt::black, 0.015); disk->setPen(pen); - scene.addItem(disk); // Add a GraphicItem for the Delaunay triangulation @@ -183,31 +182,24 @@ MainWindow::MainWindow() // We put mutually exclusive actions in an QActionGroup QActionGroup* ag = new QActionGroup(this); ag->addAction(this->actionInsertPoint); - //ag->addAction(this->actionMovingPoint); + ag->addAction(this->actionMovingPoint); ag->addAction(this->actionCircumcenter); ag->addAction(this->actionShowConflictZone); + this->actionMovingPoint->setDisabled(true); + // Check two actions this->actionInsertPoint->setChecked(true); this->actionShowDelaunay->setChecked(true); - // // Setup the scene and the view - // scene.setItemIndexMethod(QGraphicsScene::NoIndex); scene.setSceneRect(left_top_corner_x, left_top_corner_y, width, height); this->graphicsView->setScene(&scene); this->graphicsView->setMouseTracking(true); - // we want to adjust the coordinates of QGraphicsView to the coordinates of QGraphicsScene - // the following line must do this: - // this->graphicsView->fitInView( scene.sceneRect(), Qt::KeepAspectRatio); - // It does not do this sufficiently well. - // Current solution: - this->graphicsView->shear(230, 230); - // Turn the vertical axis upside down - this->graphicsView->transform().scale(1, -1); + this->graphicsView->scale(1, -1); // The navigation adds zooming and translation functionality to the // QGraphicsView @@ -229,20 +221,17 @@ MainWindow::processInput(CGAL::Object o) { Point_2 p; if(CGAL::assign(p, o)){ - QPointF qp(CGAL::to_double(p.x()), CGAL::to_double(p.y())); - // note that if the point is on the boundary then the disk contains the point - if(disk->contains(qp)){ + if(!p_disk.has_on_unbounded_side(p)) dt.insert(p); - } } - emit(changed()); + Q_EMIT(changed()); } /* * Qt Automatic Connections - * http://doc.trolltech.com/4.4/designer-using-a-component.html#automatic-connections + * https://doc.qt.io/qt-5/designer-using-a-ui-file.html#automatic-connections * * setupUi(this) generates connections to the slots named * "on__" @@ -300,7 +289,7 @@ void MainWindow::on_actionClear_triggered() { dt.clear(); - emit(changed()); + Q_EMIT(changed()); } @@ -310,7 +299,9 @@ MainWindow::on_actionInsertRandomPoints_triggered() QRectF rect = CGAL::Qt::viewportsBbox(&scene); CGAL::Qt::Converter convert; Iso_rectangle_2 isor = convert(rect); - CGAL::Random_points_in_disc_2 pg(1); + + qreal radius = std::sqrt(CGAL::to_double(p_disk.squared_radius())); + CGAL::Random_points_in_disc_2 pg(radius); bool ok = false; const int number_of_points = QInputDialog::getInt(this, @@ -336,7 +327,7 @@ MainWindow::on_actionInsertRandomPoints_triggered() dt.insert(points.begin(), points.end()); // default cursor QApplication::restoreOverrideCursor(); - emit(changed()); + Q_EMIT(changed()); } @@ -359,9 +350,11 @@ MainWindow::open(QString fileName) QApplication::setOverrideCursor(Qt::WaitCursor); std::ifstream ifs(qPrintable(fileName)); - K::Point_2 p; - std::vector points; + Point_2 p; + std::vector points; while(ifs >> p) { + if(p_disk.has_on_unbounded_side(p)) + continue; points.push_back(p); } dt.insert(points.begin(), points.end()); @@ -370,7 +363,7 @@ MainWindow::open(QString fileName) QApplication::restoreOverrideCursor(); this->addToRecentFiles(fileName); actionRecenter->trigger(); - emit(changed()); + Q_EMIT(changed()); } @@ -396,10 +389,17 @@ MainWindow::on_actionSavePoints_triggered() void MainWindow::on_actionRecenter_triggered() { - this->graphicsView->setSceneRect(dgi->boundingRect()); - this->graphicsView->fitInView(dgi->boundingRect(), Qt::KeepAspectRatio); -} + qreal origin_x = CGAL::to_double(p_disk.center().x()); + qreal origin_y = CGAL::to_double(p_disk.center().y()); + qreal radius = std::sqrt(CGAL::to_double(p_disk.squared_radius())); + qreal diameter = std::sqrt(CGAL::to_double(4 * p_disk.squared_radius())); + qreal scale = 1.1; + this->graphicsView->setSceneRect(origin_x - radius, origin_y - radius, diameter, diameter); + this->graphicsView->fitInView(origin_x - scale * radius, origin_y - scale * radius, + scale * diameter, scale * diameter, + Qt::KeepAspectRatio); +} #include "HDT2.moc" @@ -409,14 +409,14 @@ int main(int argc, char **argv) app.setOrganizationDomain("geometryfactory.com"); app.setOrganizationName("GeometryFactory"); - app.setApplicationName("Delaunay_triangulation_2 demo"); + app.setApplicationName("Hyperbolic_Delaunay_triangulation_2 demo"); - // Import resources from libCGALQt5 - // See http://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE - CGAL_Qt_init_resources();// that function is in a DLL + // Import resources from libCGAL (QT5). + CGAL_QT_INIT_RESOURCES; MainWindow mainWindow; mainWindow.show(); + mainWindow.on_actionRecenter_triggered(); QStringList args = app.arguments(); args.removeAt(0); diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h index 81db1e62dda..73eea197640 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstream.h @@ -60,8 +60,8 @@ private: PainterOstream& operator<<(const Euclidean_segment_2& seg) { - const typename K::Point_2 & source = seg.source(); - const typename K::Point_2 & target = seg.target(); + const Point_2 & source = seg.source(); + const Point_2 & target = seg.target(); QPointF src(to_double(source.x()), to_double(source.y())); QPointF tgt(to_double(target.x()), to_double(target.y())); @@ -78,22 +78,22 @@ public: using Base::operator <<; - PainterOstream& operator << (Hyperbolic_segment_2 s) + PainterOstream& operator<<(const Hyperbolic_segment_2& s) { if(const Euclidean_segment_2* seg = boost::get(&s)) { - CGAL::Qt::PainterOstream::operator << (*seg); + CGAL::Qt::PainterOstream::operator << (*seg); return *this; } - Circular_arc_2* arc = boost::get(&s); + const Circular_arc_2& arc = boost::get(s); - if(arc->squared_radius() > 100) { - Euclidean_segment_2 seg(arc->source(), arc->target()); - CGAL::Qt::PainterOstream::operator << (seg); + if(arc.squared_radius() > 100) { + Euclidean_segment_2 seg(arc.source(), arc.target()); + CGAL::Qt::PainterOstream::operator << (seg); return *this; } - operator << (*arc); + operator<<(arc); return *this; } diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstreamCK.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstreamCK.h index 57c9839d155..8f434a5a41f 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstreamCK.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicPainterOstreamCK.h @@ -42,28 +42,25 @@ namespace Qt { using Base::operator <<; - PainterOstream& operator << (Hyperbolic_segment_2 s) + PainterOstream& operator <<(const Hyperbolic_segment_2& s) { if(const Line_arc* seg = boost::get(&s)) { operator << (*seg); return *this; } - Circular_arc* arc = boost::get(&s); + const Circular_arc& arc = boost::get(s); - if(arc->squared_radius() > 10) - // due to rounding, the arc drawn does not look like it - // passes through the endpoints + if(arc.squared_radius() > 10) + { + // due to rounding, the arc drawn does not look like it passes through the endpoints // so we replace the arc by a line segment - { - Point_2 source(to_double(arc->source().x()),to_double(arc->source().y())); - Point_2 target(to_double(arc->target().x()),to_double(arc->target().y())); - const Line_arc seg(source,target); - operator << (seg); - return *this; - } + const Line_arc seg(arc.source(),arc.target()); + operator << (seg); + return *this; + } - operator << (*arc); + operator<<(arc); return *this; } diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicVoronoiGraphicsItem.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicVoronoiGraphicsItem.h index 5d5cbc0fe18..9bf529d20b2 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicVoronoiGraphicsItem.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/HyperbolicVoronoiGraphicsItem.h @@ -97,9 +97,9 @@ VoronoiGraphicsItem
    ::paint(QPainter *painter, const QStyleOptionGraphicsItem painter->setPen(temp); // - for(typename DT::All_edges_iterator eit = dt->all_edges_begin(); - eit != dt->all_edges_end(); - eit++) + for(typename DT::Hyperbolic_edges_iterator eit = dt->hyperbolic_edges_begin(); + eit != dt->hyperbolic_edges_end(); + ++eit) { typename DT::Hyperbolic_segment s = dt->dual(*eit); pos << s; diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationConflictZone.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationConflictZone.h index 24b32f96c4c..5628c542cce 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationConflictZone.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationConflictZone.h @@ -15,12 +15,12 @@ #include #include + #include #include + #include - - namespace CGAL { namespace Qt { @@ -32,7 +32,7 @@ public: typedef typename DT::Face_handle Face_handle; typedef typename DT::Point Point; - TriangulationConflictZone(QGraphicsScene* s, DT * dt_, QObject* parent); + TriangulationConflictZone(QGraphicsScene* s, DT* dt_, QObject* parent); protected: void localize_and_insert_point(QPointF qt_point); @@ -44,22 +44,20 @@ protected: std::list faces; std::list qfaces; - DT * dt; + DT* dt; Converter convert; QGraphicsScene *scene_; bool animate; Face_handle hint; }; - template TriangulationConflictZone::TriangulationConflictZone(QGraphicsScene* s, - T * dt_, + T* dt_, QObject* parent) : GraphicsViewInput(parent), dt(dt_), scene_(s), animate(false) {} - template void TriangulationConflictZone::localize_and_insert_point(QPointF qt_point) @@ -67,30 +65,26 @@ TriangulationConflictZone::localize_and_insert_point(QPointF qt_point) Point p(convert(qt_point)); faces.clear(); - for(std::list::iterator it = qfaces.begin(); - it != qfaces.end(); - ++it){ - delete *it; - } + for(QGraphicsPolygonItem* gpi : qfaces) + delete gpi; qfaces.clear(); + hint = dt->locate(p, hint); dt->find_conflicts(p, std::back_inserter(faces), hint); - for(typename std::list::iterator it = faces.begin(); - it != faces.end(); - ++it){ - if(! dt->is_infinite(*it)){ - QGraphicsPolygonItem *item = new QGraphicsPolygonItem(convert(dt->hyperbolic_triangle(*it))); + + for(Face_handle fh : faces){ + if(! dt->is_infinite(fh)){ + QGraphicsPolygonItem *item = new QGraphicsPolygonItem(convert(dt->hyperbolic_triangle(fh))); QColor color(::Qt::blue); color.setAlpha(150); item->setBrush(color); + item->setPen(::Qt::NoPen); scene_->addItem(item); qfaces.push_back(item); } } } - - template void TriangulationConflictZone::mousePressEvent(QGraphicsSceneMouseEvent *event) @@ -105,7 +99,6 @@ TriangulationConflictZone::mousePressEvent(QGraphicsSceneMouseEvent *event) animate = true; } - template void TriangulationConflictZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event) @@ -115,23 +108,18 @@ TriangulationConflictZone::mouseMoveEvent(QGraphicsSceneMouseEvent *event) } } - template void TriangulationConflictZone::mouseReleaseEvent(QGraphicsSceneMouseEvent * /*event*/) { faces.clear(); - for(std::list::iterator it = qfaces.begin(); - it != qfaces.end(); - ++it){ - delete *it; - } + for(QGraphicsPolygonItem* gpi : qfaces) + delete gpi; + qfaces.clear(); animate = false; } - - template bool TriangulationConflictZone::eventFilter(QObject *obj, QEvent *event) @@ -154,7 +142,6 @@ TriangulationConflictZone::eventFilter(QObject *obj, QEvent *event) } } - } // namespace Qt } // namespace CGAL diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h index 688d29d7416..4f86e32390f 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationGraphicsItem.h @@ -22,6 +22,7 @@ #include #include +#include #include namespace CGAL { @@ -101,7 +102,7 @@ protected: template TriangulationGraphicsItem::TriangulationGraphicsItem(T * t_) - : t(t_), painterostream(0), + : t(t_), painterostream(nullptr), bb(0,0,0,0), bb_initialized(false), visible_edges(true), visible_vertices(true) { @@ -142,15 +143,13 @@ template void TriangulationGraphicsItem::drawAll(QPainter *painter) { - QPen pen; - pen.setWidthF(0.005); - pen.setBrush(::Qt::black); + QPen pen(::Qt::black, 0.005); painter->setPen(edges_pen); painterostream = PainterOstream(painter); if(visibleEdges()) { - for(typename T::All_edges_iterator eit = t->all_edges_begin(); - eit != t->all_edges_end(); + for(typename T::Hyperbolic_edges_iterator eit = t->hyperbolic_edges_begin(); + eit != t->hyperbolic_edges_end(); ++eit){ painterostream << t->hyperbolic_segment(*eit); } diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationMovingPoint.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationMovingPoint.h index 013e0877881..718e48a5709 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationMovingPoint.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationMovingPoint.h @@ -68,7 +68,7 @@ TriangulationMovingPoint::localize_and_insert_point(QPointF qt_point) if(lt != T::VERTEX){ vh = dt->insert(p, lt, fh, li); insertedPoint = true; - emit(modelChanged()); + Q_EMIT(modelChanged()); } else { vh = fh->vertex(0); insertedPoint = false; @@ -123,7 +123,7 @@ TriangulationMovingPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } vh = Vertex_handle(); - emit(modelChanged()); + Q_EMIT(modelChanged()); movePointToInsert = false; } diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationPointInputAndConflictZone.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationPointInputAndConflictZone.h index 0fdbc9a987f..af90333c76a 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationPointInputAndConflictZone.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationPointInputAndConflictZone.h @@ -15,12 +15,12 @@ #include #include + #include #include + #include - - namespace CGAL { namespace Qt { @@ -32,7 +32,7 @@ public: typedef typename DT::Face_handle Face_handle; typedef typename DT::Point Point; - TriangulationPointInputAndConflictZone(QGraphicsScene* s, DT * dt_, QObject* parent); + TriangulationPointInputAndConflictZone(QGraphicsScene* s, DT* dt_, QObject* parent); protected: void localize_and_insert_point(QPointF qt_point); @@ -44,23 +44,20 @@ protected: std::list faces; std::list qfaces; - DT * dt; + DT* dt; Converter convert; QGraphicsScene *scene_; Point p; }; - template -TriangulationPointInputAndConflictZone::TriangulationPointInputAndConflictZone(QGraphicsScene* s, - T * dt_, - QObject* parent) +TriangulationPointInputAndConflictZone:: +TriangulationPointInputAndConflictZone(QGraphicsScene* s, + T* dt_, + QObject* parent) : GraphicsViewInput(parent), dt(dt_), scene_(s) {} - - - template void TriangulationPointInputAndConflictZone::mousePressEvent(QGraphicsSceneMouseEvent *event) @@ -72,40 +69,34 @@ TriangulationPointInputAndConflictZone::mousePressEvent(QGraphicsSceneMouseEv return; } - dt->find_conflicts(p, std::back_inserter(faces)); - for(typename std::list::iterator it = faces.begin(); - it != faces.end(); - ++it){ - if(dt->is_Delaunay_hyperbolic(*it)){ - QGraphicsPolygonItem *item = new QGraphicsPolygonItem(convert(dt->hyperbolic_triangle(*it))); + + for(Face_handle fh : faces){ + if(! dt->is_infinite(fh)){ + QGraphicsPolygonItem* item = new QGraphicsPolygonItem(convert(dt->hyperbolic_triangle(fh))); QColor color(::Qt::blue); color.setAlpha(150); item->setBrush(color); + item->setPen(::Qt::NoPen); scene_->addItem(item); qfaces.push_back(item); } } } - template void TriangulationPointInputAndConflictZone::mouseReleaseEvent(QGraphicsSceneMouseEvent * /*event*/) { faces.clear(); - for(std::list::iterator it = qfaces.begin(); - it != qfaces.end(); - ++it){ - scene_->removeItem(*it); - delete *it; + for(QGraphicsPolygonItem* gpi : qfaces){ + scene_->removeItem(gpi); + delete gpi; } qfaces.clear(); - emit (generate(CGAL::make_object(p))); + Q_EMIT (generate(CGAL::make_object(p))); } - - template bool TriangulationPointInputAndConflictZone::eventFilter(QObject *obj, QEvent *event) @@ -124,7 +115,6 @@ TriangulationPointInputAndConflictZone::eventFilter(QObject *obj, QEvent *eve } } - } // namespace Qt } // namespace CGAL diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationRemoveVertex.h b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationRemoveVertex.h index c2ce4c5027a..d6253b729bf 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationRemoveVertex.h +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/include/internal/Qt/TriangulationRemoveVertex.h @@ -32,26 +32,21 @@ public: typedef typename DT::Vertex_handle Vertex_handle; typedef typename DT::Point Point; - TriangulationRemoveVertex(DT * dt_, QObject* parent); + TriangulationRemoveVertex(DT* dt_, QObject* parent); protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - bool eventFilter(QObject *obj, QEvent *event); - DT * dt; + DT* dt; }; - template TriangulationRemoveVertex::TriangulationRemoveVertex(T * dt_, QObject* parent) : GraphicsViewInput(parent), dt(dt_) {} - - template void TriangulationRemoveVertex::mousePressEvent(QGraphicsSceneMouseEvent *event) @@ -65,12 +60,10 @@ TriangulationRemoveVertex::mousePressEvent(QGraphicsSceneMouseEvent *event) typename T::Vertex_handle selected_vertex = dt->nearest_vertex(convert(event->scenePos())); dt->remove(selected_vertex); } - emit (modelChanged()); + Q_EMIT (modelChanged()); } } - - template bool TriangulationRemoveVertex::eventFilter(QObject *obj, QEvent *event) diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/resources/about_CGAL.html b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/resources/about_CGAL.html index 6b2b2a5d943..f2f0fb9318b 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/resources/about_CGAL.html +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/resources/about_CGAL.html @@ -3,6 +3,6 @@

    Computational Geometry Algorithms Library

    CGAL provides efficient and reliable geometric algorithms in the form of a C++ library.

    -

    For more information visit www.cgal.org

    +

    For more information visit www.cgal.org

    diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h index 8034109b11e..19e4c668351 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -214,15 +214,6 @@ public: */ Vertex_handle insert(const Point &p, Face_handle start = Face_handle()); - /*! - Inserts the point p at the location given by `(lt,loc,li)`. - The handle to the new vertex is returned. - - \sa locate() - */ - Vertex_handle insert(const Point& p, typename Locate_type lt, Face_handle loc, int li); - - /*! Inserts the points in the range [first,last) into the triangulation. Returns the number of inserted points. Note that this function is not diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Concepts/HyperbolicTriangulationFaceBase_2.h b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Concepts/HyperbolicTriangulationFaceBase_2.h index 45675b33aa7..a472fde6d31 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Concepts/HyperbolicTriangulationFaceBase_2.h +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/Concepts/HyperbolicTriangulationFaceBase_2.h @@ -5,6 +5,33 @@ \ingroup PkgHyperbolicTriangulation2Concepts \cgalConcept +The concept `HyperbolicTriangulationFaceBase_2` describes the requirements for an internal +data class that must be provided by the model of the `HyperbolicTriangulationFaceBase_2`. + +\sa `HyperbolicTriangulationFaceBase_2` +*/ +class HyperbolicFaceData { +public: + /// sets the face as infinite and non-Delaunay hyperbolic + void set_infinite(); + + /// sets the face as Delaunay hyperbolic + void set_Delaunay_hyperbolic(); + + /// returns whether the face is Delaunay hyperbolic, or not. + bool is_Delaunay_hyperbolic(); + + /// sets the `i`-th edge of the face as non-hyperbolic + void set_Delaunay_non_hyperbolic(int i); + + /// returns whether the `i`-th edge of the face is non-hyperbolic + bool is_Delaunay_non_hyperbolic(int i); +}; + +/*! +\ingroup PkgHyperbolicTriangulation2Concepts +\cgalConcept + \cgalRefines TriangulationFaceBase_2 The concept `HyperbolicTriangulationFaceBase_2` describes the requirements for the base @@ -17,12 +44,9 @@ internally by the triangulation class during the insertion of points in the tria \cgalHasModel `CGAL::Hyperbolic_triangulation_face_base_2` \sa `TriangulationDataStructure_2` - +\sa `HyperbolicFaceData` */ - - class HyperbolicTriangulationFaceBase_2 { - public: /// \name Internal Access Functions @@ -33,16 +57,16 @@ public: /// @{ /*! - This function gives non-`const` access to a variable of type `CGAL::Object`. + This function gives non-`const` access to a variable that is a model of `HyperbolicFaceData`. \cgalAdvancedFunction */ - CGAL::Object& tds_data(); + HyperbolicFaceData& hyperbolic_data(); /*! - This function gives `const` access to a variable of type `CGAL::Object`. + This function gives `const` access to a variable of that is a model of `HyperbolicFaceData`. \cgalAdvancedFunction */ - const CGAL::Object& tds_data() const; + const HyperbolicFaceData& hyperbolic_data() const; /// @} }; diff --git a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/PackageDescription.txt b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/PackageDescription.txt index 0d404ed57d7..0481775afa0 100644 --- a/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/PackageDescription.txt +++ b/Hyperbolic_triangulation_2/doc/Hyperbolic_triangulation_2/PackageDescription.txt @@ -46,8 +46,8 @@ The Delaunay triangulation of a set of points \f$P\f$ in the hyperbolic plane \f \cgalCRPSection{Concepts} - `HyperbolicDelaunayTriangulationTraits_2` describes the requirements for an interface for geometric objects, constructions, and predicates in the hyperbolic plane. -- `HyperbolicTriangulationFaceBase_2` describes the requirements for faces of the hyperbolic Delaunay triangulation to be filtered from the faces of the Euclidean Delaunay triangulation. - +- `HyperbolicTriangulationFaceBase_2` describes the requirements for faces of the hyperbolic Delaunay triangulation. +- `HyperbolicFaceData` describes the requirements for an hyperbolic marker of faces of the hyperbolic Delaunay triangulation, used to filter faces of the Euclidean Delaunay triangulation. \cgalCRPSection{Classes} diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h index 8e05bddc37c..2629ec1aff7 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -18,8 +18,10 @@ #include #include +#include #include #include +#include namespace CGAL { @@ -77,7 +79,7 @@ public: Hyperbolic_Delaunay_triangulation_2(const Hyperbolic_Delaunay_triangulation_2 &tr) : Delaunay_triangulation_2(tr), _gt() { - CGAL_triangulation_postcondition(this->is_valid()); + CGAL_postcondition(this->is_valid()); } template @@ -86,8 +88,6 @@ public: : Delaunay_triangulation_2(gt), _gt(gt) { insert(first, last); - for(All_vertices_iterator vit=all_vertices_begin(); vit!=all_vertices_end(); ++vit) - ensure_hyperbolic_face_handle(vit); } /************************************* @@ -107,8 +107,7 @@ private: bool operator()(const typename Base::All_faces_iterator & fit) const { return !t->is_Delaunay_hyperbolic(fit); } bool operator()(const typename Base::All_edges_iterator & eit) const { - Edge e(eit->first, eit->second); - return !t->is_Delaunay_hyperbolic(e); + return !t->is_Delaunay_hyperbolic(eit->first, eit->second); } }; @@ -194,10 +193,10 @@ public: do { _ri = cw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, ccw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, ccw(_iv))) { _ri = ccw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, cw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, cw(_iv))) { pos = pos->neighbor(cw(_iv)); _iv = pos->index(_v); @@ -223,10 +222,10 @@ public: do { _ri = cw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, ccw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, ccw(_iv))) { _ri = ccw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, cw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, cw(_iv))) { pos = pos->neighbor(cw(_iv)); _iv = pos->index(_v); @@ -254,10 +253,10 @@ public: do { _ri = ccw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, cw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, cw(_iv))) { _ri = cw(_iv); - if (_tri.is_finite_non_hyperbolic(pos, ccw(_iv))) + if (!_tri.is_Delaunay_hyperbolic(pos, ccw(_iv))) { pos = pos->neighbor(ccw(_iv)); _iv = pos->index(_v); @@ -291,13 +290,13 @@ public: Vertex& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); return *(pos->vertex(_ri)); } Vertex* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); return &*(pos->vertex(_ri)); } @@ -309,10 +308,9 @@ public: }; private: - Geom_traits _gt; + Geom_traits _gt; public: - Tds& tds() { return Base::tds(); @@ -345,17 +343,14 @@ public: tr.mark_finite_non_hyperbolic_faces(); } - Self& operator=(const Self &tr) { - Self newone = Self(tr); this->swap(newone); return *this; } - bool operator==(const Self& tr ) { if (tr.number_of_vertices() != this->number_of_vertices()) @@ -401,12 +396,6 @@ public: void clear() { Base::clear(); } - void mark_star(Vertex_handle v) const - { - if(!is_star_bounded(v)) - mark_star_faces(v); - } - template OutputItFaces find_conflicts(const Point& p, OutputItFaces fit, Face_handle start = Face_handle()) const { @@ -417,18 +406,22 @@ public: Face_handle start = Face_handle()) { Vertex_handle v = Base::insert(p, start); - mark_star(v); + mark_star_faces(v); ensure_hyperbolic_face_handle(v); return v; } + // Note that this is _Base::Locate_type_ and not Locate_type. + // Do _not_ use this function with the result of a call to HDT2::locate(), which is a locate + // on the hyperbolic triangulation, and not the underlying Delaunay triangulation (in which + // new points are inserted, and thus it needs to be DT2::locate_type). Vertex_handle insert(const Point& p, typename Base::Locate_type lt, Face_handle loc, int li) { Vertex_handle v = Base::insert(p, lt, loc, li); - mark_star(v); + mark_star_faces(v); ensure_hyperbolic_face_handle(v); return v; @@ -454,11 +447,9 @@ public: return n; } - - void remove(Vertex_handle v) { - CGAL_triangulation_precondition(tds().is_vertex(v)); + CGAL_precondition(tds().is_vertex(v)); std::vector nbr; bool dim_was_2 = false; if (this->dimension() == 2) @@ -483,7 +474,6 @@ public: } } - template void remove(VertexRemoveIterator first, VertexRemoveIterator last) { @@ -493,22 +483,37 @@ public: } } - - - /* - Needed by DT_2: do not document! - */ template bool is_infinite(T v) const { return Base::is_infinite(v); } + bool is_infinite(Face_handle f, int i) const { return Base::is_infinite(f, i); } bool is_Delaunay_hyperbolic(Face_handle f) const { - return !Base::is_infinite(f) && !is_finite_non_hyperbolic(f); + if(dimension() <= 1) + return false; + + return f->hyperbolic_data().is_Delaunay_hyperbolic(); } bool is_Delaunay_hyperbolic(Face_handle f, int i) const { - return !Base::is_infinite(f, i) && !is_finite_non_hyperbolic(f, i); + if(dimension() <= 1) + return false; + + if(is_infinite(f, i)) + return false; + + if(f->hyperbolic_data().is_Delaunay_non_hyperbolic(i)) + return false; + + // another incident face and corresponding index + Face_handle f2 = f->neighbor(i); + int i2 = f2->index(f); + + if(f2->hyperbolic_data().is_Delaunay_non_hyperbolic(i2)) + return false; + + return true; } bool is_Delaunay_hyperbolic(const Edge& e) const @@ -527,68 +532,37 @@ public: } private: - class Face_data - { - private: - // a finite face is non_hyperbolic if its circumscribing circle intersects the circle at infinity - bool _is_Delaunay_hyperbolic; - - // defined only if the face is finite and non_hyperbolic - unsigned int _non_hyperbolic_edge; - - public: - Face_data() : _is_Delaunay_hyperbolic(true), _non_hyperbolic_edge(UCHAR_MAX) {} - - unsigned int get_non_hyperbolic_edge() const - { - CGAL_triangulation_precondition(!_is_Delaunay_hyperbolic); - CGAL_triangulation_precondition(_non_hyperbolic_edge <= 2); - - return _non_hyperbolic_edge; - } - - void set_non_hyperbolic_edge(unsigned int uschar) - { - CGAL_triangulation_precondition(!_is_Delaunay_hyperbolic); - CGAL_triangulation_precondition(uschar <= 2); - - _non_hyperbolic_edge = uschar; - } - - bool get_is_Delaunay_hyperbolic() const { return _is_Delaunay_hyperbolic; } - void set_is_Delaunay_hyperbolic(bool flag) { _is_Delaunay_hyperbolic = flag; } - }; - /* During the insertion of a new point in the triangulation, the added vertex points to a face. - This function ensures that the face to which the vertex points is hyperbolic. + This function ensures that the face to which the vertex points is hyperbolic (if there exists one). */ void ensure_hyperbolic_face_handle(Vertex_handle v) { - if(dimension() > 2) + if(dimension() <= 1) + return; + + Face_circulator fc = this->incident_faces(v), done(fc); + if(fc != 0) { - Face_circulator fc = this->incident_faces(v), done(fc); - if(fc != 0) + do { - do + if(is_Delaunay_hyperbolic(fc)) { - if(is_Delaunay_hyperbolic(fc)) - { - v->set_face(fc); - break; - } + v->set_face(fc); + break; } - while(++fc != done); } - CGAL_triangulation_postcondition(is_Delaunay_hyperbolic(v->face())); + while(++fc != done); } } Oriented_side side_of_hyperbolic_triangle(const Point& p, const Point& q, const Point& r, const Point& query, Locate_type <, int& li) const { + // The triangle (p,q,r) must be Delaunay hyperbolic - CGAL_triangulation_precondition(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)); + CGAL_precondition(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)); + CGAL_precondition(query != p && query != q && query != r); // Point p is assumed to be at index 0, q at index 1 and r at index 2 in the face. li = -1; @@ -644,186 +618,107 @@ private: // Cannot be on the boundary here. lt = FACE; + li = 4; + if(cs1 != cp1 || cs2 != cp2 || cs3 != cp3) return ON_NEGATIVE_SIDE; else return ON_POSITIVE_SIDE; } - int get_finite_non_hyperbolic_edge(Face_handle f) const - { - CGAL_triangulation_precondition(is_finite_non_hyperbolic(f)); - Face_data fd = object_cast(f->tds_data()); - return fd.get_non_hyperbolic_edge(); - } - - bool is_finite_non_hyperbolic(Face_handle f) const - { - if(const Face_data* td = object_cast(&f->tds_data())) - { - return !td->get_is_Delaunay_hyperbolic(); - } - else - { - return false; - } - } - - bool is_finite_non_hyperbolic(Face_handle f, int i) const - { - if(dimension() <= 1) - return false; - - if(is_finite_non_hyperbolic(f) && get_finite_non_hyperbolic_edge(f) == i) - return true; - - // another incident face and corresponding index - Face_handle f2 = f->neighbor(i); - int i2 = f2->index(f); - - if(is_finite_non_hyperbolic(f2) && get_finite_non_hyperbolic_edge(f2) == i2) - return true; - - return false; - } - - bool is_finite_non_hyperbolic(const Edge& e) const - { - return is_finite_non_hyperbolic(e.first, e.second); - } - - // Depth-first search (dfs) and marking the finite non_hyperbolic faces. void mark_finite_non_hyperbolic_faces() const { if(dimension() <= 1) return; - std::set visited_faces; + for(auto fit = Base::all_faces_begin(); fit != Base::all_faces_end(); ++fit) + fit->hyperbolic_data().set_Delaunay_hyperbolic(); // finite & hyperbolic - // maintain a stack to be able to backtrack - // to the most recent faces which neighbors are not visited - std::stack backtrack; + Face_handle ifh = Base::infinite_face(); + ifh->hyperbolic_data().set_infinite(); - // start from a face with infinite vertex - Face_handle current = Base::infinite_face(); + std::stack to_visit; + to_visit.push(ifh); - // mark it as visited - visited_faces.insert(current); + std::set visited_faces; // @todo squat tds_data() - // put the element whose neighbors we are going to explore. - backtrack.push(current); - - Face_handle next; - - while(!backtrack.empty()) + while(!to_visit.empty()) { - // take a face - current = backtrack.top(); + Face_handle fh = to_visit.top(); + to_visit.pop(); - // start visiting the neighbors - int i = 0; - for(; i<3; ++i) + if(!visited_faces.insert(fh).second) // already visited previously + continue; + + for(int i = 0; i<3; ++i) { - next = current->neighbor(i); + Face_handle nfh = fh->neighbor(i); + mark_face(nfh); - // if a neighbor is already visited, then stop going deeper - if(visited_faces.find(next) != visited_faces.end()) + if(is_Delaunay_hyperbolic(nfh)) continue; - visited_faces.insert(next); - mark_face(next); - - // go deeper if the neighbor is non_hyperbolic - if(!is_Delaunay_hyperbolic(next)) - { - backtrack.push(next); - break; - } + to_visit.push(nfh); } - - // if all the neighbors are already visited, then remove "current" face. - if(i == 3) - backtrack.pop(); } } - // check if a star is bounded by finite faces - bool is_star_bounded(Vertex_handle v) const - { - if(dimension() <= 1) - return true; - - Face_handle f = v->face(); - Face_handle next; - int i; - Face_handle start(f); - Face_handle opposite_face; - - do - { - i = f->index(v); - next = f->neighbor(ccw(i)); // turn ccw around v - - opposite_face = f->neighbor(i); - if(!is_Delaunay_hyperbolic(opposite_face)) - return false; - - f = next; - } - while(next != start); - - return true; - } - - void mark_star_faces(Vertex_handle v) const { if(dimension() <= 1) return; Face_handle f = v->face(); - Face_handle start(f), next; - int i; + Face_handle start(f); do { - i = f->index(v); - next = f->neighbor(ccw(i)); // turn ccw around v - mark_face(f); - f = next; - } while(next != start); + int i = f->index(v); + f = f->neighbor(ccw(i)); + } + while(f != start); } void mark_face(const Face_handle f) const { - Is_Delaunay_hyperbolic del; - int idx; - bool flag = del(point(f,0), - point(f,1), - point(f,2), - idx); + if(is_infinite(f)) + { + f->hyperbolic_data().set_infinite(); + } + else + { + int idx; + bool flag = geom_traits().is_Delaunay_hyperbolic_2_object()(point(f,0), + point(f,1), + point(f,2), + idx); - Face_data fd; - fd.set_is_Delaunay_hyperbolic(flag); - - if(!flag) - fd.set_non_hyperbolic_edge(idx); - - f->tds_data() = make_object(fd); + if(flag) + f->hyperbolic_data().set_Delaunay_hyperbolic(); // finite & hyperbolic + else + f->hyperbolic_data().set_Delaunay_non_hyperbolic(idx); // finite but not hyperbolic + } } public: - Line_face_circulator line_walk(const Point& p, const Point& q, Face_handle f = Face_handle()) const { return Base::line_walk(p, q, f); } - Hyperbolic_triangle hyperbolic_triangle(const Face_handle f) const { return Base::triangle(f); } + Hyperbolic_triangle hyperbolic_triangle(const Face_handle f) const + { + CGAL_precondition(!is_infinite(f)); + return Base::triangle(f); + } // needed by DT_2: do not document! - Hyperbolic_triangle triangle(const Face_handle f) const { return hyperbolic_triangle(f); } + Hyperbolic_triangle triangle(const Face_handle f) const + { + CGAL_precondition(!is_infinite(f)); + return hyperbolic_triangle(f); + } Hyperbolic_segment hyperbolic_segment(const Face_handle f, const int i) const { @@ -862,7 +757,7 @@ public: Hyperbolic_Voronoi_point dual(Face_handle f) const { - CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f)); + CGAL_precondition(is_Delaunay_hyperbolic(f)); return geom_traits().construct_hyperbolic_circumcenter_2_object()(point(f,0), point(f,1), point(f,2)); @@ -872,7 +767,7 @@ public: Hyperbolic_segment dual(Face_handle f, int i) const { - CGAL_triangulation_precondition(is_Delaunay_hyperbolic(f, i)); + CGAL_precondition(is_Delaunay_hyperbolic(f, i)); if(dimension() == 1) { @@ -890,7 +785,7 @@ public: bool fhyp = is_Delaunay_hyperbolic(f); bool nhyp = is_Delaunay_hyperbolic(n); - // both faces are non_hyperbolic, but the incident edge is hyperbolic + // both faces are non_hyperbolic, but the common edge is hyperbolic if(!fhyp && !nhyp) { const Point& p = point(f,ccw(i)); @@ -930,55 +825,50 @@ public: } public: - - const Point point(const Vertex_handle vh) const + const Point& point(const Vertex_handle vh) const { + CGAL_precondition(!is_infinite(vh)); return vh->point(); } - const Point point(const Face_handle fh, const int i) const + const Point& point(const Face_handle fh, const int i) const { - CGAL_triangulation_precondition(0 <= i); - CGAL_triangulation_precondition(i <= 2); + CGAL_precondition(!is_infinite(fh->vertex(i))); + CGAL_precondition(0 <= i && i <= 2); return fh->vertex(i)->point(); } - - Point point(const Vertex_handle vh) + Point& point(const Vertex_handle vh) { + CGAL_precondition(!is_infinite(vh)); return vh->point(); } - Point point(const Face_handle fh, const int i) + Point& point(const Face_handle fh, const int i) { - CGAL_triangulation_precondition(0 <= i); - CGAL_triangulation_precondition(i <= 2); + CGAL_precondition(!is_infinite(fh->vertex(i))); + CGAL_precondition(0 <= i && i <= 2); return fh->vertex(i)->point(); } - - bool is_valid() { - if (Base::is_valid()) + if (!Base::is_valid()) + return false; + + for (Hyperbolic_faces_iterator fit = hyperbolic_faces_begin(); fit != hyperbolic_faces_end(); fit++) { - for (Hyperbolic_faces_iterator fit = hyperbolic_faces_begin(); fit != hyperbolic_faces_end(); fit++) - { - if (!is_Delaunay_hyperbolic(fit)) - { - return false; - } - } - for (Hyperbolic_edges_iterator eit = hyperbolic_edges_begin(); eit != hyperbolic_edges_end(); eit++) - { - if (!is_Delaunay_hyperbolic(eit)) - { - return false; - } - } - return true; + if (!is_Delaunay_hyperbolic(fit)) + return false; } - return false; + + for (Hyperbolic_edges_iterator eit = hyperbolic_edges_begin(); eit != hyperbolic_edges_end(); eit++) + { + if (!is_Delaunay_hyperbolic(eit)) + return false; + } + + return true; } Face_handle locate(const Point& p, const Face_handle hint = Face_handle()) const @@ -994,22 +884,13 @@ public: typename Base::Locate_type blt; Face_handle fh = Base::locate(query, blt, li, hint); - if(blt == Base::VERTEX) { - lt = VERTEX; - } else { - if(blt == Base::EDGE) { - lt = EDGE; - } else { - if(blt == Base::FACE) { - lt = FACE; - } else { - if(blt == Base::OUTSIDE_CONVEX_HULL) { - lt = OUTSIDE_CONVEX_HULL; - } else { - lt = OUTSIDE_AFFINE_HULL; - } - } - } + switch(blt) + { + case Base::VERTEX: lt = VERTEX; break; + case Base::EDGE: lt = EDGE; break; + case Base::FACE: lt = FACE; break; + case Base::OUTSIDE_CONVEX_HULL: lt = OUTSIDE_CONVEX_HULL; break; + case Base::OUTSIDE_AFFINE_HULL: lt = OUTSIDE_AFFINE_HULL; break; } if(lt == VERTEX) @@ -1018,105 +899,100 @@ public: if(lt == OUTSIDE_CONVEX_HULL || lt == OUTSIDE_AFFINE_HULL) return Face_handle(); + CGAL_assertion(!is_infinite(fh)); + // This case corresponds to when the point is located on an Euclidean edge. if(lt == EDGE) { - Point p = point(fh, 0); - Point q = point(fh, 1); - Point r = point(fh, 2); + // Here because the call to `side_of_hyperbolic_triangle` might change `li` + Face_handle mfh = fh->neighbor(li); - if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)) + if(is_Delaunay_hyperbolic(fh)) { + const Point& p = point(fh, 0); + const Point& q = point(fh, 1); + const Point& r = point(fh, 2); + Oriented_side side = side_of_hyperbolic_triangle(p, q, r, query, lt, li); - if(side == ON_ORIENTED_BOUNDARY) { - lt = EDGE; + if(side != ON_NEGATIVE_SIDE) return fh; - } else { - if(side == ON_POSITIVE_SIDE) { - lt = FACE; - return fh; - } else { - // do nothing -- we still have to check the neighboring face - } - } } - p = point(fh, ccw(li)); - q = point(Base::mirror_vertex(fh, li)); - r = point(fh, cw(li)); - - if(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r)) + if(is_Delaunay_hyperbolic(mfh)) { + const Point& p = point(mfh, 0); + const Point& q = point(mfh, 1); + const Point& r = point(mfh, 2); Oriented_side side = side_of_hyperbolic_triangle(p, q, r, query, lt, li); - if(side == ON_ORIENTED_BOUNDARY) { - lt = EDGE; + + if(side != ON_NEGATIVE_SIDE) { return fh; } else { - if(side == ON_POSITIVE_SIDE) { - lt = FACE; - return fh; - } else { - // There is nothing to be done now -- the point is outside the convex hull of the triangulation - lt = OUTSIDE_CONVEX_HULL; - return Face_handle(); - } + lt = OUTSIDE_CONVEX_HULL; + return Face_handle(); } } + else + { + lt = OUTSIDE_CONVEX_HULL; + return Face_handle(); + } } - // Here, the face has been located in the Euclidean face lh + // Here, the face has been located in the Euclidean face fh const Point& p = point(fh, 0); const Point& q = point(fh, 1); const Point& r = point(fh, 2); - int idx; - if(!geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r, idx)) + + if(!is_Delaunay_hyperbolic(fh)) { // Need to check if the point lies on one of the sides of the face // Note that at least one side is Delaunay hyperbolic! - if (geom_traits().side_of_oriented_hyperbolic_segment_2_object()(p,q,query) == ON_ORIENTED_BOUNDARY || - geom_traits().side_of_oriented_hyperbolic_segment_2_object()(q,r,query) == ON_ORIENTED_BOUNDARY || - geom_traits().side_of_oriented_hyperbolic_segment_2_object()(r,p,query) == ON_ORIENTED_BOUNDARY ) - lt = EDGE; - else - lt = OUTSIDE_CONVEX_HULL; + if(geom_traits().side_of_oriented_hyperbolic_segment_2_object()(p,q,query) == ON_ORIENTED_BOUNDARY) + { + lt = EDGE; + li = 2; + return fh; + } + else if(geom_traits().side_of_oriented_hyperbolic_segment_2_object()(q,r,query) == ON_ORIENTED_BOUNDARY) + { + lt = EDGE; + li = 0; + return fh; + } + else if(geom_traits().side_of_oriented_hyperbolic_segment_2_object()(r,p,query) == ON_ORIENTED_BOUNDARY) + { + lt = EDGE; + li = 1; + return fh; + } + + lt = OUTSIDE_CONVEX_HULL; return Face_handle(); } Oriented_side side = side_of_hyperbolic_triangle(p, q, r, query, lt, li); - if(side == ON_POSITIVE_SIDE) { - lt = FACE; + if(side != ON_NEGATIVE_SIDE) { return fh; } else { - if(side == ON_ORIENTED_BOUNDARY) { - lt = EDGE; - return fh; - } else { - // Here, the point lies in a face that is a neighbor to fh - for(int i = 0; i < 3; i++) { - Face_handle nfh = fh->neighbor(i); - if(geom_traits().is_Delaunay_hyperbolic_2_object()(point(nfh,0), - point(nfh,1), - point(nfh,2))) - { - Oriented_side nside = side_of_hyperbolic_triangle(point(nfh,0), - point(nfh,1), - point(nfh,2), - query, lt, li); - if(nside == ON_POSITIVE_SIDE) { - lt = FACE; - return nfh; - } else if(nside == ON_ORIENTED_BOUNDARY) { - lt = EDGE; - return nfh; - } - } + // Here, the point lies in a face that is a neighbor to fh + for(int i = 0; i < 3; ++i) { + Face_handle nfh = fh->neighbor(i); + if(is_Delaunay_hyperbolic(nfh)) + { + Oriented_side nside = side_of_hyperbolic_triangle(point(nfh,0), + point(nfh,1), + point(nfh,2), + query, lt, li); + if(nside != ON_NEGATIVE_SIDE) + return nfh; } - - // At this point, the point lies outside of the convex hull of the triangulation, - // since it has not been found in any of the hyperbolic faces adjacent to fh. - lt = OUTSIDE_CONVEX_HULL; - return Face_handle(); } + + // At this point, the point lies outside of the convex hull of the triangulation, + // since it has not been found in any of the hyperbolic faces adjacent to fh. + lt = OUTSIDE_CONVEX_HULL; + return Face_handle(); } // We never reach this point, but we have to make the compiler happy diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index ebf704c4ef3..da42c7429f9 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -77,13 +77,13 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*c_pq, *c_qr, std::back_inserter(inters)); - CGAL_triangulation_assertion(assign(pair, inters[0])); + CGAL_assertion(assign(pair, inters[0])); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_triangulation_assertion(assign(pair, inters[1])); + CGAL_assertion(assign(pair, inters[1])); return pair.first; } return pair.first; @@ -104,13 +104,13 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*l, *c, std::back_inserter(inters)); - CGAL_triangulation_assertion(assign(pair,inters[0])); + CGAL_assertion(assign(pair,inters[0])); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_triangulation_assertion(assign(pair, inters[1])); + CGAL_assertion(assign(pair, inters[1])); return pair.first; } return pair.first; @@ -177,9 +177,9 @@ namespace internal { const Hyperbolic_point_2& r, const Hyperbolic_point_2& s) const { - CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && + CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && (_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE)); - CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && + CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && (_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE)); Construct_circle_or_line_supporting_bisector cclsb(_gt); @@ -218,7 +218,7 @@ namespace internal { const Hyperbolic_point_2& q, const Hyperbolic_point_2& r) const { - CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); + CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); Construct_circle_or_line_supporting_bisector cclsb(_gt); Construct_hyperbolic_circumcenter_CK_2 chc(_gt); @@ -240,13 +240,13 @@ namespace internal { intersection(bis_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_triangulation_assertion(assign(pair,inters[0])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[0])); + CGAL_assertion(pair.second == 1); if(_gt.less_y_2_object()(p, q)) return Line_arc_2(bis_pq,a,pair.first); - CGAL_triangulation_assertion(assign(pair,inters[1])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[1])); + CGAL_assertion(pair.second == 1); return Line_arc_2(bis_pq,a,pair.first); } @@ -261,8 +261,8 @@ namespace internal { intersection(*c_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_triangulation_assertion(assign(pair,inters[0])); - CGAL_triangulation_assertion(pair.second == 1); + CGAL_assertion(assign(pair,inters[0])); + CGAL_assertion(pair.second == 1); Hyperbolic_point_2 approx_pinf(to_double(pair.first.x()), to_double(pair.first.y())); Hyperbolic_point_2 approx_c(to_double(c_pq->center().x()), @@ -275,7 +275,7 @@ namespace internal { return Circular_arc_2(*c_pq, pair.first, a); } - CGAL_triangulation_assertion(assign(pair,inters[1])); + CGAL_assertion(assign(pair,inters[1])); if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE) return Circular_arc_2(*c_pq, pair.first, a); diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h index 2e7e8d268b2..801ee71d993 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_traits_2.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -365,9 +365,9 @@ public: const Hyperbolic_point_2& r, const Hyperbolic_point_2& s) const { - CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && + CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) && (_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE)); - CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && + CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) && (_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE)); Construct_hyperbolic_circumcenter_2 chc(_gt); @@ -405,7 +405,7 @@ public: const Hyperbolic_point_2& q, const Hyperbolic_point_2& r) const { - CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); + CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE); Construct_circle_or_line_supporting_bisector cclsb(_gt); Construct_hyperbolic_circumcenter_2 chc(_gt); diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h index a0d7e74a3ab..4dbeb2bb382 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h @@ -33,7 +33,6 @@ class Construct_circle_or_line_supporting_bisector typedef typename Traits::Euclidean_line_2 Euclidean_line_2; typedef typename Traits::Euclidean_circle_or_line_2 Euclidean_circle_or_line_2; typedef typename Traits::Circle_2 Circle_2; - typedef typename Traits::Point_3 Point_3; public: Construct_circle_or_line_supporting_bisector(const Traits& gt = Traits()) : _gt(gt) {} @@ -41,16 +40,10 @@ public: Euclidean_circle_or_line_2 operator()(const Hyperbolic_point_2& p, const Hyperbolic_point_2& q) const { - Hyperbolic_point_2 po = CGAL::ORIGIN; - + const Hyperbolic_point_2 po = CGAL::ORIGIN; if(_gt.compare_distance_2_object()(po, p, q) == EQUAL) return _gt.construct_bisector_2_object()(p, q); - FT dop2 = p.x()*p.x() + p.y()*p.y(); - FT doq2 = q.x()*q.x() + q.y()*q.y(); - Point_3 p3(p.x(), p.y(), dop2); - Point_3 q3(q.x(), q.y(), doq2); - // TODO MT improve // The cirle belongs to the pencil with limit points p and q @@ -87,8 +80,6 @@ private: const Traits& _gt; }; // end Construct_supporting_circle_of_bisector - - template class Construct_hyperbolic_segment_2 { @@ -136,8 +127,6 @@ private: const Traits& _gt; }; // end Construct_hyperbolic_segment_2 - - // For details see the JoCG paper (5:56-85, 2014) template class Is_Delaunay_hyperbolic @@ -146,7 +135,6 @@ public: typedef typename Traits::FT FT; typedef typename Traits::Hyperbolic_point_2 Hyperbolic_point_2; typedef typename Traits::Direction_2 Direction_2; - typedef typename Traits::Point_3 Point_3; typedef typename Traits::Vector_3 Vector_3; Is_Delaunay_hyperbolic(const Traits& gt = Traits()) @@ -178,7 +166,7 @@ public: const Hyperbolic_point_2& p2, int& ind) const { - if(this->operator()(p0, p1, p2) == false) + if(!this->operator()(p0, p1, p2)) { ind = find_non_hyperbolic_edge(p0, p1, p2); return false; @@ -188,7 +176,7 @@ public: } private: - // assume the face (p0, p1, p2) is non-hyperbolic + // assumes that the face (p0, p1, p2) is non-hyperbolic int find_non_hyperbolic_edge(const Hyperbolic_point_2& p0, const Hyperbolic_point_2& p1, const Hyperbolic_point_2& p2) const @@ -253,18 +241,7 @@ public: { Euclidean_line_2 seg(p, q); Orientation qori = _gt.orientation_2_object()(p, q, query); - if(qori == COLLINEAR) - { - return ON_ORIENTED_BOUNDARY; - } - else - { - // It is sufficient that these are consistent. - if(qori == LEFT_TURN) - return ON_POSITIVE_SIDE; - else - return ON_NEGATIVE_SIDE; - } + return qori; } Weighted_point_2 wp(p); @@ -276,17 +253,7 @@ public: Circle_2 circle = _gt.construct_circle_2_object()(center, sq_radius); Bounded_side bs = _gt.bounded_side_2_object()(circle, query); - if(bs == ON_BOUNDARY) - { - return ON_ORIENTED_BOUNDARY; - } - else - { - if(bs == ON_BOUNDED_SIDE) - return ON_POSITIVE_SIDE; - else - return ON_NEGATIVE_SIDE; - } + return enum_cast(bs); } private: diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h index 6506f397267..32d730aab7c 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h @@ -16,12 +16,45 @@ #include #include -#include #include #include namespace CGAL { +class Hyperbolic_data +{ + typedef boost::int8_t Id; + +private: + // - 2 for infinite face + // - 1 for finite, hyperbolic face + // 0 for finite, non hyperbolic with non-hyperbolic edge at index 0 + // 2 for finite, non hyperbolic with non-hyperbolic edge at index 1 + // 1 for finite, non hyperbolic with non-hyperbolic edge at index 2 + Id _hyperbolic_tag; + +public: + Hyperbolic_data(Id id = -2) : _hyperbolic_tag(id) { } + + void set_infinite() { _hyperbolic_tag = -2; } + + // a finite face is non_hyperbolic if its circumscribing circle intersects the circle at infinity + void set_Delaunay_hyperbolic() { _hyperbolic_tag = -1; } + + bool is_Delaunay_hyperbolic() const + { + return (_hyperbolic_tag == -1); + } + + // set and get the non-hyperbolic property of the edge #i + void set_Delaunay_non_hyperbolic(int i) { _hyperbolic_tag = i; } + + bool is_Delaunay_non_hyperbolic(int i) const + { + return (_hyperbolic_tag == i); + } +}; + template > class Hyperbolic_triangulation_face_base_2 @@ -60,11 +93,11 @@ public: static int ccw(int i) {return Triangulation_cw_ccw_2::ccw(i);} static int cw(int i) {return Triangulation_cw_ccw_2::cw(i);} - CGAL::Object& tds_data() { return this->_tds_data; } - const CGAL::Object& tds_data() const { return this->_tds_data; } + Hyperbolic_data& hyperbolic_data() { return this->_hyperbolic_data; } + const Hyperbolic_data& hyperbolic_data() const { return this->_hyperbolic_data; } private: - CGAL::Object _tds_data; + Hyperbolic_data _hyperbolic_data; }; } // namespace CGAL diff --git a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/ht2_test_locate.cpp b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/ht2_test_locate.cpp index 1c39943d497..6552593719c 100644 --- a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/ht2_test_locate.cpp +++ b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/ht2_test_locate.cpp @@ -12,54 +12,83 @@ typedef HDTriangulation::Hyperbolic_segment Hype int main() { - FT F100(100); - Point p1(-FT(81)/F100, -FT(35)/F100 ); - Point p2(-FT(78)/F100, FT(12)/F100 ); - Point p3(-FT(64)/F100, FT(59)/F100 ); - Point p4(-FT(31)/F100, -FT(25)/F100 ); - Point p5( FT(66)/F100, FT(18)/F100 ); + FT F100(100); + Point p1(-FT(81)/F100, -FT(35)/F100 ); + Point p2(-FT(78)/F100, FT(12)/F100 ); + Point p3(-FT(64)/F100, FT(59)/F100 ); + Point p4(-FT(31)/F100, -FT(25)/F100 ); + Point p5( FT(66)/F100, FT(18)/F100 ); - HDTriangulation tri; - tri.insert(p1); - tri.insert(p2); - tri.insert(p3); - tri.insert(p4); - tri.insert(p5); + HDTriangulation tri; + tri.insert(p1); + tri.insert(p2); + tri.insert(p3); + tri.insert(p4); + tri.insert(p5); - std::size_t nv = tri.number_of_vertices(); - std::size_t nf = tri.number_of_hyperbolic_faces(); + std::size_t nv = tri.number_of_vertices(); + std::size_t nf = tri.number_of_hyperbolic_faces(); - std::cout << " -------- inserting --------" << std::endl; - std::cout << "Vertices in triangulation: " << nv << std::endl; - std::cout << "Faces in triangulation: " << nf << std::endl; - std::cout << "Dimension of triangulation: " << tri.dimension() << std::endl; - assert(tri.dimension() == 2); + std::cout << " -------- inserting --------" << std::endl; + std::cout << "Vertices in triangulation: " << nv << std::endl; + std::cout << "Faces in triangulation: " << nf << std::endl; + std::cout << "Dimension of triangulation: " << tri.dimension() << std::endl; + assert(tri.dimension() == 2); - int idx; - Face_handle fh; + // Test a vertex location + int idx1 = -1; + Locate_type lt1; + Face_handle fh1 = tri.locate(p1, lt1, idx1); + assert(lt1 == HDTriangulation::VERTEX); + assert(fh1 != Face_handle()); + assert(idx1 >= 0 && idx1 <= 2); - // Test a vertex location - Locate_type lt1; - fh = tri.locate(p1, lt1, idx); - assert(lt1 == HDTriangulation::VERTEX); + // Test an edge location + Hyperbolic_segment s1 = tri.geom_traits().construct_hyperbolic_segment_2_object()(p1, p2); + Hyperbolic_segment b1 = tri.geom_traits().construct_hyperbolic_bisector_2_object()(p1, p2); + Point i1 = tri.geom_traits().construct_intersection_2_object()(s1, b1); + int idx2 = -1; + Locate_type lt2; + Face_handle fh2 = tri.locate(i1, lt2, idx2); + assert(lt2 == HDTriangulation::EDGE); + assert(fh2 != Face_handle()); + assert(idx2 >= 0 && idx2 <= 2); - // Test an edge location - Hyperbolic_segment s1 = tri.geom_traits().construct_hyperbolic_segment_2_object()(p1, p2); - Hyperbolic_segment b1 = tri.geom_traits().construct_hyperbolic_bisector_2_object()(p1, p2); - Point i1 = tri.geom_traits().construct_intersection_2_object()(s1, b1); - Locate_type lt2; - fh = tri.locate(i1, lt2, idx); - assert(lt2 == HDTriangulation::EDGE); + // Test a "dangling" edge location + Hyperbolic_segment s2 = tri.geom_traits().construct_hyperbolic_segment_2_object()(p4, p5); + Hyperbolic_segment b2 = tri.geom_traits().construct_hyperbolic_bisector_2_object()(p4, p5); + Point i2 = tri.geom_traits().construct_intersection_2_object()(s2, b2); + Locate_type lt3; + int idx3 = -1; + Face_handle fh3 = tri.locate(i2, lt3, idx3); + assert(lt3 == HDTriangulation::EDGE); + assert(fh3 != Face_handle()); + assert(idx3 >= 0 && idx3 <= 2); - // Test a "dangling" edge location - Hyperbolic_segment s2 = tri.geom_traits().construct_hyperbolic_segment_2_object()(p4, p5); - Hyperbolic_segment b2 = tri.geom_traits().construct_hyperbolic_bisector_2_object()(p4, p5); - Point i2 = tri.geom_traits().construct_intersection_2_object()(s2, b2); - Locate_type lt3; - fh = tri.locate(i2, lt3, idx); - assert(lt3 == HDTriangulation::EDGE); + // Test a face location + Point c1 = CGAL::centroid(p1, p2, p4); + Locate_type lt4; + int idx4 = -1; + Face_handle fh4 = tri.locate(c1, lt4, idx4); + assert(lt4 == HDTriangulation::FACE); + assert(fh4 != Face_handle()); - std::cout << " -------- SUCCESS --------" << std::endl; + // Test a non-hyperbolic face location + Point c2 = CGAL::centroid(p3, p4, p5); + Locate_type lt5; + int idx5 = -1; + Face_handle fh5 = tri.locate(c2, lt5, idx5); + assert(lt5 == HDTriangulation::OUTSIDE_CONVEX_HULL); + assert(fh5 == Face_handle()); - return 0; + // Test a non-convex hull location + Locate_type lt6; + int idx6 = -1; + Face_handle fh6 = tri.locate(Point(0, -FT(80)/F100), lt6, idx6); + assert(lt6 == HDTriangulation::OUTSIDE_CONVEX_HULL); + assert(fh6 == Face_handle()); + + std::cout << " -------- SUCCESS --------" << std::endl; + + return 0; } diff --git a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt index 869cc842f1e..a15bb4b041c 100644 --- a/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt +++ b/Inscribed_areas/doc/Inscribed_areas/PackageDescription.txt @@ -22,18 +22,11 @@ \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. - \cgalClassifedRefPages -- `CGAL::maximum_area_inscribed_k_gon_2` -- `CGAL::maximum_perimeter_inscribed_k_gon_2` -- `CGAL::extremal_polygon_2` +- `CGAL::maximum_area_inscribed_k_gon_2()` +- `CGAL::maximum_perimeter_inscribed_k_gon_2()` +- `CGAL::extremal_polygon_2()` - `CGAL::Largest_empty_iso_rectangle_2` - `CGAL::Extremal_polygon_area_traits_2` - `CGAL::Extremal_polygon_perimeter_traits_2` @@ -41,4 +34,3 @@ checking off, cf. Section \ref secchecks. - `LargestEmptyIsoRectangleTraits_2` */ - diff --git a/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h b/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h index a85e9a76f47..9c4cb0a113f 100644 --- a/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h +++ b/Inscribed_areas/include/CGAL/Extremal_polygon_traits_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -83,7 +83,7 @@ struct Extremal_polygon_area_traits_2 { int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > min_k()); + CGAL_precondition( number_of_points > min_k()); // this gives the area of the triangle of two points with // the root: @@ -136,7 +136,7 @@ protected: }; } //namespace CGAL -#include + #include #ifdef CGAL_USE_LEDA #include @@ -221,11 +221,11 @@ struct Extremal_polygon_perimeter_traits_2 { using std::less; using std::max_element; - CGAL_optimisation_precondition_code( + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( number_of_points > min_k()); + CGAL_precondition( number_of_points > min_k()); // kind of messy, but first we have to have something // like Distance (function object) ... diff --git a/Inscribed_areas/include/CGAL/extremal_polygon_2.h b/Inscribed_areas/include/CGAL/extremal_polygon_2.h index 2cd09fdd7c0..e1543637f53 100644 --- a/Inscribed_areas/include/CGAL/extremal_polygon_2.h +++ b/Inscribed_areas/include/CGAL/extremal_polygon_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -76,7 +76,7 @@ public: RandomAccessIC_object begin_col, RandomAccessIC_object end_col, RandomAccessIC_value begin_value, - RandomAccessIC_value CGAL_optimisation_precondition_code(end_value), + RandomAccessIC_value CGAL_precondition_code(end_value), const Operation& o) // initialization with two ranges [begin_row, end_row) and // [begin_col, end_col) of Objects, a range [begin_value, end_value) @@ -92,9 +92,9 @@ public: n_rows( static_cast(iterator_distance( begin_row, end_row))), n_cols( static_cast(iterator_distance( begin_col, end_col))) { - CGAL_optimisation_precondition( + CGAL_precondition( iterator_distance( begin_value, end_value) == n_cols); - CGAL_optimisation_assertion( n_rows > 0 && n_cols > 0); + CGAL_assertion( n_rows > 0 && n_cols > 0); } int @@ -108,8 +108,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < n_rows); - CGAL_optimisation_precondition( c >= 0 && c < n_cols); + CGAL_precondition( r >= 0 && r < n_rows); + CGAL_precondition( c >= 0 && c < n_cols); return begin_value_[c] + op( begin_row_[r], begin_col_[c]); } @@ -181,11 +181,11 @@ CGAL_maximum_inscribed_rooted_k_gon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); + CGAL_precondition( k >= t.min_k()); int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > k); + CGAL_precondition( number_of_points > k); typedef std::vector< int > Index_cont; @@ -203,7 +203,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2( points_begin, points_end, max_area, gon.rbegin() + k + 1 - i); for (;;) { - CGAL_optimisation_assertion( gon[0] == 0); + CGAL_assertion( gon[0] == 0); gon[i] = number_of_points - 1; if ( ++i >= k) break; @@ -243,7 +243,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2( RandomAccessIC_point points_end, int root, RandomAccessIC_int left_c_begin, - RandomAccessIC_int CGAL_optimisation_precondition_code(left_c_end), + RandomAccessIC_int CGAL_precondition_code(left_c_end), RandomAccessIC_int right_c_begin, RandomAccessIC_int right_c_end, typename Traits::FT& max_area, @@ -294,26 +294,26 @@ CGAL_maximum_inscribed_rooted_k_gon_2( right_c_end)); // check preconditions: - CGAL_optimisation_precondition( number_of_points > t.min_k()); - CGAL_optimisation_precondition( size_of_gon >= t.min_k() - 1); - CGAL_optimisation_precondition( + CGAL_precondition( number_of_points > t.min_k()); + CGAL_precondition( size_of_gon >= t.min_k() - 1); + CGAL_precondition( iterator_distance( left_c_begin, left_c_end) == iterator_distance( right_c_begin, right_c_end)); - CGAL_optimisation_precondition( left_c_begin[0] >= 0); - CGAL_optimisation_precondition( right_c_begin[0] >= 0); - CGAL_optimisation_precondition( + CGAL_precondition( left_c_begin[0] >= 0); + CGAL_precondition( right_c_begin[0] >= 0); + CGAL_precondition( left_c_begin[size_of_gon-1] < number_of_points); - CGAL_optimisation_precondition( + CGAL_precondition( right_c_begin[size_of_gon-1] < number_of_points); - CGAL_optimisation_expensive_precondition_code( + CGAL_expensive_precondition_code( for ( i = 0; i < size_of_gon; ++i) { - CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] >= 0); + CGAL_expensive_precondition( right_c_begin[i] >= 0); + CGAL_expensive_precondition( left_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( right_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] <= right_c_begin[i]); }) @@ -426,12 +426,12 @@ extremal_polygon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition_code( + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( number_of_points >= t.min_k()); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points >= t.min_k()); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); typedef typename Traits::Point_2 Point_2; @@ -491,11 +491,11 @@ CGAL_maximum_inscribed_k_gon_2( // returns the past-the-end iterator of that sequence. { // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); + CGAL_precondition( k >= t.min_k()); int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); + CGAL_precondition( number_of_points > 0); using std::copy; @@ -518,7 +518,7 @@ CGAL_maximum_inscribed_k_gon_2( P_0.rbegin() + 1, t); P_0[k] = number_of_points - 1; - CGAL_optimisation_assertion( P_0[0] == 0); + CGAL_assertion( P_0[0] == 0); // compute k-gon rooted at points_begin[P_0[1]] Index_cont P_1( k); FT area_1; @@ -535,7 +535,7 @@ CGAL_maximum_inscribed_k_gon_2( P_1.rbegin(), t); - CGAL_optimisation_assertion( P_1[0] == P_0[1]); + CGAL_assertion( P_1[0] == P_0[1]); // start recursive computation: @@ -630,29 +630,29 @@ CGAL_maximum_inscribed_k_gon_2( using std::copy; // check preconditions: - CGAL_optimisation_precondition( k >= t.min_k()); - CGAL_optimisation_precondition( left_index <= right_index); - CGAL_optimisation_precondition( left_index >= 0); - CGAL_optimisation_precondition( right_index >= 0); - CGAL_optimisation_precondition_code( + CGAL_precondition( k >= t.min_k()); + CGAL_precondition( left_index <= right_index); + CGAL_precondition( left_index >= 0); + CGAL_precondition( right_index >= 0); + CGAL_precondition_code( int number_of_points( static_cast(iterator_distance( points_begin, points_end)));) - CGAL_optimisation_precondition( left_index < number_of_points); - CGAL_optimisation_precondition( right_index < number_of_points); - CGAL_optimisation_precondition( + CGAL_precondition( left_index < number_of_points); + CGAL_precondition( right_index < number_of_points); + CGAL_precondition( iterator_distance( left_c_begin, left_c_end) == k - 1); - CGAL_optimisation_precondition( + CGAL_precondition( iterator_distance( right_c_begin, right_c_end) == k - 1); - CGAL_optimisation_expensive_precondition_code( + CGAL_expensive_precondition_code( for ( int i( 0); i < k - 1; ++i) { - CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] >= 0); + CGAL_expensive_precondition( right_c_begin[i] >= 0); + CGAL_expensive_precondition( left_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( right_c_begin[i] < number_of_points); - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( left_c_begin[i] <= right_c_begin[i]); }) @@ -671,7 +671,7 @@ CGAL_maximum_inscribed_k_gon_2( area_middle, P_m.rbegin(), t); - CGAL_optimisation_assertion( P_m[0] == middle_index); + CGAL_assertion( P_m[0] == middle_index); // left recursive branch: FT area_left( 0); Index_cont P_l( k); diff --git a/Inscribed_areas/package_info/Inscribed_areas/dependencies b/Inscribed_areas/package_info/Inscribed_areas/dependencies index da58f1b4f08..e380dc379d9 100644 --- a/Inscribed_areas/package_info/Inscribed_areas/dependencies +++ b/Inscribed_areas/package_info/Inscribed_areas/dependencies @@ -8,7 +8,6 @@ Kernel_23 Matrix_search Modular_arithmetic Number_types -Optimisation_basic Polygon Profiling_tools STL_Extension diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index be5a7d1fc93..30e31329e62 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -4,7 +4,11 @@ Release History [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) ----------- -Release date: December 2022 +Release date: June 2023 + +### General Changes + +- **Breaking change**: The per package assertions, pre- and postconditions are no longer supported. ### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex) @@ -19,7 +23,7 @@ CGAL tetrahedral Delaunay refinement algorithm. ### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/5.6/Manual/packages.html#PkgSMDS3) (new package) -- This new package wraps all the existing code that deals with a `MeshComplex_3InTriangulation_3` to describe 3D simplicial meshess, and makes the data structure independent from the tetrahedral mesh generation package. +- This new package wraps all the existing code that deals with a `MeshComplex_3InTriangulation_3` to describe 3D simplicial meshes, and makes the data structure independent from the tetrahedral mesh generation package. ### [2D Arrangements](https://doc.cgal.org/5.6/Manual/packages.html#PkgArrangementOnSurface2) - Fixed some code that handles geodesic-curves on spheres that compare x- and y-coordinates on the boundary of the parameter space. It mainly effected the naive point-location. @@ -38,8 +42,26 @@ CGAL tetrahedral Delaunay refinement algorithm. ### [2D Conforming Triangulations and Meshes](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh2) +- Deprecated usage of boost parameters in favor of function named parameters in `CGAL::lloyd_optimize_mesh_2()`. - Deprecated two overloads of Function `refine_Delaunay_mesh()` and replaced them with versions using function named parameters. -- Add overloads of function `write_VTU()` with property maps for specifying the domain. +- Add overloads of function `write_VTU()` with property maps for specifying the domain. + +### [3D Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3) +- Deprecated usage of boost parameters in favor of function named parameters. + +### [3D Periodic Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgPeriodic3Mesh3) +- Deprecated usage of boost parameters in favor of function named parameters. + +### [2D Hyperbolic Triangulations](https://doc.cgal.org/5.6/Manual/packages.html#PkgHyperbolicTriangulation2) + +- **Breaking change**: the concept `HyperbolicTriangulationFaceBase_2` has been modified to + better reflect the triangulation's requirements and avoid a conflict with the requirements + described by the concept `TriangulationDataStructure_2::Face`. The model `CGAL::Hyperbolic_triangulation_face_base_2` + has been adapted correspondingly. + +### [Surface Mesh Simplification](https://doc.cgal.org/5.6/Manual/packages.html#PkgSurfaceMeshSimplification) +- The stop predicates `Count_stop_predicate` and `Count_ratio_stop_predicate` are renamed to `Edge_count_stop_predicate` and `Edge_count_ratio_stop_predicate`. Older versions have been deprecated. +- Introduce `Face_count_stop_predicate` and `Face_count_ratio_stop_predicate` that can be used to stop the simplification algorithm based on a desired number of faces in the output, or a ratio between input and output face numbers. [Release 5.5](https://github.com/CGAL/cgal/releases/tag/v5.5) ----------- @@ -3169,7 +3191,7 @@ Release date: October 2012 - Added more general script to create CMakeLists.txt files: `cgal_create_CMakeLists` - Availability tests for C++11 features are now performed with the - help of [Boost.Config](http://www.boost.org/libs/config). A Boost + help of [Boost.Config](https://www.boost.org/libs/config). A Boost version of 1.40.0 or higher is needed to use C++11 features. ### 2D Arrangement @@ -3661,7 +3683,7 @@ CGAL 3.7 offers the following improvements and new functionality : - Some demos now require a version of Qt4 >= 4.3. - CGAL\_PDB is no longer provided with CGAL. An alternative solution for people interested in reading PDB files is to use ESBTL - (http://esbtl.sourceforge.net/). + (https://esbtl.sourceforge.net/). - Fix issues of the CGAL wrappers around the CORE library, on 64 bits platforms. diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 3c0e1ec0fdb..0a521d9dd2c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -351,7 +351,7 @@ include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_enable_end_of_configuration_hook.cmake) cgal_setup_module_path() -if(RUNNING_CGAL_AUTO_TEST) +if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) message(STATUS "Operating system:") execute_process( COMMAND uname -a @@ -389,7 +389,7 @@ if(MSVC) uniquely_add_flags(CGAL_CXX_FLAGS "/fp:except-") uniquely_add_flags(CGAL_CXX_FLAGS "/bigobj") # Use /bigobj by default - if(RUNNING_CGAL_AUTO_TEST) + if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) set(CMAKE_CXX_WARNING_LEVEL 2 CACHE STRING "MSVC C++ compiler warning level" FORCE) @@ -442,7 +442,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(GCC_FOUND) - if(RUNNING_CGAL_AUTO_TEST) + if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) uniquely_add_flags(CGAL_CXX_FLAGS "-Wall") # Remove -g from the relevant CMAKE_CXX_FLAGS. This will also # propagate to the rest of the tests, since we overwrite those @@ -479,7 +479,7 @@ message("== Generate version files (DONE) ==\n") # #-------------------------------------------------------------------------------------------------- -if(CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST) +if(CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) message("== Set up flags ==") # Ugly hack to be compatible with current CGAL testsuite process (as of @@ -1197,8 +1197,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" endif() endforeach() # loop on packages #Now check that a cpp file including all documented headers compiles - file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp - "#define BOOST_PARAMETER_MAX_ARITY 12 \n") foreach(header ${list_of_headers_to_test}) file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "#include <${header}>\n") endforeach() #loop on headers to include in test file @@ -1253,4 +1251,4 @@ if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) if(Qt5_FOUND) message(STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'") endif()#Qt5_FOUND -endif()#RUNNING_CGAL_AUTO_TEST +endif()#RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE diff --git a/Installation/LICENSE b/Installation/LICENSE index 1da3e31ab0b..1ba1accba3e 100644 --- a/Installation/LICENSE +++ b/Installation/LICENSE @@ -37,7 +37,7 @@ licenses: All other files that do not have an explicit copyright notice (e.g., all examples and some demos) are licensed under the Creative Commons CC0 1.0 license. The -exact text can be found at https://creativecommons.org/publicdomain/zero/1.0/". +exact text can be found at https://creativecommons.org/publicdomain/zero/1.0/. More information on the CGAL license can be found at https://www.cgal.org/license.html diff --git a/Installation/LICENSE.GPL b/Installation/LICENSE.GPL index 94a9ed024d3..ae0725d8014 100644 --- a/Installation/LICENSE.GPL +++ b/Installation/LICENSE.GPL @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. diff --git a/Installation/LICENSE.LGPL b/Installation/LICENSE.LGPL index 65c5ca88a67..1cd6ad68146 100644 --- a/Installation/LICENSE.LGPL +++ b/Installation/LICENSE.LGPL @@ -1,7 +1,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 92de4630099..ce99da6489e 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -4,7 +4,7 @@ option(CGAL_DEV_MODE "Activate the CGAL developers mode. See https://github.com/CGAL/cgal/wiki/CGAL_DEV_MODE" $ENV{CGAL_DEV_MODE}) -if(RUNNING_CGAL_AUTO_TEST) +if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) # Just to avoid a warning from CMake if that variable is set on the command line... endif() diff --git a/Installation/cmake/modules/CGAL_SetupBoost.cmake b/Installation/cmake/modules/CGAL_SetupBoost.cmake index a1b57c24423..1fd9ad6ba3f 100644 --- a/Installation/cmake/modules/CGAL_SetupBoost.cmake +++ b/Installation/cmake/modules/CGAL_SetupBoost.cmake @@ -17,7 +17,7 @@ set ( CGAL_Boost_Setup TRUE ) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake) -find_package( Boost 1.48 REQUIRED ) +find_package( Boost 1.66 REQUIRED ) if(Boost_FOUND AND Boost_VERSION VERSION_LESS 1.70) if(DEFINED Boost_DIR AND NOT Boost_DIR) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 790b13331b1..08cdc568ab6 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -97,8 +97,7 @@ function(CGAL_setup_CGAL_dependencies target) target_compile_definitions(${target} INTERFACE CGAL_TEST_SUITE=1) endif() - # CGAL now requires C++14. `decltype(auto)` is used as a marker of - # C++14. + # CGAL now requires C++14. `decltype(auto)` is used as a marker of C++14. target_compile_features(${target} INTERFACE cxx_decltype_auto) use_CGAL_Boost_support(${target} INTERFACE) @@ -152,7 +151,7 @@ function(CGAL_setup_CGAL_dependencies target) "-features=extensions;-library=stlport4;-D_GNU_SOURCE") target_link_libraries(${target} INTERFACE "-library=stlport4") elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if ( RUNNING_CGAL_AUTO_TEST ) + if ( RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) target_compile_options(${target} INTERFACE "-Wall") endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3) diff --git a/Installation/cmake/modules/CGAL_SetupFlags.cmake b/Installation/cmake/modules/CGAL_SetupFlags.cmake index 514ad5c58c8..3693e29724e 100644 --- a/Installation/cmake/modules/CGAL_SetupFlags.cmake +++ b/Installation/cmake/modules/CGAL_SetupFlags.cmake @@ -46,7 +46,7 @@ uniquely_add_flags( CMAKE_EXE_LINKER_FLAGS_DEBUG ${CGAL_EXE_LINKER_FLAGS_DE # Set a default build type if none is given if ( NOT CMAKE_BUILD_TYPE ) - if( RUNNING_CGAL_AUTO_TEST ) + if( RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) typed_cache_set ( STRING "Build type: Release, Debug, RelWithDebInfo or MinSizeRel" CMAKE_BUILD_TYPE Debug ) else () typed_cache_set ( STRING "Build type: Release, Debug, RelWithDebInfo or MinSizeRel" CMAKE_BUILD_TYPE Release ) 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 6a792ab5c91..70716d226c2 100644 --- a/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake +++ b/Installation/cmake/modules/CGAL_enable_end_of_configuration_hook.cmake @@ -84,7 +84,7 @@ function(CGAL_hook_check_CMAKE_BUILD_TYPE) if(DEFINED CMAKE_BUILD_TYPE AND ( NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug") ) set(keyword WARNING) set(type warning) - if(RUNNING_CGAL_AUTO_TEST) + if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) # No warning in the CMake test suite, but a status message set(keyword) set(type notice) diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index 3cbea03d9b9..8b7aa08a92b 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -43,7 +43,7 @@ #------------------------------------------------------------------- # This file is part of the CMake build system for OGRE # (Object-oriented Graphics Rendering Engine) -# For the latest info, see http://www.ogre3d.org/ +# For the latest info, see https://www.ogre3d.org/ # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index 4d44ca90219..43449b85e51 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -13,7 +13,7 @@ if(NOT USE_CGAL_FILE_INCLUDED) set(USE_CGAL_FILE_INCLUDED 1) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Common.cmake) - if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) + if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupFlags.cmake) else() include(${CMAKE_CURRENT_LIST_DIR}/CGAL_display_flags.cmake) diff --git a/Installation/doc_html/Manual/index.html b/Installation/doc_html/Manual/index.html index ce6b70c0d9a..446d46ff910 100644 --- a/Installation/doc_html/Manual/index.html +++ b/Installation/doc_html/Manual/index.html @@ -1,10 +1,10 @@ - + CGAL - Computational Geometry Algorithms Library - + diff --git a/Installation/doc_html/Manual/packages.html b/Installation/doc_html/Manual/packages.html index ce6b70c0d9a..446d46ff910 100644 --- a/Installation/doc_html/Manual/packages.html +++ b/Installation/doc_html/Manual/packages.html @@ -1,10 +1,10 @@ - + CGAL - Computational Geometry Algorithms Library - + diff --git a/Installation/doc_html/index.html b/Installation/doc_html/index.html index 24cd53e0c23..5638303fdc9 100644 --- a/Installation/doc_html/index.html +++ b/Installation/doc_html/index.html @@ -1,10 +1,10 @@ - + CGAL - Computational Geometry Algorithms Library - + @@ -19,7 +19,7 @@

    -The goal of the CGAL Open Source Project is to provide +The goal of the CGAL Open Source Project is to provide easy access to efficient and reliable geometric algorithms in the form of a C++ library.

    @@ -36,7 +36,7 @@ You can access the CGAL Online Manual from the @@ -46,7 +46,7 @@ You can access the CGAL Online Manual from the

    CGAL is distributed under a dual-license scheme. CGAL can be used together with Open Source software free of charge. Using CGAL in other contexts can be done by obtaining a commercial license from -GeometryFactory. +GeometryFactory. For more details see the License page.

    diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index a2d01e9293a..c1e3605e862 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -52,7 +52,7 @@ #endif // CGAL_TEST_SUITE and NDEBUG // See [[Small features/Visual_Leak_Detector]] in CGAL developers wiki -// See also: http://vld.codeplex.com/ +// See also: https://kinddragon.github.io/vld/ #if defined(CGAL_ENABLE_VLD) # include #endif // CGAL_ENABLE_VLD @@ -112,17 +112,6 @@ #endif #endif -// Macro used by Boost Parameter. Mesh_3 needs at least 12, before the -// Boost Parameter headers are included: -// defines the value to 8, if it is not yet defined. -// The CGAL BGL properties mechanism includes -// , that includes -// , and maybe other Boost libraries may use -// Boost Parameter as well. -// That is why that is important to define that macro as early as possible, -// in -#define BOOST_PARAMETER_MAX_ARITY 12 - // The following header file defines among other things BOOST_PREVENT_MACRO_SUBSTITUTION #include #include @@ -307,7 +296,7 @@ using std::max; // Macros to detect features of clang. We define them for the other // compilers. -// See http://clang.llvm.org/docs/LanguageExtensions.html +// See https://clang.llvm.org/docs/LanguageExtensions.html // See also https://en.cppreference.com/w/cpp/experimental/feature_test #ifndef __has_feature #define __has_feature(x) 0 // Compatibility with non-clang compilers. @@ -484,7 +473,7 @@ namespace cpp11{ // The fallthrough attribute // See for clang: -// http://clang.llvm.org/docs/AttributeReference.html#statement-attributes +// https://clang.llvm.org/docs/AttributeReference.html#statement-attributes // See for gcc: // https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) diff --git a/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h b/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h new file mode 100644 index 00000000000..cf07529839b --- /dev/null +++ b/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h @@ -0,0 +1,60 @@ +// Copyright (c) 2016 GeometryFactory SARL (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Andreas Fabri +// +// Warning: this file is generated, see include/CGAL/licence/README.md +// not entirely true due to the backward compatibility issue + +#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_H +#define CGAL_LICENSE_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_H + +#include +#include + +// backward compatibility +#ifdef CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE +#define CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE +#endif + +#ifdef CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE + +# if CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +# if defined(CGAL_LICENSE_WARNING) + + CGAL_pragma_warning("Your commercial license for CGAL does not cover " + "this release of the Polygon Mesh Processing - Combinatorial Repair package.") +# endif + +# ifdef CGAL_LICENSE_ERROR +# error "Your commercial license for CGAL does not cover this release \ + of the Polygon Mesh Processing - Combinatorial Repair package. \ + You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +# endif // CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE + +#else // no CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE + +# if defined(CGAL_LICENSE_WARNING) + CGAL_pragma_warning("\nThe macro CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE is not defined." + "\nYou use the CGAL Polygon Mesh Processing - Combinatorial Repair package under " + "the terms of the GPLv3+.") +# endif // CGAL_LICENSE_WARNING + +# ifdef CGAL_LICENSE_ERROR +# error "The macro CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE is not defined.\ + You use the CGAL Polygon Mesh Processing - Combinatorial Repair package under the terms of \ + the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR." +# endif // CGAL_LICENSE_ERROR + +#endif // no CGAL_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_COMMERCIAL_LICENSE + +#endif // CGAL_LICENSE_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_H diff --git a/Installation/include/CGAL/license/Polygon_mesh_processing/repair.h b/Installation/include/CGAL/license/Polygon_mesh_processing/geometric_repair.h similarity index 53% rename from Installation/include/CGAL/license/Polygon_mesh_processing/repair.h rename to Installation/include/CGAL/license/Polygon_mesh_processing/geometric_repair.h index 7481b75ff73..2d77d99530c 100644 --- a/Installation/include/CGAL/license/Polygon_mesh_processing/repair.h +++ b/Installation/include/CGAL/license/Polygon_mesh_processing/geometric_repair.h @@ -11,44 +11,44 @@ // // Warning: this file is generated, see include/CGAL/license/README.md -#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_REPAIR_H -#define CGAL_LICENSE_POLYGON_MESH_PROCESSING_REPAIR_H +#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_H +#define CGAL_LICENSE_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_H #include #include -#ifdef CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE +#ifdef CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE -# if CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE +# if CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE # if defined(CGAL_LICENSE_WARNING) CGAL_pragma_warning("Your commercial license for CGAL does not cover " - "this release of the Polygon Mesh Processing - Repair package.") + "this release of the Polygon Mesh Processing - Geometric Repair package.") # endif # ifdef CGAL_LICENSE_ERROR # error "Your commercial license for CGAL does not cover this release \ - of the Polygon Mesh Processing - Repair package. \ + of the Polygon Mesh Processing - Geometric Repair package. \ You get this error, as you defined CGAL_LICENSE_ERROR." # endif // CGAL_LICENSE_ERROR -# endif // CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE +# endif // CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE -#else // no CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE +#else // no CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE # if defined(CGAL_LICENSE_WARNING) - CGAL_pragma_warning("\nThe macro CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE is not defined." - "\nYou use the CGAL Polygon Mesh Processing - Repair package under " + CGAL_pragma_warning("\nThe macro CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE is not defined." + "\nYou use the CGAL Polygon Mesh Processing - Geometric Repair package under " "the terms of the GPLv3+.") # endif // CGAL_LICENSE_WARNING # ifdef CGAL_LICENSE_ERROR -# error "The macro CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE is not defined.\ - You use the CGAL Polygon Mesh Processing - Repair package under the terms of \ +# error "The macro CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE is not defined.\ + You use the CGAL Polygon Mesh Processing - Geometric Repair package under the terms of \ the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR." # endif // CGAL_LICENSE_ERROR -#endif // no CGAL_POLYGON_MESH_PROCESSING_REPAIR_COMMERCIAL_LICENSE +#endif // no CGAL_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_COMMERCIAL_LICENSE -#endif // CGAL_LICENSE_POLYGON_MESH_PROCESSING_REPAIR_H +#endif // CGAL_LICENSE_POLYGON_MESH_PROCESSING_GEOMETRIC_REPAIR_H diff --git a/Installation/include/CGAL/license/gpl_package_list.txt b/Installation/include/CGAL/license/gpl_package_list.txt index f023d48f375..ee177d9ae77 100644 --- a/Installation/include/CGAL/license/gpl_package_list.txt +++ b/Installation/include/CGAL/license/gpl_package_list.txt @@ -55,7 +55,8 @@ 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/predicate Polygon Mesh Processing - Predicate -Polygon_mesh_processing/repair Polygon Mesh Processing - Repair +Polygon_mesh_processing/combinatorial_repair Polygon Mesh Processing - Combinatorial Repair +Polygon_mesh_processing/geometric_repair Polygon Mesh Processing - Geometric Repair Polygon_mesh_processing/miscellaneous Polygon Mesh Processing - Miscellaneous Polygon_mesh_processing/detect_features Polygon Mesh Processing - Feature Detection Polygon_mesh_processing/collision_detection Polygon Mesh Processing - Collision Detection diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 0d2399605c9..b807ad3c412 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -89,7 +89,7 @@ if (NOT CGAL_DATA_DIR) if (EXISTS "${CMAKE_SOURCE_DIR}/../../data") set(CGAL_DATA_DIR "${CMAKE_SOURCE_DIR}/../../data") else() - if(CGAL_TEST_SUITE) + if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) message(WARNING "CGAL_DATA_DIR cannot be deduced, set the variable CGAL_DATA_DIR to set the default value of CGAL::data_file_path()") endif() endif() @@ -196,7 +196,7 @@ cgal_setup_module_path() set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) -if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) +if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) # Do not use -isystem for CGAL include paths set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) endif() diff --git a/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h b/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h index 4b26a1245ea..de50b9defa9 100644 --- a/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h +++ b/Interpolation/include/CGAL/natural_neighbor_coordinates_3.h @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -79,7 +79,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, typedef typename Dt::Locate_type Locate_type; typedef typename Gt::FT Coord_type; - CGAL_triangulation_precondition (dt.dimension() == 3); + CGAL_precondition (dt.dimension() == 3); Locate_type lt; int li, lj; @@ -119,9 +119,9 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, if (dt.is_infinite(cc1)) return make_triple(nn_out, norm_coeff=Coord_type(1), false);//point outside the convex-hull - CGAL_triangulation_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);) - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete + CGAL_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);) + CGAL_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete Point C_1 = construct_circumcenter

    (f1, Q, dt.geom_traits()); for(int j=1; j<4; j++) @@ -137,7 +137,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt, Cell_handle next = cc3->neighbor(num_next); while (std::find(cells.begin(),cells.end(),next) != cells.end()) { - CGAL_triangulation_assertion( next != cc1 ); + CGAL_assertion( next != cc1 ); cc3 = next; num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP)); next = cc3->neighbor(num_next); @@ -181,7 +181,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, typedef typename Dt::Locate_type Locate_type; typedef typename Gt::FT Coord_type; - CGAL_triangulation_precondition (dt.dimension()== 3); + CGAL_precondition (dt.dimension()== 3); Locate_type lt; int li, lj; @@ -215,7 +215,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, { // for each cell cc1 in conflict Cell_handle cc1 = *cit; - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete if (dt.is_infinite(cc1)) return make_triple(nn_out,norm_coeff=Coord_type(1), false);//point outside the convex-hull @@ -245,7 +245,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, while (std::find(cells.begin(),cells.end(),next) != cells.end()) { //next is in conflict - CGAL_triangulation_assertion( next != cc1 ); + CGAL_assertion( next != cc1 ); cc3 = next; num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP)); next = cc3->neighbor(num_next); @@ -269,7 +269,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt, } else // cc2 in the conflict cavity { - CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete + CGAL_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete if (dt.is_infinite(cc2)) { //point outside the convex-hull @@ -352,12 +352,12 @@ construct_circumcenter(const typename DT::Facet& f, const typename DT::Geom_traits::Point_3& Q, const typename DT::Geom_traits& gt /* = typename DT::Geom_traits() */ ) { - CGAL_triangulation_precondition(//&3 in place of %4 - !gt.coplanar_3_object()( - f.first->vertex((f.second+1)&3)->point(), - f.first->vertex((f.second+2)&3)->point(), - f.first->vertex((f.second+3)&3)->point(), - Q)); + CGAL_precondition(//&3 in place of %4 + !gt.coplanar_3_object()( + f.first->vertex((f.second+1)&3)->point(), + f.first->vertex((f.second+2)&3)->point(), + f.first->vertex((f.second+3)&3)->point(), + Q)); // else the facet is not on the enveloppe of the conflict cavity associated to P return gt.construct_circumcenter_3_object()( f.first->vertex((f.second+1)&3)->point(), diff --git a/Intersections_2/include/CGAL/Intersection_traits.h b/Intersections_2/include/CGAL/Intersection_traits.h index 6f0f260a594..9cc25059be9 100644 --- a/Intersections_2/include/CGAL/Intersection_traits.h +++ b/Intersections_2/include/CGAL/Intersection_traits.h @@ -62,19 +62,19 @@ #define CGAL_DO_INTERSECT_FUNCTION(A, B, DIM) \ template \ - inline bool \ + inline typename K::Boolean \ do_intersect(const A& a, const B& b) { \ return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ } \ template \ - inline bool \ + inline typename K::Boolean \ do_intersect(const B& b, const A& a) { \ return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(b, a))); \ } #define CGAL_DO_INTERSECT_FUNCTION_SELF(A, DIM) \ template \ - inline bool \ + inline typename K::Boolean \ do_intersect(const A & a, const A & b) { \ return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \ } @@ -152,21 +152,21 @@ intersection_impl(const A& a, const B& b, Dynamic_dimension_tag) { } template -inline bool +inline auto // K::Boolean do_intersect_impl(const A& a, const B& b, CGAL::Dimension_tag<2>) { typedef typename CGAL::Kernel_traits::Kernel Kernel; return Kernel().do_intersect_2_object()(a, b); } template -inline bool +inline auto // K::Boolean do_intersect_impl(const A& a, const B& b, Dimension_tag<3>) { typedef typename CGAL::Kernel_traits::Kernel Kernel; return Kernel().do_intersect_3_object()(a, b); } template -inline bool +inline auto // K::Boolean do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { typedef typename CGAL::Kernel_traits::Kernel Kernel; return Kernel().do_intersect_d_object()(a, b); @@ -188,7 +188,7 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) { // template // inline -// bool +// auto // K::Boolean // do_intersect(const A& a, const B& b) { // CGAL_static_assertion_msg((std::is_same::value), // "do_intersect with objects of different dimensions not supported"); diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h index c47b04b035c..399c9ac7046 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Circle_2.h @@ -24,18 +24,19 @@ namespace Intersections { namespace internal { template -bool do_intersect(const CGAL::Bbox_2& bbox, - const typename K::Circle_2& circle, - const K&) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& bbox, + const typename K::Circle_2& circle, + const K&) { return do_intersect_circle_iso_rectangle_2(circle, bbox, K()); } - template -bool do_intersect(const typename K::Circle_2& circle, - const CGAL::Bbox_2& bbox, - const K&) +typename K::Boolean +do_intersect(const typename K::Circle_2& circle, + const CGAL::Bbox_2& bbox, + const K&) { return do_intersect_circle_iso_rectangle_2(circle, bbox, K()); } @@ -44,15 +45,17 @@ bool do_intersect(const typename K::Circle_2& circle, } // namespace Intersections template -bool do_intersect(const CGAL::Bbox_2& a, - const Circle_2& b) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& a, + const Circle_2& b) { return K().do_intersect_2_object()(a, b); } template -bool do_intersect(const Circle_2& a, - const CGAL::Bbox_2& b) +typename K::Boolean +do_intersect(const Circle_2& a, + const CGAL::Bbox_2& b) { return K().do_intersect_2_object()(a, b); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Iso_rectangle_2.h index 1ada75030d3..1c389664308 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Iso_rectangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Iso_rectangle_2.h @@ -21,15 +21,19 @@ namespace CGAL { template -inline bool do_intersect(const Iso_rectangle_2 &rect, - const Bbox_2 &box) +inline +typename K::Boolean +do_intersect(const Iso_rectangle_2& rect, + const Bbox_2& box) { return do_intersect(K::Iso_rectangle_2(box), rect); } template -inline bool do_intersect(const Bbox_2 &box, - const Iso_rectangle_2 &rect) +inline +typename K::Boolean +do_intersect(const Bbox_2 &box, + const Iso_rectangle_2 &rect) { return do_intersect(rect, box); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h index 3b762f0882e..76a4cf316a0 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Line_2.h @@ -27,18 +27,20 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Line_2& line, - const CGAL::Bbox_2& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Line_2& line, + const CGAL::Bbox_2& bbox, + const K& k) { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; return Intersections::internal::do_intersect(line, Iso_rectangle_2(bbox), k); } template -bool do_intersect(const CGAL::Bbox_2& bbox, - const typename K::Line_2& line, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& bbox, + const typename K::Line_2& line, + const K& k) { return Intersections::internal::do_intersect(line, bbox, k); } @@ -47,13 +49,17 @@ bool do_intersect(const CGAL::Bbox_2& bbox, } // namespace Intersections template -bool do_intersect(const CGAL::Bbox_2& bbox, const Line_2& line) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& bbox, + const Line_2& line) { return K().do_intersect_2_object()(bbox, line); } template -bool do_intersect(const Line_2& line, const CGAL::Bbox_2& bbox) +typename K::Boolean +do_intersect(const Line_2& line, + const CGAL::Bbox_2& bbox) { return K().do_intersect_2_object()(line, bbox); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h index 237407c60ba..1c214d44a4d 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Point_2.h @@ -24,9 +24,11 @@ namespace Intersections { namespace internal { template -inline bool do_intersect(const Bbox_2 &bbox, - const Point_2 &pt, - const K& k) +inline +typename K::Boolean +do_intersect(const Bbox_2 &bbox, + const Point_2 &pt, + const K& k) { Point_2 bl(bbox.xmin(), bbox.ymin()), tr(bbox.xmax(), bbox.ymax()); @@ -36,9 +38,11 @@ inline bool do_intersect(const Bbox_2 &bbox, } template -inline bool do_intersect(const Point_2 &pt, - const Bbox_2& bbox, - const K& k) +inline +typename K::Boolean +do_intersect(const Point_2 &pt, + const Bbox_2& bbox, + const K& k) { return do_intersect(bbox, pt, k); } @@ -69,15 +73,17 @@ intersection(const CGAL::Bbox_2& b, } // namespace Intersections template -bool do_intersect(const CGAL::Bbox_2& a, - const Point_2& b) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& a, + const Point_2& b) { return Intersections::internal::do_intersect(a,b,K()); } template -bool do_intersect(const Point_2& a, - const CGAL::Bbox_2& b) +typename K::Boolean +do_intersect(const Point_2& a, + const CGAL::Bbox_2& b) { return Intersections::internal::do_intersect(b,a,K()); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h index 75b2e71ebf7..ca5c4411e7e 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Ray_2.h @@ -27,18 +27,20 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Ray_2& ray, - const CGAL::Bbox_2& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Ray_2& ray, + const CGAL::Bbox_2& bbox, + const K& k) { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; return Intersections::internal::do_intersect(ray, Iso_rectangle_2(bbox), k); } template -bool do_intersect(const CGAL::Bbox_2& bbox, - const typename K::Ray_2& ray, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& bbox, + const typename K::Ray_2& ray, + const K& k) { return Intersections::internal::do_intersect(ray, bbox, k); } @@ -47,13 +49,17 @@ bool do_intersect(const CGAL::Bbox_2& bbox, } // namespace Intersections template -bool do_intersect(const CGAL::Bbox_2& bbox, const Ray_2& ray) +typename K::Boolean +do_intersect(const CGAL::Bbox_2& bbox, + const Ray_2& ray) { return K().do_intersect_2_object()(bbox, ray); } template -bool do_intersect(const Ray_2& ray, const CGAL::Bbox_2& bbox) +typename K::Boolean +do_intersect(const Ray_2& ray, + const CGAL::Bbox_2& bbox) { return K().do_intersect_2_object()(ray, bbox); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Segment_2.h index 1bb05d61c91..25834353eb8 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Segment_2.h @@ -20,20 +20,21 @@ namespace CGAL { - template -inline bool do_intersect( - const Segment_2 &seg, - const Bbox_2 &box) +inline +typename K::Boolean +do_intersect(const Segment_2& seg, + const Bbox_2& box) { typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax()); return do_intersect(rec, seg); } template -inline bool do_intersect( - const Bbox_2 &box, - const Segment_2 &seg) +inline +typename K::Boolean +do_intersect(const Bbox_2& box, + const Segment_2& seg) { return do_intersect(seg, box); } @@ -41,7 +42,8 @@ inline bool do_intersect( template typename Intersection_traits::result_type intersection(const CGAL::Bbox_2& box, - const Segment_2& seg) { + const Segment_2& seg) + { typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax()); return intersection(rec, seg); } @@ -49,9 +51,11 @@ intersection(const CGAL::Bbox_2& box, template typename Intersection_traits::result_type intersection(const Segment_2& seg, - const CGAL::Bbox_2& box) { + const CGAL::Bbox_2& box) +{ return intersection(box, seg); } -} +} // namespace CGAL + #endif // CGAL_INTERSECTIONS_BBOX_2_SEGMENT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Triangle_2.h index 854499c7151..0cf76cbff32 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Bbox_2_Triangle_2.h @@ -20,20 +20,21 @@ namespace CGAL { - template -inline bool do_intersect( - const Triangle_2 &tr, - const Bbox_2 &box) +inline +typename K::Boolean +do_intersect(const Triangle_2& tr, + const Bbox_2& box) { typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax()); return do_intersect(rec, tr); } template -inline bool do_intersect( - const Bbox_2 &box, - const Triangle_2 &tr) +inline +typename K::Boolean +do_intersect(const Bbox_2& box, + const Triangle_2& tr) { return do_intersect(tr, box); } @@ -41,7 +42,8 @@ inline bool do_intersect( template typename Intersection_traits::result_type intersection(const Bbox_2& box, - const Triangle_2& tr) { + const Triangle_2& tr) +{ typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax()); return intersection(rec, tr); } @@ -49,9 +51,11 @@ intersection(const Bbox_2& box, template typename Intersection_traits::result_type intersection(const Triangle_2& tr, - const Bbox_2& box) { + const Bbox_2& box) +{ return intersection(box, tr); } -} +} // namespace CGAL + #endif // CGAL_INTERSECTIONS_BBOX_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h index 4f24b27c2de..ee7e48255a0 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Circle_2.h @@ -27,9 +27,9 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Circle_2 & circ1, - const typename K::Circle_2& circ2, - const K&) +typename K::Boolean do_intersect(const typename K::Circle_2& circ1, + const typename K::Circle_2& circ2, + const K&) { typedef typename K::FT FT; diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h index c1ab3dbc4e1..37a41c0b66d 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Iso_rectangle_2.h @@ -24,9 +24,9 @@ namespace internal { // Circle_2 is not a disk, thus if the box is contained within the circle, there is no intersection. template -bool do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle, - const typename K::Iso_rectangle_2& rec, - const K&) +typename K::Boolean do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle, + const typename K::Iso_rectangle_2& rec, + const K&) { typedef typename K::FT FT; typedef typename K::Point_2 Point; @@ -92,18 +92,17 @@ bool do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle, } template -bool do_intersect(const typename K::Iso_rectangle_2& rec, - const typename K::Circle_2& circle, - const K&) +typename K::Boolean do_intersect(const typename K::Iso_rectangle_2& rec, + const typename K::Circle_2& circle, + const K&) { return do_intersect_circle_iso_rectangle_2(circle, rec, K()); } - template -bool do_intersect(const typename K::Circle_2& circle, - const typename K::Iso_rectangle_2& rec, - const K&) +typename K::Boolean do_intersect(const typename K::Circle_2& circle, + const typename K::Iso_rectangle_2& rec, + const K&) { return do_intersect_circle_iso_rectangle_2(circle, rec, K()); } diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h index a850baa2253..2d2ac26fc56 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Line_2.h @@ -29,8 +29,8 @@ namespace Intersections { namespace internal { template -bool -do_intersect(const typename K::Circle_2 & c, +typename K::Boolean +do_intersect(const typename K::Circle_2& c, const typename K::Line_2& l, const K&) { @@ -38,9 +38,9 @@ do_intersect(const typename K::Circle_2 & c, } template -bool +typename K::Boolean do_intersect(const typename K::Line_2& l, - const typename K::Circle_2 & c, + const typename K::Circle_2& c, const K&) { return squared_distance(c.center(), l) <= c.squared_radius(); @@ -53,4 +53,4 @@ CGAL_DO_INTERSECT_FUNCTION(Circle_2, Line_2, 2) } // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h index 3d908c6a26b..ac88c867d12 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Point_2.h @@ -25,20 +25,19 @@ namespace internal { template inline -bool -do_intersect(const typename K::Point_2 &pt, - const typename K::Circle_2 &circle, +typename K::Boolean +do_intersect(const typename K::Point_2& pt, + const typename K::Circle_2& circle, const K&) { return circle.has_on_boundary(pt); } - template inline -bool -do_intersect(const typename K::Circle_2 &circle, - const typename K::Point_2 &pt, +typename K::Boolean +do_intersect(const typename K::Circle_2& circle, + const typename K::Point_2& pt, const K&) { return circle.has_on_boundary(pt); @@ -48,8 +47,8 @@ do_intersect(const typename K::Circle_2 &circle, template typename CGAL::Intersection_traits ::result_type -intersection(const typename K::Point_2 &pt, - const typename K::Circle_2 &circle, +intersection(const typename K::Point_2& pt, + const typename K::Circle_2& circle, const K& k) { if (do_intersect(pt,circle, k)) @@ -60,8 +59,8 @@ intersection(const typename K::Point_2 &pt, template typename CGAL::Intersection_traits ::result_type -intersection(const typename K::Circle_2 &circle, - const typename K::Point_2 &pt, +intersection(const typename K::Circle_2& circle, + const typename K::Point_2& pt, const K& k) { return internal::intersection(pt, circle, k); @@ -73,5 +72,6 @@ intersection(const typename K::Circle_2 &circle, CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2) -} //namespace CGAL +} // namespace CGAL + #endif // CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Ray_2.h index 18c19fd8466..0bb6c56f331 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Ray_2.h @@ -24,8 +24,8 @@ namespace Intersections { namespace internal { template -bool -do_intersect(const typename K::Circle_2 & c, +typename K::Boolean +do_intersect(const typename K::Circle_2& c, const typename K::Ray_2& r, const K&) { @@ -33,9 +33,9 @@ do_intersect(const typename K::Circle_2 & c, } template -bool +typename K::Boolean do_intersect(const typename K::Ray_2& r, - const typename K::Circle_2 & c, + const typename K::Circle_2& c, const K&) { return squared_distance(c.center(), r) <= c.squared_radius(); @@ -47,4 +47,5 @@ do_intersect(const typename K::Ray_2& r, CGAL_DO_INTERSECT_FUNCTION(Circle_2, Ray_2, 2) } // namespace CGAL + #endif // CGAL_INTERSECTIONS_2_CIRCLE_2_RAY_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Segment_2.h index 71384fcc4e6..d884d520332 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Segment_2.h @@ -24,8 +24,8 @@ namespace Intersections { namespace internal { template -bool -do_intersect(const typename K::Circle_2 & c, +typename K::Boolean +do_intersect(const typename K::Circle_2& c, const typename K::Segment_2& s, const K&) { @@ -33,9 +33,9 @@ do_intersect(const typename K::Circle_2 & c, } template -bool +typename K::Boolean do_intersect(const typename K::Segment_2& s, - const typename K::Circle_2 & c, + const typename K::Circle_2& c, const K&) { return squared_distance(c.center(), s) <= c.squared_radius(); @@ -47,4 +47,5 @@ do_intersect(const typename K::Segment_2& s, CGAL_DO_INTERSECT_FUNCTION(Circle_2, Segment_2, 2) } // namespace CGAL + #endif // CGAL_INTERSECTIONS_2_CIRCLE_2_SEGMENT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Triangle_2.h index 9353da936ba..e74f1e80e8d 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Circle_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Circle_2_Triangle_2.h @@ -25,7 +25,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean do_intersect(const typename K::Circle_2 & c, const typename K::Triangle_2& t, const K&) @@ -48,9 +48,9 @@ do_intersect(const typename K::Circle_2 & c, } template -bool +typename K::Boolean do_intersect(const typename K::Triangle_2& t, - const typename K::Circle_2 & c, + const typename K::Circle_2& c, const K&) { return do_intersect(c,t); @@ -62,4 +62,5 @@ do_intersect(const typename K::Triangle_2& t, CGAL_DO_INTERSECT_FUNCTION(Circle_2, Triangle_2, 2) } // namespace CGAL + #endif // CGAL_INTERSECTIONS_2_CIRCLE_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h index a097eab4250..0b73db82b88 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Iso_rectangle_2.h @@ -74,20 +74,20 @@ intersection( } template -inline bool -do_intersect(const typename K::Iso_rectangle_2 &irect1, - const typename K::Iso_rectangle_2 &irect2, - const K&) { +typename K::Boolean +do_intersect(const typename K::Iso_rectangle_2& irect1, + const typename K::Iso_rectangle_2& irect2, + const K&) +{ return bool(intersection(irect1, irect2)); } } // namespace internal } // namespace Intersections - CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_rectangle_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h index a8d188a7a42..74bb8ff2f82 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Line_2.h @@ -58,25 +58,27 @@ protected: }; template -inline bool do_intersect(const typename K::Line_2 &p1, - const typename K::Iso_rectangle_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Line_2& l, + const typename K::Iso_rectangle_2& ir, + const K&) { - typedef Line_2_Iso_rectangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Line_2_Iso_rectangle_2_pair pair_t; + pair_t pair(&l, &ir); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } template -inline bool do_intersect(const typename K::Iso_rectangle_2 &p2, - const typename K::Line_2 &p1, - const K& k) +inline +typename K::Boolean +do_intersect(const typename K::Iso_rectangle_2& ir, + const typename K::Line_2& l, + const K& k) { - return internal::do_intersect(p1, p2, k); + return internal::do_intersect(l, ir, k); } - - template typename Line_2_Iso_rectangle_2_pair::Intersection_results Line_2_Iso_rectangle_2_pair::intersection_type() const @@ -217,4 +219,4 @@ CGAL_DO_INTERSECT_FUNCTION(Line_2, Iso_rectangle_2, 2) #include -#endif +#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h index 853dcc54600..011eacf8e36 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Point_2.h @@ -30,22 +30,22 @@ namespace internal { template inline -bool -do_intersect(const typename K::Point_2 &pt, - const typename K::Iso_rectangle_2 &iso, +typename K::Boolean +do_intersect(const typename K::Point_2& pt, + const typename K::Iso_rectangle_2& iso, const K&) { - return !iso.has_on_unbounded_side(pt); + return !iso.has_on_unbounded_side(pt); } template inline -bool -do_intersect(const typename K::Iso_rectangle_2 &iso, - const typename K::Point_2 &pt, +typename K::Boolean +do_intersect(const typename K::Iso_rectangle_2& iso, + const typename K::Point_2& pt, const K&) { - return !iso.has_on_unbounded_side(pt); + return !iso.has_on_unbounded_side(pt); } template @@ -77,6 +77,6 @@ intersection(const typename K::Iso_rectangle_2 &iso, CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h index 5f2b52a311a..6d9bb8e6e91 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Ray_2.h @@ -55,21 +55,25 @@ protected: }; template -inline bool do_intersect(const typename K::Ray_2 &p1, - const typename K::Iso_rectangle_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Ray_2& r, + const typename K::Iso_rectangle_2& ir, + const K&) { - typedef Ray_2_Iso_rectangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Ray_2_Iso_rectangle_2_pair pair_t; + pair_t pair(&r, &ir); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } template -inline bool do_intersect(const typename K::Iso_rectangle_2 &p2, - const typename K::Ray_2 &p1, - const K& k) +inline +typename K::Boolean +do_intersect(const typename K::Iso_rectangle_2& ir, + const typename K::Ray_2& r, + const K& k) { - return do_intersect(p1, p2, k); + return do_intersect(r, ir, k); } template @@ -200,9 +204,8 @@ Ray_2_Iso_rectangle_2_pair::intersection_point() const CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2) - -} //namespace CGAL +} // namespace CGAL #include -#endif // CGAL_RAY_2_iSO_RECTANGLE_2_INTERSECTION_H +#endif // CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h index 28121109d10..be4c309f0df 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h @@ -54,21 +54,6 @@ protected: _max; }; -template -inline bool do_intersect( - const typename K::Segment_2 &p1, - const typename K::Iso_rectangle_2 &p2, - const K&) -{ - typedef Segment_2_Iso_rectangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; -} - - - - - template typename CGAL::Intersection_traits ::result_type @@ -208,17 +193,26 @@ intersection_point() const return translated_point(_ref_point, construct_scaled_vector(_dir,_min)); } - +template +inline +typename K::Boolean +do_intersect(const typename K::Segment_2& s, + const typename K::Iso_rectangle_2& ir, + const K&) +{ + typedef Segment_2_Iso_rectangle_2_pair pair_t; + pair_t pair(&s, &ir); + return pair.intersection_type() != pair_t::NO_INTERSECTION; +} template -inline bool do_intersect( - const typename K::Iso_rectangle_2 &p1, - const typename K::Segment_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Iso_rectangle_2& ir, + const typename K::Segment_2& s, + const K& k) { - typedef Segment_2_Iso_rectangle_2_pair pair_t; - pair_t pair(&p2, &p1); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + return do_intersect(s, ir, k); } } // namespace internal @@ -227,7 +221,7 @@ inline bool do_intersect( CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2) -} //namespace CGAL +} // namespace CGAL #include diff --git a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h index 1409a6c7db8..0fb171e7b92 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Iso_rectangle_2_Triangle_2.h @@ -292,10 +292,10 @@ namespace internal { } template - bool do_intersect( - const typename K::Triangle_2 &tr, - const typename K::Iso_rectangle_2 &ir, - const K& k) + typename K::Boolean + do_intersect(const typename K::Triangle_2& tr, + const typename K::Iso_rectangle_2& ir, + const K& k) { //1) check if at least one vertex of tr is not outside ir //2) if not, check if at least on vertex of tr is not outside tr @@ -318,20 +318,21 @@ namespace internal { } template - inline bool do_intersect( - const typename K::Iso_rectangle_2 &ir, - const typename K::Triangle_2 &tr, - const K& k) + inline + typename K::Boolean + do_intersect(const typename K::Iso_rectangle_2& ir, + const typename K::Triangle_2& tr, + const K& k) { - return do_intersect(tr,ir,k); + return do_intersect(tr, ir, k); } -} //namespace internal +} // namespace internal } // namespace Intersections CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2) -}//end namespace +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h index 8d2d3e6ae0d..6a48b777594 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Line_2.h @@ -52,17 +52,18 @@ protected: mutable typename K::Point_2 _intersection_point; }; -template -inline bool do_intersect( - const typename K::Line_2 &p1, - const typename K::Line_2 &p2, - const K&) -{ - typedef Line_2_Line_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; -} +template +inline +typename K::Boolean +do_intersect(const typename K::Line_2& l1, + const typename K::Line_2& l2, + const K&) +{ + typedef Line_2_Line_2_pair pair_t; + pair_t pair(&l1, &l2); + return pair.intersection_type() != pair_t::NO_INTERSECTION; +} template @@ -200,7 +201,6 @@ Line_2_Line_2_pair::intersection_line() const CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h index 9e3c2525b44..96ede987ac4 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Point_2.h @@ -29,21 +29,23 @@ namespace Intersections { namespace internal { template -inline bool -do_intersect(const typename K::Point_2 &pt, - const typename K::Line_2 &line, +inline +typename K::Boolean +do_intersect(const typename K::Point_2& pt, + const typename K::Line_2& line, const K&) { - return line.has_on(pt); + return line.has_on(pt); } template -inline bool -do_intersect(const typename K::Line_2 &line, - const typename K::Point_2 &pt, +inline +typename K::Boolean +do_intersect(const typename K::Line_2& line, + const typename K::Point_2& pt, const K&) { - return line.has_on(pt); + return line.has_on(pt); } template @@ -76,6 +78,6 @@ intersection(const typename K::Line_2 &line, CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h index 87f59d8a45a..8ea0cff4cd4 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Ray_2.h @@ -55,17 +55,26 @@ protected: }; template -inline bool do_intersect( - const typename K::Ray_2 &p1, - const typename K::Line_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Ray_2& r, + const typename K::Line_2& l, + const K&) { - typedef Ray_2_Line_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Ray_2_Line_2_pair pair_t; + pair_t pair(&r, &l); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } - +template +inline +typename K::Boolean +do_intersect(const typename K::Line_2& l, + const typename K::Ray_2& r, + const K& k) +{ + return do_intersect(r, l, k); +} template typename Intersection_traits @@ -99,20 +108,6 @@ intersection(const typename K::Line_2 &line, return internal::intersection(ray, line, k); } - -template -inline bool do_intersect( - const typename K::Line_2 &p1, - const typename K::Ray_2 &p2, - const K&) -{ - typedef Ray_2_Line_2_pair pair_t; - pair_t pair(&p2, &p1); - return pair.intersection_type() != pair_t::NO_INTERSECTION; -} - - - template typename Ray_2_Line_2_pair::Intersection_results Ray_2_Line_2_pair::intersection_type() const diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h index 5c2850af7a8..f61d38c2a06 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Segment_2.h @@ -51,14 +51,25 @@ protected: }; template -inline bool do_intersect( - const typename K::Segment_2 &p1, - const typename K::Line_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Segment_2& s, + const typename K::Line_2& l, + const K& ) { - typedef Segment_2_Line_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Segment_2_Line_2_pair pair_t; + pair_t pair(&s, &l); + return pair.intersection_type() != pair_t::NO_INTERSECTION; +} + +template +inline +typename K::Boolean +do_intersect(const typename K::Line_2& l, + const typename K::Segment_2& s, + const K& k) +{ + return internal::do_intersect(s, l, k); } template @@ -92,17 +103,6 @@ intersection(const typename K::Line_2 &line, return internal::intersection(seg, line, k); } - -template -inline bool do_intersect( - const typename K::Line_2 &line, - const typename K::Segment_2 &seg, - const K& k) -{ - return internal::do_intersect(seg, line, k); -} - - template typename Segment_2_Line_2_pair::Intersection_results Segment_2_Line_2_pair::intersection_type() const @@ -156,7 +156,6 @@ Segment_2_Line_2_pair::intersection_segment() const CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h index 9f514030f8a..158ede462b6 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Line_2_Triangle_2.h @@ -55,24 +55,24 @@ protected: template inline -bool -do_intersect(const typename K::Line_2 &p1, - const typename K::Triangle_2 &p2, +typename K::Boolean +do_intersect(const typename K::Line_2& l, + const typename K::Triangle_2& tr, const K&) { - typedef Line_2_Triangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Line_2_Triangle_2_pair pair_t; + pair_t pair(&l, &tr); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } template inline -bool -do_intersect(const typename K::Triangle_2 &p2, - const typename K::Line_2 &p1, +typename K::Boolean +do_intersect(const typename K::Triangle_2& tr, + const typename K::Line_2& l, const K& k) { - return internal::do_intersect(p1, p2, k); + return internal::do_intersect(l, tr, k); } template @@ -190,6 +190,6 @@ intersection(const typename K::Triangle_2 &tr, CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h index 7c67f3c4cf5..3b13b6a461e 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Point_2.h @@ -28,34 +28,33 @@ namespace Intersections { namespace internal { template -inline bool -do_intersect(const typename K::Point_2 &pt1, - const typename K::Point_2 &pt2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Point_2& pt1, + const typename K::Point_2& pt2, + const K& k) { - return pt1 == pt2; + return k.equal_2_object()(pt1, pt2); } template -typename CGAL::Intersection_traits -::result_type -intersection(const typename K::Point_2 &pt1, - const typename K::Point_2 &pt2, - const K&) +typename CGAL::Intersection_traits::result_type +intersection(const typename K::Point_2& pt1, + const typename K::Point_2& pt2, + const K& k) { - if (pt1 == pt2) { - return intersection_return(pt1); - } - return intersection_return(); + if (k.equal_2_object()(pt1, pt2)) + return intersection_return(pt1); + + return intersection_return(); } -}// namespace internal +} // namespace internal } // namespace Intersections CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h index ae67b94c503..271e86184cf 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Ray_2.h @@ -30,9 +30,9 @@ namespace internal { template inline -bool -do_intersect(const typename K::Point_2 &pt, - const typename K::Ray_2 &ray, +typename K::Boolean +do_intersect(const typename K::Point_2& pt, + const typename K::Ray_2& ray, const K&) { return ray.has_on(pt); @@ -41,9 +41,9 @@ do_intersect(const typename K::Point_2 &pt, template inline -bool -do_intersect(const typename K::Ray_2 &ray, - const typename K::Point_2 &pt, +typename K::Boolean +do_intersect(const typename K::Ray_2& ray, + const typename K::Point_2& pt, const K&) { return ray.has_on(pt); @@ -51,8 +51,7 @@ do_intersect(const typename K::Ray_2 &ray, template -typename CGAL::Intersection_traits -::result_type +typename CGAL::Intersection_traits::result_type intersection(const typename K::Point_2 &pt, const typename K::Ray_2 &ray, const K& k) @@ -64,8 +63,7 @@ intersection(const typename K::Point_2 &pt, } template -typename CGAL::Intersection_traits -::result_type +typename CGAL::Intersection_traits::result_type intersection(const typename K::Ray_2 &ray, const typename K::Point_2 &pt, const K& k) @@ -79,7 +77,6 @@ intersection(const typename K::Ray_2 &ray, CGAL_INTERSECTION_FUNCTION(Point_2, Ray_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Ray_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_RAY_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h index 3486d58896f..8a48c10b6e3 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Segment_2.h @@ -30,7 +30,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_2 &pt, const typename K::Segment_2 &seg, const K&) @@ -40,7 +40,7 @@ do_intersect(const typename K::Point_2 &pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_2 &seg, const typename K::Point_2 &pt, const K&) @@ -77,10 +77,9 @@ intersection( const typename K::Segment_2 &seg, } // namespace internal } // namespace Intersections - CGAL_INTERSECTION_FUNCTION(Point_2, Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Segment_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_SEGMENT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h index ba496198cd9..1d70d3b7d54 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Point_2_Triangle_2.h @@ -50,9 +50,11 @@ protected: }; template -inline bool do_intersect(const typename K::Point_2 &p1, - const typename K::Triangle_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Point_2& p1, + const typename K::Triangle_2& p2, + const K&) { typedef Point_2_Triangle_2_pair pair_t; pair_t pair(&p1, &p2); @@ -60,9 +62,11 @@ inline bool do_intersect(const typename K::Point_2 &p1, } template -inline bool do_intersect(const typename K::Triangle_2 &p2, - const typename K::Point_2 &p1, - const K& k) +inline +typename K::Boolean +do_intersect(const typename K::Triangle_2& p2, + const typename K::Point_2& p1, + const K& k) { return internal::do_intersect(p1, p2, k); } @@ -133,6 +137,6 @@ intersection(const typename K::Triangle_2 &tr, CGAL_INTERSECTION_FUNCTION(Point_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_POINT_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h index 2b0c166797b..850f3e364b0 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h @@ -54,14 +54,15 @@ protected: }; template -inline bool do_intersect( - const typename K::Ray_2 &p1, - const typename K::Ray_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Ray_2& r1, + const typename K::Ray_2& r2, + const K&) { - typedef Ray_2_Ray_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Ray_2_Ray_2_pair pair_t; + pair_t pair(&r1, &r2); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } @@ -252,7 +253,6 @@ intersection(const typename K::Ray_2 &ray1, CGAL_INTERSECTION_FUNCTION_SELF(Ray_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_RAY_2_RAY_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h index 2cdebe84a13..acc6d4a41df 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Segment_2.h @@ -54,21 +54,25 @@ protected: }; template -inline bool do_intersect(const typename K::Ray_2 &p1, - const typename K::Segment_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Ray_2& r, + const typename K::Segment_2& s, + const K&) { - typedef Ray_2_Segment_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Ray_2_Segment_2_pair pair_t; + pair_t pair(&r, &s); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } template -inline bool do_intersect(const typename K::Segment_2 &p2, - const typename K::Ray_2 &p1, - const K& k) +inline +typename K::Boolean +do_intersect(const typename K::Segment_2& s, + const typename K::Ray_2& r, + const K& k) { - return internal::do_intersect(p1, p2, k); + return internal::do_intersect(r, s, k); } template @@ -265,6 +269,6 @@ intersection(const typename K::Segment_2 &seg, CGAL_INTERSECTION_FUNCTION(Ray_2, Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Segment_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_RAY_2_SEGMENT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h index 6db56586c55..cb915a1020b 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Ray_2_Triangle_2.h @@ -165,26 +165,26 @@ intersection(const typename K::Triangle_2&tr, template -inline bool do_intersect( - const typename K::Ray_2 &p1, - const typename K::Triangle_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Ray_2& r, + const typename K::Triangle_2& tr, + const K&) { - typedef Ray_2_Triangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Ray_2_Triangle_2_pair pair_t; + pair_t pair(&r, &tr); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } template -inline bool do_intersect( - const typename K::Triangle_2 &p1, - const typename K::Ray_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Triangle_2& tr, + const typename K::Ray_2& r, + const K& k) { - typedef Ray_2_Triangle_2_pair pair_t; - pair_t pair(&p2, &p1); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + return do_intersect(r, tr, k); } } // namespace internal @@ -193,7 +193,6 @@ inline bool do_intersect( CGAL_INTERSECTION_FUNCTION(Ray_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Ray_2, Triangle_2, 2) +} // namespace CGAL -} //namespace CGAL - -#endif +#endif // CGAL_INTERSECTIONS_2_RAY_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h index 5fd1545cc38..57f2e31b5bb 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Segment_2.h @@ -25,7 +25,6 @@ #include #include #include -#include #include namespace CGAL { @@ -326,7 +325,7 @@ do_intersect_with_info(const typename K::Segment_2 &seg1, template -bool +typename K::Boolean do_intersect(const typename K::Segment_2 &seg1, const typename K::Segment_2 &seg2, const K& k) @@ -492,6 +491,6 @@ intersection(const typename K::Segment_2 &seg1, CGAL_INTERSECTION_FUNCTION_SELF(Segment_2, 2) CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_SEGMENT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h index 4d2b93c05cf..f747ac083cf 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Segment_2_Triangle_2.h @@ -52,19 +52,26 @@ protected: }; template -inline bool do_intersect( - const typename K::Segment_2 &p1, - const typename K::Triangle_2 &p2, - const K&) +inline +typename K::Boolean +do_intersect(const typename K::Segment_2& s, + const typename K::Triangle_2& tr, + const K&) { - typedef Segment_2_Triangle_2_pair pair_t; - pair_t pair(&p1, &p2); - return pair.intersection_type() != pair_t::NO_INTERSECTION; + typedef Segment_2_Triangle_2_pair pair_t; + pair_t pair(&s, &tr); + return pair.intersection_type() != pair_t::NO_INTERSECTION; } - - - +template +inline +typename K::Boolean +do_intersect(const typename K::Triangle_2& tr, + const typename K::Segment_2& s, + const K& k) +{ + return do_intersect(s, tr, k); +} template typename Segment_2_Triangle_2_pair::Intersection_results @@ -174,24 +181,12 @@ intersection(const typename K::Triangle_2&tr, return internal::intersection(seg, tr, k); } - -template -inline bool do_intersect( - const typename K::Triangle_2 &p1, - const typename K::Segment_2 &p2, - const K&) -{ - typedef Segment_2_Triangle_2_pair pair_t; - pair_t pair(&p2, &p1); - return pair.intersection_type() != pair_t::NO_INTERSECTION; -} - } // namespace internal } // namespace Intersections CGAL_INTERSECTION_FUNCTION(Segment_2, Triangle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Segment_2, Triangle_2, 2) -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h index 27b2d9f8f67..405d6499696 100644 --- a/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/Triangle_2_Triangle_2.h @@ -22,8 +22,10 @@ #include namespace CGAL { + CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2) CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2) + } // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_TRIANGLE_2_TRIANGLE_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h b/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h index 36cc7e06486..88176280301 100644 --- a/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Straight_2.h @@ -14,7 +14,6 @@ // // Author(s) : Geert-Jan Giezeman - #ifndef CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H #define CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H @@ -346,6 +345,6 @@ collinear_order(typename K::Point_2 const &pt1, typename K::Point_2 const & pt2) } // namespace internal } // namespace Intersections -} //namespace CGAL +} // namespace CGAL -#endif +#endif // CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H diff --git a/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h index e5db80f33e1..774abba6178 100644 --- a/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h +++ b/Intersections_2/include/CGAL/Intersections_2/internal/Triangle_2_Triangle_2_do_intersect_impl.h @@ -23,15 +23,15 @@ namespace Intersections { namespace internal { template -bool intersection_test_vertex(const typename K::Point_2 * P1, - const typename K::Point_2 * Q1, - const typename K::Point_2 * R1, - const typename K::Point_2 * P2, - const typename K::Point_2 * Q2, - const typename K::Point_2 * R2, - const K & k ){ - - +typename K::Boolean +intersection_test_vertex(const typename K::Point_2* P1, + const typename K::Point_2* Q1, + const typename K::Point_2* R1, + const typename K::Point_2* P2, + const typename K::Point_2* Q2, + const typename K::Point_2* R2, + const K& k) +{ CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1) == POSITIVE); CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2) @@ -65,16 +65,15 @@ bool intersection_test_vertex(const typename K::Point_2 * P1, template -bool intersection_test_edge(const typename K::Point_2 * P1, - const typename K::Point_2 * Q1, - const typename K::Point_2 * R1, - const typename K::Point_2 * P2, - const typename K::Point_2 * - CGAL_kernel_precondition_code(Q2), - const typename K::Point_2 * R2, - const K & k ){ - - +typename K::Boolean +intersection_test_edge(const typename K::Point_2* P1, + const typename K::Point_2* Q1, + const typename K::Point_2* R1, + const typename K::Point_2* P2, + const typename K::Point_2* CGAL_kernel_precondition_code(Q2), + const typename K::Point_2* R2, + const K& k) +{ CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1) == POSITIVE); CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2) @@ -99,12 +98,12 @@ bool intersection_test_edge(const typename K::Point_2 * P1, } - template -bool do_intersect(const typename K::Triangle_2 &t1, - const typename K::Triangle_2 &t2, - const K & k ){ - +typename K::Boolean +do_intersect(const typename K::Triangle_2& t1, + const typename K::Triangle_2& t2, + const K& k) +{ CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t1) ); CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t2) ); @@ -164,6 +163,6 @@ bool do_intersect(const typename K::Triangle_2 &t1, } // namespace internal } // namespace Intersections -} //namespace CGAL +} // namespace CGAL -#endif //CGAL_TRIANGLE_2_TRIANGLE_2_DO_INTERSECT_H +#endif // CGAL_TRIANGLE_2_TRIANGLE_2_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h index f497eb4527f..bb244628c5a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Bbox_3.h @@ -64,7 +64,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean inline do_intersect(const CGAL::Bbox_3& c, const CGAL::Bbox_3& bbox, diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h index fae76f0d787..9e509f0f405 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h @@ -30,15 +30,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Iso_cuboid_3& ic) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Iso_cuboid_3& ic) { return K().do_intersect_3_object()(box, ic); } template -bool do_intersect(const Iso_cuboid_3& ic, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Iso_cuboid_3& ic, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(ic, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h index 20a9e5e3d2a..d0aa3a8ddd3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Line_3.h @@ -24,15 +24,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Line_3& l) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Line_3& l) { return K().do_intersect_3_object()(box, l); } template -bool do_intersect(const Line_3& l, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Line_3& l, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(l, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h index ce7888e7539..1b83a30290f 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Plane_3.h @@ -30,15 +30,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Plane_3& pl) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Plane_3& pl) { return K().do_intersect_3_object()(box, pl); } template -bool do_intersect(const Plane_3& pl, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Plane_3& pl, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(pl, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h index 5737a04dba5..316e5ffc003 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Point_3.h @@ -30,8 +30,9 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Point_3& p) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Point_3& p) { Point_3 bl(box.xmin(), box.ymin(), box.zmin()), tr(box.xmax(), box.ymax(), box.zmax()); @@ -40,8 +41,9 @@ bool do_intersect(const CGAL::Bbox_3& box, } template -bool do_intersect(const Point_3& a, - const CGAL::Bbox_3& b) +typename K::Boolean +do_intersect(const Point_3& a, + const CGAL::Bbox_3& b) { return do_intersect(b,a); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h index 3d557b0ecdd..5d53929d895 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Ray_3.h @@ -30,15 +30,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Ray_3& r) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Ray_3& r) { return K().do_intersect_3_object()(box, r); } template -bool do_intersect(const Ray_3& r, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Ray_3& r, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(r, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h index 35b20b8091d..cb8cd08bd88 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Segment_3.h @@ -30,15 +30,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Segment_3& s) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Segment_3& s) { return K().do_intersect_3_object()(box, s); } template -bool do_intersect(const Segment_3& s, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Segment_3& s, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(s, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h index 913020d62cd..87171cfd3de 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Sphere_3.h @@ -28,15 +28,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Sphere_3& s) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Sphere_3& s) { return K().do_intersect_3_object()(box, s); } template -bool do_intersect(const Sphere_3& s, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Sphere_3& s, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(s, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h index 456973dbc6a..73fee00b20d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h @@ -28,15 +28,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Tetrahedron_3& t) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Tetrahedron_3& t) { return K().do_intersect_3_object()(box, t); } template -bool do_intersect(const Tetrahedron_3& t, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Tetrahedron_3& t, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(t, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h index 202765284c7..ccf1a560256 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Bbox_3_Triangle_3.h @@ -29,15 +29,17 @@ namespace CGAL { template -bool do_intersect(const CGAL::Bbox_3& box, - const Triangle_3& tr) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& box, + const Triangle_3& tr) { return K().do_intersect_3_object()(box, tr); } template -bool do_intersect(const Triangle_3& tr, - const CGAL::Bbox_3& box) +typename K::Boolean +do_intersect(const Triangle_3& tr, + const CGAL::Bbox_3& box) { return K().do_intersect_3_object()(tr, box); } diff --git a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h index b6d7c174b9f..764e6005cf3 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h @@ -34,4 +34,4 @@ CGAL_INTERSECTION_FUNCTION(Iso_cuboid_3, Triangle_3, 3) } // namespace CGAL -#endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H +#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H diff --git a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3_Plane_3.h b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3_Plane_3.h index 236fd2a9f50..3030089906c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3_Plane_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/Plane_3_Plane_3_Plane_3.h @@ -30,7 +30,8 @@ namespace CGAL { template -inline bool +inline +typename K::Boolean do_intersect(const Plane_3& plane1, const Plane_3& plane2, const Plane_3& plane3) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h index 1a2ae1310e5..ab6a98443af 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Iso_cuboid_3_do_intersect.h @@ -23,9 +23,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const CGAL::Bbox_3& bb, - const typename K::Iso_cuboid_3& ic, - const K& /* k */) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bb, + const typename K::Iso_cuboid_3& ic, + const K& /* k */) { // use CGAL::compare to access the Coercion_traits between K::FT and double if(compare(bb.xmax(), ic.xmin()) == SMALLER || compare(ic.xmax(), bb.xmin()) == SMALLER) @@ -38,9 +39,10 @@ bool do_intersect(const CGAL::Bbox_3& bb, } template -bool do_intersect(const typename K::Iso_cuboid_3& ic, - const CGAL::Bbox_3& bb, - const K& k) +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& ic, + const CGAL::Bbox_3& bb, + const K& k) { return do_intersect(bb, ic, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h index 6062ba6085a..f67b6c4d853 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Line_3_do_intersect.h @@ -14,7 +14,7 @@ #ifndef CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_LINE_3_DO_INTERSECT_H #define CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_LINE_3_DO_INTERSECT_H -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf #include #include @@ -25,9 +25,9 @@ namespace CGAL { namespace Intersections { namespace internal { -template +template inline -bool +typename K::Boolean bbox_line_do_intersect_aux(const LFT px, const LFT py, const LFT pz, const LFT vx, const LFT vy, const LFT vz, const BFT bxmin, const BFT bymin, const BFT bzmin, @@ -135,9 +135,10 @@ bbox_line_do_intersect_aux(const LFT px, const LFT py, const LFT pz, } template -bool do_intersect(const typename K::Line_3& line, - const CGAL::Bbox_3& bbox, - const K&) +typename K::Boolean +do_intersect(const typename K::Line_3& line, + const CGAL::Bbox_3& bbox, + const K&) { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; @@ -145,16 +146,17 @@ bool do_intersect(const typename K::Line_3& line, const Point_3& point = line.point(); const Vector_3& v = line.to_vector(); - return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(), - v.x(), v.y(), v.z(), - bbox.xmin(), bbox.ymin(), bbox.zmin(), - bbox.xmax(), bbox.ymax(), bbox.zmax()); + return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(), + v.x(), v.y(), v.z(), + bbox.xmin(), bbox.ymin(), bbox.zmin(), + bbox.xmax(), bbox.ymax(), bbox.zmax()); } template -bool do_intersect(const CGAL::Bbox_3& bbox, - const typename K::Line_3& line, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bbox, + const typename K::Line_3& line, + const K& k) { return do_intersect(line, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h index 803d8594e64..4e412f45d67 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h @@ -22,17 +22,19 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Plane_3& plane, - const Bbox_3& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Plane_3& plane, + const Bbox_3& bbox, + const K& k) { return do_intersect_plane_box(plane, bbox, k); } template -bool do_intersect(const Bbox_3& bbox, - const typename K::Plane_3& plane, - const K& k) +typename K::Boolean +do_intersect(const Bbox_3& bbox, + const typename K::Plane_3& plane, + const K& k) { return do_intersect_plane_box(plane, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h index 36ca263a827..31d26ac1fdb 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h @@ -14,7 +14,7 @@ #ifndef CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_RAY_3_DO_INTERSECT_H #define CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_RAY_3_DO_INTERSECT_H -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf #include // for CGAL::internal::do_intersect_bbox_segment_aux @@ -26,9 +26,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Ray_3& ray, - const CGAL::Bbox_3& bbox, - const K&) +typename K::Boolean +do_intersect(const typename K::Ray_3& ray, + const CGAL::Bbox_3& bbox, + const K&) { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -49,9 +50,10 @@ bool do_intersect(const typename K::Ray_3& ray, } template -bool do_intersect(const CGAL::Bbox_3& bbox, - const typename K::Ray_3& ray, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bbox, + const typename K::Ray_3& ray, + const K& k) { return do_intersect(ray, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h index 8a94ade50b7..f7ebc70d25e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h @@ -22,7 +22,7 @@ #include -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf // This algorithm intersects the line with the x-, y-, and z-slabs of the // bounding box, and computes the interval [t1, t2], in the @@ -224,10 +224,10 @@ do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz, CGAL_assertion(! is_negative(dmin)); CGAL_assertion(! is_negative(dmax)); - if(bounded_0) { + CGAL_assertion_code(if(bounded_0) {) CGAL_assertion(! is_negative(tmin)); CGAL_assertion(! is_negative(tmax)); - } + CGAL_assertion_code(}) // ----------------------------------- // treat y coord @@ -365,11 +365,10 @@ do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz, CGAL_assertion(! is_negative(dzmin)); CGAL_assertion(! is_negative(dzmax)); - if(bounded_0) - { + CGAL_assertion_code(if(bounded_0) {) CGAL_assertion(! is_negative(tzmin)); CGAL_assertion(! is_negative(tzmax)); - } + CGAL_assertion_code(}) typedef Do_intersect_bbox_segment_aux_is_greater Is_greater; typedef typename Is_greater::result_type Is_greater_value; @@ -454,10 +453,9 @@ template inline typename Do_intersect_bbox_segment_aux_is_greater::result_type -do_intersect_bbox_segment_aux( - const FT& px, const FT& py, const FT& pz, - const FT& qx, const FT& qy, const FT& qz, - const Bbox_3& bb) +do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz, + const FT& qx, const FT& qy, const FT& qz, + const Bbox_3& bb) { return do_intersect_bbox_segment_aux(px, py, pz, @@ -467,9 +465,10 @@ do_intersect_bbox_segment_aux( } template -bool do_intersect(const typename K::Segment_3& segment, - const CGAL::Bbox_3& bbox, - const K&) +typename K::Boolean +do_intersect(const typename K::Segment_3& segment, + const CGAL::Bbox_3& bbox, + const K&) { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -483,9 +482,10 @@ bool do_intersect(const typename K::Segment_3& segment, } template -bool do_intersect(const CGAL::Bbox_3& bbox, - const typename K::Segment_3& segment, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bbox, + const typename K::Segment_3& segment, + const K& k) { return do_intersect(segment, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h index f37ede7b5fa..4c3c4f0c731 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h @@ -23,9 +23,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Sphere_3& sphere, - const CGAL::Bbox_3& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Sphere_3& sphere, + const CGAL::Bbox_3& bbox, + const K& k) { return do_intersect_sphere_box_3(sphere, bbox.xmin(), bbox.ymin(), bbox.zmin(), @@ -34,9 +35,10 @@ bool do_intersect(const typename K::Sphere_3& sphere, } template -bool do_intersect(const CGAL::Bbox_3& bbox, - const typename K::Sphere_3& sphere, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bbox, + const typename K::Sphere_3& sphere, + const K& k) { return do_intersect(sphere, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Tetrahedron_3_do_intersect.h index 9be2c0ccef6..c842e5623ea 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Tetrahedron_3_do_intersect.h @@ -24,9 +24,11 @@ namespace Intersections { namespace internal { template -inline typename K::Boolean do_intersect(const CGAL::Bbox_3& aabb, - const typename K::Tetrahedron_3& tet, - const K& k) +inline +typename K::Boolean +do_intersect(const CGAL::Bbox_3& aabb, + const typename K::Tetrahedron_3& tet, + const K& k) { typename K::Construct_triangle_3 tr = k.construct_triangle_3_object(); typename K::Boolean result = false; @@ -57,9 +59,11 @@ inline typename K::Boolean do_intersect(const CGAL::Bbox_3& aabb, } template -inline typename K::Boolean do_intersect(const typename K::Tetrahedron_3& tet, - const CGAL::Bbox_3& bb, - const K &k) +inline +typename K::Boolean +do_intersect(const typename K::Tetrahedron_3& tet, + const CGAL::Bbox_3& bb, + const K &k) { return do_intersect(bb, tet, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h index 8eca9e6a517..c3ce7befc10 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h @@ -273,13 +273,13 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr }}; int forbidden_axis = -1; - int forbidden_size = -1; + int forbidden_side = -1; //determine whether one vector is collinear with an axis int tmp = collinear_axis(sides[0]); if(tmp != -1) { forbidden_axis = tmp; - forbidden_size = 0; + forbidden_side = 0; } else { @@ -287,7 +287,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr if(tmp != -1) { forbidden_axis = tmp; - forbidden_size = 1; + forbidden_side = 1; } else { @@ -295,7 +295,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr if(tmp != -1) { forbidden_axis = tmp; - forbidden_size = 2; + forbidden_side = 2; } } } @@ -305,7 +305,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr if(forbidden_axis != 0) { - if(forbidden_size != 0) + if(forbidden_side != 0) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -314,7 +314,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 1) + if(forbidden_side != 1) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -323,7 +323,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 2) + if(forbidden_side != 2) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -335,7 +335,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr if(forbidden_axis != 1) { - if(forbidden_size != 0) + if(forbidden_side != 0) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -344,7 +344,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 1) + if(forbidden_side != 1) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -353,7 +353,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 2) + if(forbidden_side != 2) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -365,7 +365,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr if(forbidden_axis != 2) { - if(forbidden_size != 0) + if(forbidden_side != 0) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -374,7 +374,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 1) + if(forbidden_side != 1) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -383,7 +383,7 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr return false; } - if(forbidden_size != 2) + if(forbidden_side != 2) { Uncertain b = do_axis_intersect(triangle, sides, bbox, do_axis_intersect_aux_impl); if(is_indeterminate(b)) @@ -397,9 +397,10 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array, 3>& tr } template -bool do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle, - const Box3& a_bbox, - const K& k) +typename K::Boolean +do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle, + const Box3& a_bbox, + const K& k) { if(certainly_not(do_bbox_intersect(a_triangle, a_bbox))) return false; @@ -423,22 +424,23 @@ bool do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle, { a_triangle[2][0], a_triangle[2][1], a_triangle[2][2] } }}; - // exception will be thrown in case the output is indeterminate return do_intersect_bbox_or_iso_cuboid_impl(triangle, a_bbox, do_axis_intersect_aux_impl); } template -bool do_intersect(const typename K::Triangle_3& triangle, - const CGAL::Bbox_3& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& triangle, + const CGAL::Bbox_3& bbox, + const K& k) { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } template -bool do_intersect(const CGAL::Bbox_3& bbox, - const typename K::Triangle_3& triangle, - const K& k) +typename K::Boolean +do_intersect(const CGAL::Bbox_3& bbox, + const typename K::Triangle_3& triangle, + const K& k) { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Iso_cuboid_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Iso_cuboid_3_do_intersect.h index 3cdf1025537..18bc0e585f4 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Iso_cuboid_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Iso_cuboid_3_do_intersect.h @@ -18,7 +18,8 @@ namespace Intersections { namespace internal { template -inline bool +inline +typename K::Boolean do_intersect(const typename K::Iso_cuboid_3& icub1, const typename K::Iso_cuboid_3& icub2, const K&) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Line_3_do_intersect.h index 0b3c26bf131..43c4db6c48c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Line_3_do_intersect.h @@ -23,7 +23,8 @@ namespace Intersections { namespace internal { template -inline bool +inline +typename K::Boolean do_intersect(const typename K::Line_3& line, const typename K::Iso_cuboid_3& ic, const K&) @@ -34,14 +35,15 @@ do_intersect(const typename K::Line_3& line, const Point_3& point = line.point(); const Vector_3& v = line.to_vector(); - return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(), - v.x(), v.y(), v.z(), - (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), - (ic.max)().x(), (ic.max)().y(), (ic.max)().z()); + return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(), + v.x(), v.y(), v.z(), + (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), + (ic.max)().x(), (ic.max)().y(), (ic.max)().z()); } template -inline bool +inline +typename K::Boolean do_intersect(const typename K::Iso_cuboid_3& ic, const typename K::Line_3& l, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_do_intersect.h index 17af49e0246..f35ddb65d2b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_do_intersect.h @@ -79,15 +79,16 @@ Uncertain get_min_max(const typename K::Vector_3& p, } template // Iso_cuboid_3 or Bbox_3 -bool do_intersect_plane_box(const typename K::Plane_3& plane, - const Box3& bbox, - const K&) +typename K::Boolean do_intersect_plane_box(const typename K::Plane_3& plane, + const Box3& bbox, + const K&) { typedef typename K::Point_3 Point_3; Point_3 p_max, p_min; Uncertain b = get_min_max(plane.orthogonal_vector(), bbox, p_min, p_max); - if(is_certain(b)){ + if(is_certain(b)) + { return ! (plane.oriented_side(p_max) == ON_NEGATIVE_SIDE || plane.oriented_side(p_min) == ON_POSITIVE_SIDE); } @@ -114,17 +115,19 @@ bool do_intersect_plane_box(const typename K::Plane_3& plane, } template -bool do_intersect(const typename K::Plane_3& plane, - const typename K::Iso_cuboid_3& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Plane_3& plane, + const typename K::Iso_cuboid_3& bbox, + const K& k) { return do_intersect_plane_box(plane, bbox, k); } template -bool do_intersect(const typename K::Iso_cuboid_3& bbox, - const typename K::Plane_3& plane, - const K& k) +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Plane_3& plane, + const K& k) { return do_intersect_plane_box(plane, bbox, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Point_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Point_3_do_intersect.h index bafe971d903..32d01b5526a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Point_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Point_3_do_intersect.h @@ -19,7 +19,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Iso_cuboid_3& iso, const K& k) @@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Iso_cuboid_3& iso, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h index e467d7ea327..0ef4a7ec6f6 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Ray_3_do_intersect.h @@ -20,16 +20,17 @@ #include // for CGAL::internal::do_intersect_bbox_segment_aux -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf namespace CGAL { namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Ray_3& ray, - const typename K::Iso_cuboid_3& ic, - const K&) +typename K::Boolean +do_intersect(const typename K::Ray_3& ray, + const typename K::Iso_cuboid_3& ic, + const K&) { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -51,9 +52,11 @@ bool do_intersect(const typename K::Ray_3& ray, } template -bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Ray_3& ray, - const K& k) { +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Ray_3& ray, + const K& k) +{ return do_intersect(ray, ic, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h index 3c42487730f..5118e44a6fd 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Segment_3_do_intersect.h @@ -14,7 +14,7 @@ #ifndef CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H #define CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H -// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// inspired from https://people.csail.mit.edu/amy/papers/box-jgt.pdf #include // for CGAL::internal::do_intersect_bbox_segment_aux @@ -24,9 +24,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Segment_3& seg, - const typename K::Iso_cuboid_3& ic, - const K&) +typename K::Boolean +do_intersect(const typename K::Segment_3& seg, + const typename K::Iso_cuboid_3& ic, + const K&) { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -48,9 +49,10 @@ bool do_intersect(const typename K::Segment_3& seg, } template -bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Segment_3& seg, - const K& k) +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Segment_3& seg, + const K& k) { return do_intersect(seg, ic, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h index f6090ba7cbf..a9ef6c3a50a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Sphere_3_do_intersect.h @@ -22,10 +22,11 @@ namespace Intersections { namespace internal { template // Iso_cuboid_3 or Bbox_3 -bool do_intersect_sphere_box_3(const typename K::Sphere_3& sphere, - const BFT bxmin, const BFT bymin, const BFT bzmin, - const BFT bxmax, const BFT bymax, const BFT bzmax, - const K&) +typename K::Boolean +do_intersect_sphere_box_3(const typename K::Sphere_3& sphere, + const BFT bxmin, const BFT bymin, const BFT bzmin, + const BFT bxmax, const BFT bymax, const BFT bzmax, + const K&) { typedef typename K::FT SFT; typedef typename Coercion_traits::Type FT; @@ -94,9 +95,10 @@ bool do_intersect_sphere_box_3(const typename K::Sphere_3& sphere, } template -bool do_intersect(const typename K::Sphere_3& sphere, - const typename K::Iso_cuboid_3& ic, - const K& k) +typename K::Boolean +do_intersect(const typename K::Sphere_3& sphere, + const typename K::Iso_cuboid_3& ic, + const K& k) { return do_intersect_sphere_box_3(sphere, (ic.min)().x(), (ic.min)().y(), (ic.min)().z(), @@ -105,9 +107,10 @@ bool do_intersect(const typename K::Sphere_3& sphere, } template -bool do_intersect(const typename K::Iso_cuboid_3& ic, - const typename K::Sphere_3& sphere, - const K& k) +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& ic, + const typename K::Sphere_3& sphere, + const K& k) { return do_intersect(sphere, ic, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h index 723ef269306..6974c72ebad 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h @@ -21,26 +21,25 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Triangle_3& triangle, - const typename K::Iso_cuboid_3& bbox, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& triangle, + const typename K::Iso_cuboid_3& bbox, + const K& k) { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } template -bool do_intersect(const typename K::Iso_cuboid_3& bbox, - const typename K::Triangle_3& triangle, - const K& k) +typename K::Boolean +do_intersect(const typename K::Iso_cuboid_3& bbox, + const typename K::Triangle_3& triangle, + const K& k) { return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); } } // namespace internal } // namespace Intersections - - - } // namespace CGAL #endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Line_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Line_3_do_intersect.h index 5da82672621..43a161c9c3f 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Line_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Line_3_do_intersect.h @@ -18,7 +18,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean do_intersect(const typename K::Line_3& l1, const typename K::Line_3& l2, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_do_intersect.h index 2dc5b2122cd..72ead862807 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Plane_3_do_intersect.h @@ -21,7 +21,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean do_intersect(const typename K::Plane_3& plane, const typename K::Line_3& line, const K&) @@ -48,7 +48,7 @@ do_intersect(const typename K::Plane_3& plane, template inline -bool +typename K::Boolean do_intersect(const typename K::Line_3& line, const typename K::Plane_3& plane, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Point_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Point_3_do_intersect.h index b4a0cf92113..a4407eb7f16 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Point_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Point_3_do_intersect.h @@ -18,7 +18,7 @@ namespace Intersections { namespace internal { template -inline bool +inline typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Line_3& line, const K& k) @@ -27,7 +27,7 @@ do_intersect(const typename K::Point_3& pt, } template -inline bool +inline typename K::Boolean do_intersect(const typename K::Line_3& line, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h index e6e125107f0..f4aa1e8e37c 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h @@ -23,7 +23,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Line_3& l, const typename K::Ray_3& r, const K& k) @@ -47,7 +47,7 @@ do_intersect(const typename K::Line_3& l, template inline -bool +typename K::Boolean do_intersect(const typename K::Ray_3& r, const typename K::Line_3& l, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Segment_3_do_intersect.h index d03d33e76e7..d080ac11279 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Segment_3_do_intersect.h @@ -24,7 +24,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Line_3& l, const typename K::Segment_3& s, const K& k) @@ -52,7 +52,7 @@ do_intersect(const typename K::Line_3& l, template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_3& s, const typename K::Line_3& l, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h index 4b2635a3153..a5b5dd1fc76 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Triangle_3_do_intersect.h @@ -21,9 +21,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Triangle_3& t, - const typename K::Line_3& l, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& t, + const typename K::Line_3& l, + const K& k) { CGAL_kernel_precondition(!k.is_degenerate_3_object()(t)); CGAL_kernel_precondition(!k.is_degenerate_3_object()(l)); @@ -73,9 +74,10 @@ bool do_intersect(const typename K::Triangle_3& t, template inline -bool do_intersect(const typename K::Line_3& l, - const typename K::Triangle_3& t, - const K& k) +typename K::Boolean + do_intersect(const typename K::Line_3& l, + const typename K::Triangle_3& t, + const K& k) { return do_intersect(t, l, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_do_intersect.h index 2884506fc20..05ff652ccfa 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_Plane_3_do_intersect.h @@ -23,7 +23,7 @@ namespace Intersections { namespace internal { template -inline bool +inline typename K::Boolean do_intersect(const typename K::Plane_3& plane1, const typename K::Plane_3& plane2, const typename K::Plane_3& plane3, diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_do_intersect.h index fc984e41dcf..cf39bbe2c41 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Plane_3_do_intersect.h @@ -20,7 +20,7 @@ namespace Intersections { namespace internal { template -inline bool +inline typename K::Boolean do_intersect(const typename K::Plane_3& plane1, const typename K::Plane_3& plane2, const K&) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Point_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Point_3_do_intersect.h index f53221b5700..d3798d69b6b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Point_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Point_3_do_intersect.h @@ -18,7 +18,7 @@ namespace Intersections { namespace internal { template -inline bool +inline typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Plane_3& plane, const K& k) @@ -27,7 +27,7 @@ do_intersect(const typename K::Point_3& pt, } template -inline bool +inline typename K::Boolean do_intersect(const typename K::Plane_3& plane, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Ray_3_do_intersect.h index d254bc3f367..f57d4f9d25a 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Ray_3_do_intersect.h @@ -25,7 +25,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean do_intersect(const typename K::Plane_3& plane, const typename K::Ray_3& ray, const K& k) @@ -40,7 +40,7 @@ do_intersect(const typename K::Plane_3& plane, template inline -bool +typename K::Boolean do_intersect(const typename K::Ray_3& ray, const typename K::Plane_3& plane, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Segment_3_do_intersect.h index 581a9cfa9a8..509ef49ecee 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Segment_3_do_intersect.h @@ -20,7 +20,7 @@ namespace Intersections { namespace internal { template -bool +typename K::Boolean do_intersect(const typename K::Plane_3& plane, const typename K::Segment_3& seg, const K&) @@ -41,7 +41,7 @@ do_intersect(const typename K::Plane_3& plane, template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_3& seg, const typename K::Plane_3& plane, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Sphere_3_do_intersect.h index df7b7c738ae..9f1e51f8686 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Sphere_3_do_intersect.h @@ -21,7 +21,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Plane_3& p, const typename K::Sphere_3& s, const K&) @@ -37,7 +37,7 @@ do_intersect(const typename K::Plane_3& p, template inline -bool +typename K::Boolean do_intersect(const typename K::Sphere_3& s, const typename K::Plane_3& p, const K&) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h index 2d7cd516900..ea0462dadd6 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Plane_3_Triangle_3_do_intersect.h @@ -21,9 +21,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Triangle_3& t, - const typename K::Plane_3& h, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& t, + const typename K::Plane_3& h, + const K& k) { CGAL_kernel_precondition(!k.is_degenerate_3_object()(t)); CGAL_kernel_precondition(!k.is_degenerate_3_object()(h)); @@ -49,9 +50,10 @@ bool do_intersect(const typename K::Triangle_3& t, template inline -bool do_intersect(const typename K::Plane_3& h, - const typename K::Triangle_3& t, - const K& k) +typename K::Boolean +do_intersect(const typename K::Plane_3& h, + const typename K::Triangle_3& t, + const K& k) { return do_intersect(t, h, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Ray_3_do_intersect.h index 0aec93a129c..69f75948f8b 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Ray_3_do_intersect.h @@ -19,7 +19,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Ray_3& ray, const K& k) @@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Ray_3& ray, const typename K::Point_3& pt, const K& k) @@ -39,7 +39,7 @@ do_intersect(const typename K::Ray_3& ray, template -bool +typename K::Boolean Ray_3_has_on_collinear_Point_3(const typename K::Ray_3& r, const typename K::Point_3& p, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Segment_3_do_intersect.h index 2872694d6af..fa54c9bbaba 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Segment_3_do_intersect.h @@ -19,7 +19,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Segment_3& seg, const K& k) @@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_3& seg, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Sphere_3_do_intersect.h index d825e2ff820..e9734dfdb23 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Sphere_3_do_intersect.h @@ -19,7 +19,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Sphere_3& sphere, const K& k) @@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Sphere_3& sphere, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Tetrahedron_3_do_intersect.h index 0518a305073..b22ffc8d0a2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Tetrahedron_3_do_intersect.h @@ -19,7 +19,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Point_3& pt, const typename K::Tetrahedron_3& tetrahedron, const K& k) @@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt, template inline -bool +typename K::Boolean do_intersect(const typename K::Tetrahedron_3& tetrahedron, const typename K::Point_3& pt, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h index a116b4617a9..f22d551e842 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Point_3_Triangle_3_do_intersect.h @@ -21,9 +21,10 @@ namespace Intersections { namespace internal { template -bool do_intersect(const typename K::Triangle_3& t, - const typename K::Point_3& p, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& t, + const typename K::Point_3& p, + const K& k) { CGAL_kernel_precondition(!k.is_degenerate_3_object()(t)); @@ -68,9 +69,10 @@ bool do_intersect(const typename K::Triangle_3& t, } template -bool do_intersect(const typename K::Point_3& p, - const typename K::Triangle_3& t, - const K& k) +typename K::Boolean +do_intersect(const typename K::Point_3& p, + const typename K::Triangle_3& t, + const K& k) { return do_intersect(t, p, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Ray_3_do_intersect.h index cf334475335..5ceb8e0eeb9 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Ray_3_do_intersect.h @@ -24,7 +24,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Ray_3& r1, const typename K::Ray_3& r2, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Segment_3_do_intersect.h index bf57d977f0c..72d4ceec703 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Segment_3_do_intersect.h @@ -24,7 +24,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_3& s, const typename K::Ray_3& r, const K& k) @@ -56,7 +56,7 @@ do_intersect(const typename K::Segment_3& s, template inline -bool +typename K::Boolean do_intersect(const typename K::Ray_3& r, const typename K::Segment_3& s, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h index f0d6ea725d3..d349c2616e2 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Ray_3_Triangle_3_do_intersect.h @@ -328,18 +328,20 @@ do_intersect(const typename K::Triangle_3& t, } template -bool do_intersect(const typename K::Triangle_3& t, - const typename K::Ray_3& r, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& t, + const typename K::Ray_3& r, + const K& k) { return do_intersect(t, r, k, r3t3_do_intersect_empty_visitor()); } template inline -bool do_intersect(const typename K::Ray_3& r, - const typename K::Triangle_3& t, - const K& k) +typename K::Boolean +do_intersect(const typename K::Ray_3& r, + const typename K::Triangle_3& t, + const K& k) { return do_intersect(t, r, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_do_intersect.h index 5943325975b..db3b01bffb9 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Segment_3_do_intersect.h @@ -23,7 +23,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Segment_3& s1, const typename K::Segment_3& s2, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h index 70c0f3e0813..23fc5d897f4 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Segment_3_Triangle_3_do_intersect.h @@ -25,7 +25,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A, const typename K::Point_3& B, const typename K::Point_3& C, const typename K::Point_3& p, - const typename K::Point_3& q, const K& k) + const typename K::Point_3& q, + const K& k) { typedef typename K::Point_3 Point_3; @@ -173,9 +174,10 @@ bool do_intersect_coplanar(const typename K::Triangle_3& t, } template -bool do_intersect(const typename K::Triangle_3& t, - const typename K::Segment_3& s, - const K& k) +typename K::Boolean +do_intersect(const typename K::Triangle_3& t, + const typename K::Segment_3& s, + const K& k) { CGAL_kernel_precondition(!k.is_degenerate_3_object()(t) ); CGAL_kernel_precondition(!k.is_degenerate_3_object()(s) ); @@ -269,9 +271,10 @@ bool do_intersect(const typename K::Triangle_3& t, template inline -bool do_intersect(const typename K::Segment_3& s, - const typename K::Triangle_3& t, - const K& k) +typename K::Boolean +do_intersect(const typename K::Segment_3& s, + const typename K::Triangle_3& t, + const K& k) { return do_intersect(t, s, k); } diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Sphere_3_Sphere_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Sphere_3_Sphere_3_do_intersect.h index 52976148c05..b7bf1a8e5c0 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Sphere_3_Sphere_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Sphere_3_Sphere_3_do_intersect.h @@ -21,7 +21,7 @@ namespace internal { template inline -bool +typename K::Boolean do_intersect(const typename K::Sphere_3& s1, const typename K::Sphere_3& s2, const K& k) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h index 272a07da6c0..49bc573489e 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Triangle_3_intersection.h @@ -15,8 +15,7 @@ #ifndef CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_INTERSECTIONS_H #define CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_TRIANGLE_3_INTERSECTIONS_H -#include -#include +#include #include @@ -25,260 +24,12 @@ #include #include #include +#include namespace CGAL { namespace Intersections { namespace internal { -template -void filter_segments(std::list& segments) -{ - auto are_equal = [](const Segment& l, const Segment& r) -> bool - { - return (l == r || l == r.opposite()); - }; - - auto it = std::unique(segments.begin(), segments.end(), are_equal); - segments.erase(it, segments.end()); -} - -// plane going through the ref segment's source, a point above (given by the normal of the input -// triangle) and two points (ref_other / query) that need to be ordered -template -bool first_comes_first_pt(const typename K::Point_3& ref_source, - const typename K::Point_3& ref_z, - const typename K::Point_3& ref_other, - const typename K::Point_3& query, - const K& k) -{ - typename K::Orientation_3 orientation = k.orientation_3_object(); - - // points have filtered to remove segments' extremities - CGAL_precondition(ref_other != query); - - const Orientation o = orientation(ref_source, ref_z, ref_other, query); - CGAL_assertion(o != COPLANAR); - - // ref_other comes first <==> query is on the positive side of the plane - return (o == POSITIVE); -} - -template -bool first_comes_first(const typename K::Point_3& ref_source, - const typename K::Point_3& ref_z, - const typename K::Point_3& ref_other, - const SegPtVariant& seg_or_pt, - const K& k) -{ - typedef typename K::Point_3 Point_3; - typedef typename K::Segment_3 Segment_3; - - typedef typename std::list::iterator SCI; - typedef typename std::vector::iterator PCI; - - if(seg_or_pt.which() == 0) - { - const Segment_3& s = *(boost::get(seg_or_pt)); - return first_comes_first_pt(ref_source, ref_z, ref_other, s.source(), k); - } - else - { - CGAL_assertion(seg_or_pt.which() == 1); - - const Point_3& p = *(boost::get(seg_or_pt)); - return first_comes_first_pt(ref_source, ref_z, ref_other, p, k); - } -} - -template -typename Intersection_traits::result_type -build_intersection(const typename K::Tetrahedron_3& /*input_tetrahedron*/, - const typename K::Triangle_3& input_triangle, - PointContainer& points, - SegmentContainer& segments, - const K& k) -{ - typedef typename Intersection_traits::result_type result_type; - - typedef typename K::Point_3 Point_3; - typedef typename K::Segment_3 Segment_3; - typedef typename K::Vector_3 Vector_3; - typedef typename K::Triangle_3 Triangle_3; - typedef std::vector Poly; - - typedef typename SegmentContainer::iterator SCI; - typedef typename PointContainer::iterator PCI; - - // @todo? Could do the 1 segment case with this code too... - CGAL_precondition(segments.size() >= 2 && segments.size() <= 4); - CGAL_precondition(points.size() <= 2); - - // Constructions @fixme avoidable? - const Vector_3 input_triangle_normal = input_triangle.supporting_plane().orthogonal_vector(); - - // remove points that are just segments extremities - auto is_extremity = [&segments](const Point_3& p) -> bool - { - for(const Segment_3& s : segments) - if(p == s.source() || p == s.target()) - return true; - return false; - }; - points.erase(std::remove_if(points.begin(), points.end(), is_extremity), - points.end()); - - // Take the first segment as reference, and order the rest to form a convex polygon - // - // All segments and points involved in the intersection are on the input triangle - // and thus everything is coplanar, at least theoretically (the kernel might not provide - // exact constructions...) - // - // Given an arbitrary segment, the code below sorts the other segments and the points - // in a ccw order. Using a vector because the number of segments and points is bounded - // (max 4 segments and max 2 points) so even if the linear insertion is a little ugly, - // it is not expensive anyway. - // - // Example: - /* - x p0 - - / - / - s1 / \ s2 - / \ - -------------- - s0 - */ - // - // s0 is chosen as the reference segment - // output will be 's0 s2 p0 s1' - - Segment_3& ref_s = segments.front(); - Point_3 ref_z = ref_s.source() + input_triangle_normal; - - // The reference segment should be such that all other intersection parts are - // on the positive side of the plane described by the normal of the triangle and ref_s - bool swapped = false; - for(SCI slit = std::next(segments.begin()); slit != segments.end(); ++slit) - { - const Segment_3& other = *slit; - - if(k.orientation_3_object()(ref_s.source(), ref_z, ref_s.target(), other.source()) == CGAL::NEGATIVE || - k.orientation_3_object()(ref_s.source(), ref_z, ref_s.target(), other.target()) == CGAL::NEGATIVE) - { - ref_s = ref_s.opposite(); - ref_z = ref_s.source() + input_triangle_normal; - swapped = true; - break; - } - } - - if(!swapped) - { - for(PCI plit = points.begin(); plit != points.end(); ++plit) - { - const Point_3& other = *plit; - if(k.orientation_3_object()(ref_s.source(), ref_z, ref_s.target(), other) == CGAL::NEGATIVE) - { - swapped = true; - ref_s = ref_s.opposite(); - ref_z = ref_s.source() + input_triangle_normal; - break; - } - } - } - - const Point_3& ref_sp = ref_s.source(); - const Point_3& ref_tp = ref_s.target(); - - // Now, order the other parts of the intersection - std::list > res_elements; // iterators to the points/segments - res_elements.emplace_back(segments.begin()); - - for(SCI slit = std::next(segments.begin()); slit != segments.end(); ++slit) - { - // first, check if the segment is well oriented, meaning its source comes before its target (ccwly) - Segment_3& curr_s = *slit; - - if(curr_s.source() == ref_sp || curr_s.target() == ref_tp) // consecutive segments must have consistent orientation - { - curr_s = curr_s.opposite(); - } - else if(curr_s.source() == ref_tp || curr_s.target() == ref_sp) - { - // nothing to do here as we know that sp&tp are on the positive side of (normal, ref_s) - } - else if(first_comes_first_pt(ref_sp, ref_z, curr_s.target(), curr_s.source(), k)) - { - curr_s = curr_s.opposite(); - } - - // Find where the current segment fit in the final polygon intersection - for(auto rit = std::next(res_elements.begin()); ; ++rit) - { - // always pick the current segment's source to ensure ref_source != ref_other - if(rit == res_elements.end() || first_comes_first(ref_sp, ref_z, curr_s.source(), *rit, k)) - { - res_elements.insert(rit, slit); - break; - } - } - } - - for(PCI plit = points.begin(); plit != points.end(); ++plit) - { - const Point_3& curr_p = *plit; - - // Find where the current point fits in the boundary of the polygon intersection - for(auto rit = std::next(res_elements.begin()); ; ++rit) - { - if(rit == res_elements.end() || first_comes_first(ref_sp, ref_z, curr_p, *rit, k)) - { - res_elements.insert(rit, plit); - break; - } - } - } - - CGAL_postcondition(res_elements.size() == points.size() + segments.size()); - - // Concatenate points to create the polygonal output - Poly res; - for(const boost::variant& e : res_elements) - { - if(const SCI* sci = boost::get(&e)) - { - const Segment_3& s = **sci; - - if(res.empty() || s.source() != res.back()) // common extremity for consecutive segments - res.push_back(s.source()); - if(res.empty() || s.target() != res.front()) - res.push_back(s.target()); - } - else if(const PCI* pci = boost::get(&e)) - { - res.push_back(**pci); - } - else - { - CGAL_assertion(false); - } - } - - CGAL_assertion(std::set(res.begin(), res.end()).size() == res.size()); - CGAL_assertion(res.size() >= 3); - - if(res.size() == 3) - { - Triangle_3 tr { res[0], res[1], res[2] }; - return result_type(std::forward(tr)); - } - else - { - return result_type(std::forward(res)); - } -} - template typename Intersection_traits::result_type intersection(const typename K::Tetrahedron_3& tet, @@ -286,319 +37,131 @@ intersection(const typename K::Tetrahedron_3& tet, const K& k) { typedef typename Intersection_traits::result_type result_type; - typedef typename Intersection_traits::result_type Inter_type; CGAL_precondition(!tet.is_degenerate()); CGAL_precondition(!tr.is_degenerate()); typedef typename K::Point_3 Point_3; - typedef typename K::Segment_3 Segment_3; - typedef typename K::Triangle_3 Triangle_3; - typedef std::vector Poly; + typedef typename K::Plane_3 Plane_3; - typename K::Bounded_side_3 bounded_side = k.bounded_side_3_object(); + typename K::Construct_plane_3 plane = k.construct_plane_3_object(); typename K::Construct_vertex_3 vertex = k.construct_vertex_3_object(); typename K::Construct_triangle_3 triangle = k.construct_triangle_3_object(); + typename K::Construct_segment_3 segment = k.construct_segment_3_object(); + typename K::Construct_line_3 line = k.construct_line_3_object(); + typename K::Oriented_side_3 oriented_side = k.oriented_side_3_object(); + typename K::Orientation_3 orientation = k.orientation_3_object(); - std::vector vertex_sides(3); - std::vector points; - int inside_points = 0; - int strictly_inside_points = 0; + std::vector res = { vertex(tr,0), vertex(tr,1), vertex(tr,2) }; + std::vector> supporting_planes(3); // bitset used to indicate when a point is on a plane - for(int i=0; i<3; ++i) + // iteratively clip `tr` with the halfspaces whose intersection form `tet` + static constexpr std::array vids = { 1,2,3, 0,3,2, 0,1,3, 1,0,2 }; + const bool tet_ori_positive = (orientation(tet)==POSITIVE); + for (int pid=0; pid<4; ++pid) { - vertex_sides[i] = bounded_side(tet, vertex(tr, i)); + Plane_3 pl = tet_ori_positive + ? plane(vertex(tet, vids[pid*3]), vertex(tet, vids[pid*3+2]),vertex(tet, vids[pid*3+1])) + : plane(vertex(tet, vids[pid*3]), vertex(tet, vids[pid*3+1]),vertex(tet, vids[pid*3+2])); + CGAL_assertion(oriented_side(pl, vertex(tet,pid))==ON_POSITIVE_SIDE); - if(vertex_sides[i] != ON_UNBOUNDED_SIDE) - ++inside_points; - - if(vertex_sides[i] == ON_BOUNDED_SIDE) + std::vector current; + std::vector> current_sp; + std::vector orientations(res.size()); + for (std::size_t i=0; i segments; - std::vector seg_ids; - for(std::size_t i = 0; i < 4; ++i) + orientations[i]=oriented_side(pl, res[i]); + if (orientations[i]==ON_ORIENTED_BOUNDARY) { - const Triangle_3 face = triangle(vertex(tet, (i+1)%4), - vertex(tet, (i+2)%4), - vertex(tet, (i+3)%4)); - intersections[i] = intersection(tr, face, k); - if(intersections[i]) + supporting_planes[i].set(pid); + //workaround for kernels with inexact constructions + //-- + if (supporting_planes[i].count()==3) { - // a face is inside the input tr - if(const Triangle_3* t = boost::get(&*intersections[i])) + for (int b=0; i<4; ++b) { - Triangle_3 res = *t; - return result_type(std::forward(res)); - } - else if(const Segment_3* s = boost::get(&*intersections[i])) - { - // get segs and pts to construct poly - segments.push_back(*s); - seg_ids.push_back(i); - } - else if(const Point_3* p = boost::get(&*intersections[i])) - { - points.push_back(*p); - } - else if(const Poly* p = boost::get(&*intersections[i])) - { - // the input triangle is in the supporting plane of a tet face, return the poly. - Poly res = *p; - return result_type(std::forward(res)); + if (!supporting_planes[i].test(b)) + { + res[i] = vertex(tet, b); + break; + } } } - } - - if(segments.size() > 1) - filter_segments(segments); - - // no segments and no inside points, there can still be an intersecting (tet vertex on - // an edge|face of the triangle) - if(segments.empty()) - { - if(points.empty()) - return result_type(); - - return result_type(std::forward(points.front())); - } - else if(segments.size() == 1) - { - // adjacency to an edge, return resulting segment. - return result_type(segments.front()); - } - else if(segments.size() > 1) - { - return build_intersection(tet, tr, points, segments, k); + //-- } } - break; - case 1: - case 2: // 1 or 2 inside points + + for (std::size_t i=0; i segments; - for(std::size_t i = 0; i < 4; ++i) + const bool test_segment = i!=1 || res.size()!=2; + std::size_t j = (i+1)%res.size(); + switch(orientations[j]) { - const Triangle_3 face = triangle(vertex(tet, (i+1)%4), - vertex(tet, (i+2)%4), - vertex(tet, (i+3)%4)); - intersections[i] = intersection(tr, face, k); - if(intersections[i]) - { - if(const Triangle_3* t = boost::get(&*intersections[i])) + case ON_POSITIVE_SIDE: + if (test_segment && orientations[i]==ON_NEGATIVE_SIDE) { - Triangle_3 res = *t; - return result_type(std::forward(res)); - } - else if(const Segment_3* s = boost::get(&*intersections[i])) - { - segments.push_back(*s); - } - else if(const Point_3* p = boost::get(&*intersections[i])) - { - points.push_back(*p); - } - else if(const Poly* p = boost::get(&*intersections[i])) - { - // the input is in a supporting plane of a face - Poly res = *p; - return result_type(std::forward(res)); - } - } - } - - if(segments.size() > 1) - filter_segments(segments); - - switch(segments.size()) - { - case 0: - { - // there can only be one point of contact, otherwise by convexity - // there would be a full segment on a face (interior segment isn't possible either - // because there are at most 2 inside points and an interior segment would also - // yield at least a segment on the boundary) - return result_type(std::forward(points.front())); - } - case 1: // 1 segment - { - const Segment_3& s = segments.front(); - - if(strictly_inside_points == 1) - { - // Doesn't matter whether there is another (non-strictly) inside point: if there is, - // it is an extremity of the segment - - const int str_inside_pt_pos = - int(std::find(vertex_sides.begin(), vertex_sides.end(), ON_BOUNDED_SIDE) - vertex_sides.begin()); - CGAL_assertion(str_inside_pt_pos >= 0 && str_inside_pt_pos < 3); - - Triangle_3 res_tr = triangle(vertex(tr, str_inside_pt_pos), s.source(), s.target()); - return result_type(std::forward(res_tr)); - } - else if(strictly_inside_points == 2) - { - CGAL_assertion(inside_points == 2); // can't be 3 since we're in the 1&2 switch - - Poly res(4); - - // Grab the 2 strictly inside points - int id = 0; - for(int i=0; i<3; ++i) - if(vertex_sides[i] == ON_BOUNDED_SIDE) - res[id++] = vertex(tr, i); - - CGAL_assertion(id == 2); - - if((res[0] - res[1]) * (s.source() - s.target()) > 0) + current_sp.push_back(supporting_planes[i] & supporting_planes[j]); + current_sp.back().set(pid); + if (current_sp.back().count()==3) { - res[2] = s.target(); - res[3] = s.source(); + for (int b=0; i<4; ++b) + if (!current_sp.back().test(b)) + { + current.push_back(vertex(tet, b)); + break; + } } else - { - res[3] = s.target(); - res[2] = s.source(); - } - - return result_type(std::forward(res)); + current.push_back(*CGAL::Intersections::internal::intersection_point(pl, line(res[i], res[j]), k)); } - else if(inside_points == 1) // 1 point on the boundary + current.push_back(res[j]); + current_sp.push_back(supporting_planes[j]); + break; + case ON_NEGATIVE_SIDE: + if (test_segment && orientations[i]==ON_POSITIVE_SIDE) { - CGAL_assertion(strictly_inside_points == 0); - - // Grab the inside point - const int boundary_pt_pos = - int(std::find(vertex_sides.begin(), vertex_sides.end(), ON_BOUNDARY) - vertex_sides.begin()); - CGAL_assertion(boundary_pt_pos >= 0 && boundary_pt_pos < 3); - - const Point_3& boundary_pt = vertex(tr, boundary_pt_pos); - if(boundary_pt == s.source() || boundary_pt == s.target()) + current_sp.push_back(supporting_planes[i] & supporting_planes[j]); + current_sp.back().set(pid); + if (current_sp.back().count()==3) { - return result_type(s); + for (int b=0; i<4; ++b) + if (!current_sp.back().test(b)) + { + current.push_back(vertex(tet, b)); + break; + } } else - { - Triangle_3 res_tr = triangle(boundary_pt, s.source(), s.target()); - return result_type(std::forward(res_tr)); - } + current.push_back(*CGAL::Intersections::internal::intersection_point(pl, line(res[i], res[j]), k)); } - else // 2 points on the boundary - { - CGAL_assertion(inside_points == 2 && strictly_inside_points == 0); - - // 2 boundary points and 1 segment, have to distinguish between cases - // depending on if the extremities of the segment are triangle extremities - - std::array boundary_pts; - std::array is_boundary_point_an_extremity; - - // Grab the inside points - std::size_t id = 0; - for(int i=0; i<3; ++i) - { - if(vertex_sides[i] == ON_BOUNDARY) - { - boundary_pts[id] = i; - - if(vertex(tr, i) == s.source()) - is_boundary_point_an_extremity[id] = true; - else if(vertex(tr, i) == s.target()) - is_boundary_point_an_extremity[id] = true; - else - is_boundary_point_an_extremity[id] = false; - - ++id; - } - } - - CGAL_assertion(id == 2); - - if(is_boundary_point_an_extremity[0]) - { - if(is_boundary_point_an_extremity[1]) - { - // the segment is composed of the two boundary points - return result_type(s); - } - else // only boundary_pts[0] is an extremity - { - Triangle_3 res_tr = triangle(s.source(), s.target(), vertex(tr, boundary_pts[1])); - return result_type(std::forward(res_tr)); - } - } - else // boundary_pts[0] is not an extremity - { - if(is_boundary_point_an_extremity[1]) // only boundary_pts[1] is an extremity - { - Triangle_3 res_tr = triangle(s.source(), s.target(), vertex(tr, boundary_pts[0])); - return result_type(std::forward(res_tr)); - } - else // neither boundary points are extremities - { - Poly res(4); - res[0] = vertex(tr, boundary_pts[0]); - res[1] = vertex(tr, boundary_pts[1]); - - if((res[0] - res[1]) * (s.source() - s.target()) > 0) - { - res[2] = s.target(); - res[3] = s.source(); - } - else - { - res[3] = s.target(); - res[2] = s.source(); - } - - return result_type(std::forward(res)); - } - } - } - - CGAL_assertion(false); - } - break; - // 2 or 3 segments (and 1 or 2 inside points) - case 2: - case 3: - case 4: - { - // @todo do that for a single segment too? - return build_intersection(tet, tr, points, segments, k); - } - break; + break; default: - // can't have more than 4 segments (1 per tet face) - CGAL_assertion(false); - break; + { + CGAL_assertion(supporting_planes[j].test(pid)); + current.push_back(res[j]); + current_sp.push_back(supporting_planes[j]); + } } } - break; + res.swap(current); + supporting_planes.swap(current_sp); - case 3: - { - // the input triangle is entirely contained within the tetrahedron - return result_type(tr); - } - break; - default: - CGAL_assertion(false); // never happens (only 3 pts in a tr) - break; + if (res.empty()) + return boost::none; } - return result_type(); + switch(res.size()) + { + case 1: + return result_type(res[0]); + case 2: + return result_type(segment(res[0], res[1])); + case 3: + return result_type(triangle(res[0], res[1], res[2])); + default: + return result_type(res); + } } template diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h index ce993540138..0ab18e3e0c8 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_do_intersect.h @@ -22,13 +22,14 @@ namespace Intersections { namespace internal { template -bool _intersection_test_vertex(const typename K::Point_3* p, - const typename K::Point_3* q, - const typename K::Point_3* r, - const typename K::Point_3* a, - const typename K::Point_3* b, - const typename K::Point_3* c, - const K& k) +typename K::Boolean +_intersection_test_vertex(const typename K::Point_3* p, + const typename K::Point_3* q, + const typename K::Point_3* r, + const typename K::Point_3* a, + const typename K::Point_3* b, + const typename K::Point_3* c, + const K& k) { CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*p,*q,*r) == POSITIVE); CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*a,*b,*c) == POSITIVE); @@ -64,13 +65,14 @@ bool _intersection_test_vertex(const typename K::Point_3* p, } template -bool _intersection_test_edge(const typename K::Point_3* p, - const typename K::Point_3* q, - const typename K::Point_3* r, - const typename K::Point_3* a, - const typename K::Point_3* CGAL_kernel_precondition_code(b), - const typename K::Point_3* c, - const K& k) +typename K::Boolean +_intersection_test_edge(const typename K::Point_3* p, + const typename K::Point_3* q, + const typename K::Point_3* r, + const typename K::Point_3* a, + const typename K::Point_3* CGAL_kernel_precondition_code(b), + const typename K::Point_3* c, + const K& k) { CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*p,*q,*r) == POSITIVE); CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*a,*b,*c) == POSITIVE); @@ -97,9 +99,10 @@ bool _intersection_test_edge(const typename K::Point_3* p, } template -bool do_intersect_coplanar(const typename K::Triangle_3& t1, - const typename K::Triangle_3& t2, - const K& k) +typename K::Boolean +do_intersect_coplanar(const typename K::Triangle_3& t1, + const typename K::Triangle_3& t2, + const K& k) { typedef typename K::Point_3 Point_3; diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 29debe09068..152926c2d96 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -11,8 +11,6 @@ // Author(s) : Stephane Tayeb // -#include - #include #if defined(BOOST_MSVC) @@ -22,17 +20,19 @@ // leda_rational, or Gmpq, or Quotient typedef CGAL::Exact_rational Rational; + #include #include #include #include #include #include - -#include +#include #include // for nextafter +#include +#include double random_in(const double a, const double b) @@ -378,7 +378,7 @@ bool test(bool exact_kernel = false) typedef typename K::Triangle_3 Triangle; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - CGAL::Bbox_3 bbox(1.0,1.0,1.0,10.0,50.0,100.0); + CGAL::Bbox_3 bbox(1.0,1.0,1.0, 10.0,50.0,100.0); Point p1(FT(0.), FT(0.), FT(0.)); Point p2(FT(0.), FT(100.), FT(100.)); @@ -559,7 +559,10 @@ bool test(bool exact_kernel = false) Triangle tABC(pA,pB,pC); Triangle t1(Point(1,1,1),Point(0,0,0),Point(0,0,1)); Triangle t2(Point(4,1,7),Point(8,1,99),Point(7,1,11)); - Triangle t3(Point(0,1,1),Point(0,0,0),Point(0,0,1)); + // triangles completely to the left side of the cube + Triangle t3(Point(0, 1, 1), Point(0, 0, 0), Point(0, 0, 1)); // parallel to the left side + Triangle t4(Point(-1, 3, 2), Point(0, 2, 2), Point(0, 3, 2)); // projection inside the left side + Triangle t5(Point(-1, 3, 2), Point(0, 1, 2), Point(0, 3, -1)); // projection with one point outside of the left side b &= test_aux(t123,"t123",bbox,true); b &= test_aux(t124,"t124",bbox,true); @@ -569,6 +572,9 @@ bool test(bool exact_kernel = false) b &= test_aux(t1,"t1",bbox,true); b &= test_aux(t2,"t2",bbox,true); b &= test_aux(t3,"t3",bbox,false); + b &= test_aux(t4,"t4",bbox,false); + b &= test_aux(t5,"t5",bbox, false); + b &= test_aux(t123,"t123",Iso_cuboid_3(bbox),true); b &= test_aux(t124,"t124",Iso_cuboid_3(bbox),true); diff --git a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp index 9b5490c0164..6fe55a40654 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp @@ -339,12 +339,15 @@ public: { P tet0 = random_point(), tet1 = random_point(), tet2 = random_point(), tet3 = random_point(); - const Tet tet(tet0, tet1, tet2, tet3); + Tet tet(tet0, tet1, tet2, tet3); if(tet.is_degenerate()) continue; - P l0 = tet0 - CGAL::cross_product(V(tet0, tet1), V(tet0, tet2)); - P l1 = tet3 + CGAL::cross_product(V(tet3, tet1), V(tet3, tet2)); + if(tet.orientation() == CGAL::NEGATIVE) + tet = Tet(tet1, tet0, tet2, tet3); + + P l0 = tet[0] - CGAL::cross_product(V(tet[0], tet[1]), V(tet[0], tet[2])); + P l1 = tet[3] + CGAL::cross_product(V(tet[3], tet[1]), V(tet[3], tet[2])); assert(tet.has_on_unbounded_side(l0) && tet.has_on_unbounded_side(l1)); diff --git a/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp index 6b83de7d349..6f45f6200e6 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_Tetrahedron_3.cpp @@ -143,6 +143,8 @@ public: // edge shared, 3rd point outside check_intersection(tet, Tr(p(0,1,0), p(1,0,0), P(0.5,0,-100)), S(p(0,1,0), p(1,0,0))); + check_intersection(tet, Tr(P(0.75,0.25,0), p(10,10,10), P(0.25,0.75,0)), + S(P(0.75,0.25,0), P(0.25,0.75,0))); // shared edge, 3rd point inside check_intersection(tet, Tr(p(0,1,0), p(1,0,0), P(0.25,0.25,0.25)), @@ -166,7 +168,7 @@ public: // face inside tr check_intersection(tet, Tr(p(0,2,0), p(0,-2,0), p(0,0,2)), - Tr(p(0,0,1), p(0,0,0), p(0,1,0))); + Tr(p(0,1,0), p(0,0,0), p(0,0,1))); // on the same plane, polygonal intersection Base::template check_intersection(tet, Tr(p(0,-2,0), p(1,1,0), p(1,2,0))); @@ -189,6 +191,14 @@ public: // vertex on edge & triangle inside, double segment non-incident Base::template check_intersection(tet, Tr(P(0.25,0,0.25), P(-1,0.5,0.25), P(1.5,0.5,0.25))); + // vertex on face, triangle outside & point intersection + Base::check_intersection(tet, Tr(P(-1,1,0.25), P(-1,0,0.25), P(0,0.25,0.25)), + P(0, 0.25, 0.25)); + Base::check_intersection(tet, Tr(P(-1,0,0.25), P(-1,1,0.25), P(0,0.25,0.25)), + P(0, 0.25, 0.25)); + Base::check_intersection(tet, Tr(P(0,0.25,0.25), P(-1,1,0.25), P(-1,0,0.25)), + P(0, 0.25, 0.25)); + // vertex on face, triangle outside & segment intersection Base::check_intersection(tet, Tr(P(0.5,0,-0.25), P(0.5,0,0.25), P(0.5,-0.5,0)), S(P(0.5, 0, 0.25), P(0.5, 0, 0))); @@ -307,12 +317,23 @@ public: } } + void issue_6777() + { + Tr tri(P(0.191630, -0.331630, -0.370000), P(-0.124185, -0.385815, -0.185000), P(-0.0700000, -0.0700000, 0.00000)); + Tet tet(P(0, -1, 0), P(-1, 0, 0), P(0, 0, 0), P(0, 0, -1)); + auto res = intersection(tri, tet); + assert(res != boost::none); + const std::vector

    *vps = boost::get>(&*res); + assert(vps!=nullptr); + } + void run() { std::cout << "3D Tetrahedron Intersection tests\n"; Tet_Tet(); Tet_Tr(); + issue_6777(); } }; diff --git a/Jet_fitting_3/examples/Jet_fitting_3/README b/Jet_fitting_3/examples/Jet_fitting_3/README index fc4df02d7b6..9bb5e2e614e 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/README +++ b/Jet_fitting_3/examples/Jet_fitting_3/README @@ -6,7 +6,7 @@ takes as input a which is a xyz text file it compute the fitting for this single entry and it outputs results in the file and on the standard std::cout -Usage is : Single_estimation , " +Usage is : Single_estimation , in_points are sampled on 0.1(x²+2y²) @@ -49,4 +49,4 @@ Note : if the nb of collected points is less than the required min number of ./Mesh_estimation ./Mesh_estimation -f data/ellipe0.003.off -d2 -m2 -a2 ./Mesh_estimation -f data/poly2x\^2+y\^2-0.062500-off -d2 -m2 -a2 - \ No newline at end of file + diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 566d7643bcd..c770d0b7b40 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -5964,13 +5964,22 @@ public: /// A model of this concept must provide: /// @{ - /*! introduces a variable with Cartesian coordinates \f$ (0,0)\f$. */ Kernel::Point_2 operator()(const CGAL::Origin &CGAL::ORIGIN); + /*! + returns `p`. + + \note It is advised to return a const reference to `p` to avoid useless copies. + + \note This peculiar requirement is necessary because some \cgal structures such as triangulations + internally manipulate points whose type might be `Point_2` or `Weighted_point_2`. + */ + Kernel::Point_2 operator()(const Kernel::Point_2& p); + /*! extracts the bare point from the weighted point. */ @@ -6001,6 +6010,16 @@ public: */ Kernel::Point_3 operator()(const CGAL::Origin &CGAL::ORIGIN); + /*! + returns `p`. + + \note It is advised to return a const reference to `p` to avoid useless copies. + + \note This peculiar requirement is necessary because some \cgal structures such as triangulations + internally manipulate points whose type might be `Point_3` or `Weighted_point_3`. + */ + Kernel::Point_3 operator()(const Kernel::Point_3& p); + /*! extracts the bare point from the weighted point. */ diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index ead2582c6bc..3dee6912b54 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -20,6 +20,7 @@ #ifndef CGAL_KERNEL_FUNCTION_OBJECTS_H #define CGAL_KERNEL_FUNCTION_OBJECTS_H +#include #include #include #include @@ -30,7 +31,6 @@ #include #include - #include // for Compute_dihedral_angle namespace CGAL { @@ -736,11 +736,12 @@ namespace CommonKernelFunctors { typedef Comparison_result result_type; - result_type operator()(const Weighted_point_3 & p, - const Weighted_point_3 & q, - const Weighted_point_3 & r, - const Weighted_point_3 & s, - const FT& w) const + Needs_FT + operator()(const Weighted_point_3 & p, + const Weighted_point_3 & q, + const Weighted_point_3 & r, + const Weighted_point_3 & s, + const FT& w) const { return CGAL::compare(squared_radius_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), @@ -750,10 +751,11 @@ namespace CommonKernelFunctors { w); } - result_type operator()(const Weighted_point_3 & p, - const Weighted_point_3 & q, - const Weighted_point_3 & r, - const FT& w) const + Needs_FT + operator()(const Weighted_point_3 & p, + const Weighted_point_3 & q, + const Weighted_point_3 & r, + const FT& w) const { return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), @@ -762,9 +764,10 @@ namespace CommonKernelFunctors { w); } - result_type operator()(const Weighted_point_3 & p, - const Weighted_point_3 & q, - const FT& w) const + Needs_FT + operator()(const Weighted_point_3 & p, + const Weighted_point_3 & q, + const FT& w) const { return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3( p.x(),p.y(),p.z(),p.weight(), @@ -817,17 +820,18 @@ namespace CommonKernelFunctors { typedef typename K::Comparison_result result_type; template - result_type + Needs_FT operator()(const T1& p, const T2& q, const FT& d2) const { - return CGAL::compare(squared_distance(p, q), d2); + return CGAL::compare(internal::squared_distance(p, q, K()), d2); } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(internal::squared_distance(p, q, K()), + internal::squared_distance(r, s, K())); } }; @@ -839,17 +843,18 @@ namespace CommonKernelFunctors { typedef typename K::Comparison_result result_type; template - result_type + Needs_FT operator()(const T1& p, const T2& q, const FT& d2) const { - return CGAL::compare(squared_distance(p, q), d2); + return CGAL::compare(internal::squared_distance(p, q, K()), d2); } template - result_type + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); + return CGAL::compare(internal::squared_distance(p, q, K()), + internal::squared_distance(r, s, K())); } }; @@ -3018,10 +3023,11 @@ namespace CommonKernelFunctors { public: typedef typename K::Boolean result_type; + // Needs_FT because Line/Line (and variations) as well as Circle_2/X compute intersections template - result_type + Needs_FT operator()(const T1& t1, const T2& t2) const - { return Intersections::internal::do_intersect(t1, t2, K()); } + { return { Intersections::internal::do_intersect(t1, t2, K())}; } }; template @@ -3035,10 +3041,12 @@ namespace CommonKernelFunctors { operator()(const T1& t1, const T2& t2) const { return Intersections::internal::do_intersect(t1, t2, K()); } - result_type - operator()(const typename K::Plane_3& pl1, const typename K::Plane_3& pl2, const typename K::Plane_3& pl3) const - { return Intersections::internal::do_intersect(pl1, pl2, pl3, K() ); } - + result_type operator()(const typename K::Plane_3& pl1, + const typename K::Plane_3& pl2, + const typename K::Plane_3& pl3) const + { + return Intersections::internal::do_intersect(pl1, pl2, pl3, K()); + } }; template @@ -3328,8 +3336,10 @@ namespace CommonKernelFunctors { return c.rep().has_on_bounded_side(p); } - result_type operator()(const Sphere_3& s1, const Sphere_3& s2, - const Point_3& a, const Point_3& b) const + // returns true iff the line segment ab is inside the union of the bounded sides of s1 and s2. + Needs_FT + operator()(const Sphere_3& s1, const Sphere_3& s2, + const Point_3& a, const Point_3& b) const { typedef typename K::Circle_3 Circle_3; typedef typename K::Point_3 Point_3; @@ -3341,27 +3351,23 @@ namespace CommonKernelFunctors { const bool a_in_s1 = has_on_bounded_side(s1, a); const bool a_in_s2 = has_on_bounded_side(s2, a); - if(!(a_in_s1 || a_in_s2)) return false; + if(!(a_in_s1 || a_in_s2)) return {false}; const bool b_in_s1 = has_on_bounded_side(s1, b); const bool b_in_s2 = has_on_bounded_side(s2, b); - if(!(b_in_s1 || b_in_s2)) return false; + if(!(b_in_s1 || b_in_s2)) return {false}; - if(a_in_s1 && b_in_s1) return true; - if(a_in_s2 && b_in_s2) return true; + if(a_in_s1 && b_in_s1) return {true}; + if(a_in_s2 && b_in_s2) return {true}; - if(!K().do_intersect_3_object()(s1, s2)) return false; + if(!K().do_intersect_3_object()(s1, s2)) return {false}; const Circle_3 circ(s1, s2); const Plane_3& plane = circ.supporting_plane(); const auto optional = K().intersect_3_object()(plane, Segment_3(a, b)); - CGAL_kernel_assertion_msg(bool(optional) == true, - "the segment does not intersect the supporting" - " plane"); + CGAL_kernel_assertion_msg(bool(optional) == true, "the segment does not intersect the supporting plane"); const Point_3* p = boost::get(&*optional); - CGAL_kernel_assertion_msg(p != 0, - "the segment intersection with the plane is " - "not a point"); + CGAL_kernel_assertion_msg(p != 0, "the segment intersection with the plane is not a point"); return squared_distance(circ.center(), *p) < circ.squared_radius(); } diff --git a/Kernel_23/include/CGAL/Kernel/interface_macros.h b/Kernel_23/include/CGAL/Kernel/interface_macros.h index d0ba827fa37..9c85643a977 100644 --- a/Kernel_23/include/CGAL/Kernel/interface_macros.h +++ b/Kernel_23/include/CGAL/Kernel/interface_macros.h @@ -18,7 +18,7 @@ // It's aimed at being included from within a kernel traits class, this // way we share more code. -// It is the responsability of the including file to correctly set the 2 +// It is the responsibility of the including file to correctly set the 2 // macros CGAL_Kernel_pred, CGAL_Kernel_cons and CGAL_Kernel_obj. // And they are #undefed at the end of this file. @@ -26,12 +26,6 @@ # define CGAL_Kernel_pred(X, Y) #endif -// Those predicates for which Simple_cartesian is guaranteed not to use -// any division. -#ifndef CGAL_Kernel_pred_RT -# define CGAL_Kernel_pred_RT(X, Y) CGAL_Kernel_pred(X, Y) -#endif - #ifndef CGAL_Kernel_cons # define CGAL_Kernel_cons(X, Y) #endif @@ -100,10 +94,10 @@ CGAL_Kernel_pred(Collinear_are_strictly_ordered_along_line_3, collinear_are_strictly_ordered_along_line_3_object) CGAL_Kernel_pred(Collinear_has_on_2, collinear_has_on_2_object) -CGAL_Kernel_pred_RT(Collinear_2, - collinear_2_object) -CGAL_Kernel_pred_RT(Collinear_3, - collinear_3_object) +CGAL_Kernel_pred(Collinear_2, + collinear_2_object) +CGAL_Kernel_pred(Collinear_3, + collinear_3_object) CGAL_Kernel_pred(Compare_angle_with_x_axis_2, compare_angle_with_x_axis_2_object) CGAL_Kernel_pred(Compare_dihedral_angle_3, @@ -112,10 +106,10 @@ CGAL_Kernel_pred(Compare_distance_2, compare_distance_2_object) CGAL_Kernel_pred(Compare_distance_3, compare_distance_3_object) -CGAL_Kernel_pred_RT(Compare_power_distance_2, - compare_power_distance_2_object) -CGAL_Kernel_pred_RT(Compare_power_distance_3, - compare_power_distance_3_object) +CGAL_Kernel_pred(Compare_power_distance_2, + compare_power_distance_2_object) +CGAL_Kernel_pred(Compare_power_distance_3, + compare_power_distance_3_object) CGAL_Kernel_pred(Compare_signed_distance_to_line_2, compare_signed_distance_to_line_2_object) CGAL_Kernel_pred(Compare_slope_2, @@ -486,18 +480,18 @@ CGAL_Kernel_cons(Construct_cartesian_const_iterator_2, construct_cartesian_const_iterator_2_object) CGAL_Kernel_cons(Construct_cartesian_const_iterator_3, construct_cartesian_const_iterator_3_object) -CGAL_Kernel_pred_RT(Coplanar_orientation_3, - coplanar_orientation_3_object) -CGAL_Kernel_pred_RT(Coplanar_side_of_bounded_circle_3, - coplanar_side_of_bounded_circle_3_object) -CGAL_Kernel_pred_RT(Coplanar_3, +CGAL_Kernel_pred(Coplanar_orientation_3, + coplanar_orientation_3_object) +CGAL_Kernel_pred(Coplanar_side_of_bounded_circle_3, + coplanar_side_of_bounded_circle_3_object) +CGAL_Kernel_pred(Coplanar_3, coplanar_3_object) CGAL_Kernel_pred(Counterclockwise_in_between_2, counterclockwise_in_between_2_object) CGAL_Kernel_pred(Do_intersect_2, do_intersect_2_object) -CGAL_Kernel_pred_RT(Do_intersect_3, - do_intersect_3_object) +CGAL_Kernel_pred(Do_intersect_3, + do_intersect_3_object) CGAL_Kernel_pred(Equal_xy_3, equal_xy_3_object) CGAL_Kernel_pred(Equal_x_2, @@ -546,8 +540,8 @@ CGAL_Kernel_cons(Intersect_point_3_for_polyhedral_envelope, intersect_point_3_for_polyhedral_envelope_object) CGAL_Kernel_pred(Is_degenerate_2, is_degenerate_2_object) -CGAL_Kernel_pred_RT(Is_degenerate_3, - is_degenerate_3_object) +CGAL_Kernel_pred(Is_degenerate_3, + is_degenerate_3_object) CGAL_Kernel_pred(Is_horizontal_2, is_horizontal_2_object) CGAL_Kernel_pred(Is_vertical_2, @@ -584,10 +578,10 @@ CGAL_Kernel_pred(Less_z_3, less_z_3_object) CGAL_Kernel_pred(Non_zero_coordinate_index_3, non_zero_coordinate_index_3_object) -CGAL_Kernel_pred_RT(Orientation_2, - orientation_2_object) -CGAL_Kernel_pred_RT(Orientation_3, - orientation_3_object) +CGAL_Kernel_pred(Orientation_2, + orientation_2_object) +CGAL_Kernel_pred(Orientation_3, + orientation_3_object) CGAL_Kernel_pred(Oriented_side_2, oriented_side_2_object) CGAL_Kernel_pred(Oriented_side_3, @@ -596,20 +590,19 @@ CGAL_Kernel_pred(Power_side_of_bounded_power_circle_2, power_side_of_bounded_power_circle_2_object) CGAL_Kernel_pred(Power_side_of_bounded_power_sphere_3, power_side_of_bounded_power_sphere_3_object) -CGAL_Kernel_pred_RT(Power_side_of_oriented_power_circle_2, - power_side_of_oriented_power_circle_2_object) -CGAL_Kernel_pred_RT(Power_side_of_oriented_power_sphere_3, - power_side_of_oriented_power_sphere_3_object) -CGAL_Kernel_pred_RT(Side_of_bounded_circle_2, - side_of_bounded_circle_2_object) -CGAL_Kernel_pred_RT(Side_of_bounded_sphere_3, - side_of_bounded_sphere_3_object) -CGAL_Kernel_pred_RT(Side_of_oriented_circle_2, - side_of_oriented_circle_2_object) -CGAL_Kernel_pred_RT(Side_of_oriented_sphere_3, - side_of_oriented_sphere_3_object) +CGAL_Kernel_pred(Power_side_of_oriented_power_circle_2, + power_side_of_oriented_power_circle_2_object) +CGAL_Kernel_pred(Power_side_of_oriented_power_sphere_3, + power_side_of_oriented_power_sphere_3_object) +CGAL_Kernel_pred(Side_of_bounded_circle_2, + side_of_bounded_circle_2_object) +CGAL_Kernel_pred(Side_of_bounded_sphere_3, + side_of_bounded_sphere_3_object) +CGAL_Kernel_pred(Side_of_oriented_circle_2, + side_of_oriented_circle_2_object) +CGAL_Kernel_pred(Side_of_oriented_sphere_3, + side_of_oriented_sphere_3_object) -#undef CGAL_Kernel_pred_RT #undef CGAL_Kernel_pred #undef CGAL_Kernel_cons #undef CGAL_Kernel_obj diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h index 120fa052a85..9f9896ac7eb 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h @@ -13,7 +13,7 @@ #define CGAL_INTERNAL_PROJECTION_TRAITS_3_H #include - +#include #include #include #include diff --git a/Kernel_23/include/CGAL/kernel_assertions.h b/Kernel_23/include/CGAL/kernel_assertions.h index 3bd9163f845..b34df95df1b 100644 --- a/Kernel_23/include/CGAL/kernel_assertions.h +++ b/Kernel_23/include/CGAL/kernel_assertions.h @@ -14,12 +14,9 @@ // // Author(s) : Geert-Jan Giezeman, Sven Schoenherr // -// Generated from script create_assertions.sh - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. +#ifndef CGAL_KERNEL_ASSERTIONS_H +#define CGAL_KERNEL_ASSERTIONS_H #include @@ -28,9 +25,6 @@ // assertions // ---------- -#undef CGAL_kernel_assertion -#undef CGAL_kernel_assertion_msg -#undef CGAL_kernel_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) # define CGAL_kernel_assertion(EX) (static_cast(0)) @@ -46,9 +40,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_exactness_assertion -#undef CGAL_kernel_exactness_assertion_msg -#undef CGAL_kernel_exactness_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -65,9 +56,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_expensive_assertion -#undef CGAL_kernel_expensive_assertion_msg -#undef CGAL_kernel_expensive_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) \ || defined(CGAL_NO_ASSERTIONS) \ @@ -85,9 +73,6 @@ #endif // CGAL_KERNEL_NO_ASSERTIONS -#undef CGAL_kernel_expensive_exactness_assertion -#undef CGAL_kernel_expensive_exactness_assertion_msg -#undef CGAL_kernel_expensive_exactness_assertion_code #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -108,9 +93,6 @@ // preconditions // ------------- -#undef CGAL_kernel_precondition -#undef CGAL_kernel_precondition_msg -#undef CGAL_kernel_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) # define CGAL_kernel_precondition(EX) (static_cast(0)) @@ -126,9 +108,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_exactness_precondition -#undef CGAL_kernel_exactness_precondition_msg -#undef CGAL_kernel_exactness_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -145,9 +124,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_expensive_precondition -#undef CGAL_kernel_expensive_precondition_msg -#undef CGAL_kernel_expensive_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -164,9 +140,6 @@ #endif // CGAL_KERNEL_NO_PRECONDITIONS -#undef CGAL_kernel_expensive_exactness_precondition -#undef CGAL_kernel_expensive_exactness_precondition_msg -#undef CGAL_kernel_expensive_exactness_precondition_code #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -187,9 +160,6 @@ // postconditions // -------------- -#undef CGAL_kernel_postcondition -#undef CGAL_kernel_postcondition_msg -#undef CGAL_kernel_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) # define CGAL_kernel_postcondition(EX) (static_cast(0)) @@ -205,9 +175,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_exactness_postcondition -#undef CGAL_kernel_exactness_postcondition_msg -#undef CGAL_kernel_exactness_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -224,9 +191,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_expensive_postcondition -#undef CGAL_kernel_expensive_postcondition_msg -#undef CGAL_kernel_expensive_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -243,9 +207,6 @@ #endif // CGAL_KERNEL_NO_POSTCONDITIONS -#undef CGAL_kernel_expensive_exactness_postcondition -#undef CGAL_kernel_expensive_exactness_postcondition_msg -#undef CGAL_kernel_expensive_exactness_postcondition_code #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -266,9 +227,6 @@ // warnings // -------- -#undef CGAL_kernel_warning -#undef CGAL_kernel_warning_msg -#undef CGAL_kernel_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) # define CGAL_kernel_warning(EX) (static_cast(0)) @@ -284,9 +242,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_exactness_warning -#undef CGAL_kernel_exactness_warning_msg -#undef CGAL_kernel_exactness_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) @@ -303,9 +258,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_expensive_warning -#undef CGAL_kernel_expensive_warning_msg -#undef CGAL_kernel_expensive_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) @@ -322,9 +274,6 @@ #endif // CGAL_KERNEL_NO_WARNINGS -#undef CGAL_kernel_expensive_exactness_warning -#undef CGAL_kernel_expensive_exactness_warning_msg -#undef CGAL_kernel_expensive_exactness_warning_code #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ @@ -340,3 +289,5 @@ # define CGAL_kernel_expensive_exactness_warning_code(CODE) CODE # define CGAL_kernel_expensive_exactness_warnings 1 #endif // CGAL_KERNEL_NO_WARNINGS + +#endif // CGAL_KERNEL_ASSERTIONS_H diff --git a/Kernel_23/test/Kernel_23/CMakeLists.txt b/Kernel_23/test/Kernel_23/CMakeLists.txt index 24b2ddfc339..1de74e0e1b0 100644 --- a/Kernel_23/test/Kernel_23/CMakeLists.txt +++ b/Kernel_23/test/Kernel_23/CMakeLists.txt @@ -1,6 +1,3 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.23) project(Kernel_23_Tests) @@ -8,11 +5,44 @@ find_package(CGAL REQUIRED COMPONENTS Core) 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("Cartesian.cpp") +create_single_source_cgal_program("determinant_77.cpp") +create_single_source_cgal_program("Dimension.cpp") +create_single_source_cgal_program("Exact_predicates_exact_constructions_kernel.cpp") +create_single_source_cgal_program("Filtered_cartesian.cpp") +create_single_source_cgal_program("Filtered_homogeneous.cpp") +create_single_source_cgal_program("Homogeneous.cpp") +create_single_source_cgal_program("issue_129.cpp") +create_single_source_cgal_program("issue_3301.cpp") +create_single_source_cgal_program("Kernel_checker.cpp") +create_single_source_cgal_program("Lazy_kernel.cpp") +create_single_source_cgal_program("origin_3.cpp") +create_single_source_cgal_program("overload_bug.cpp") +create_single_source_cgal_program("rank.cpp") +create_single_source_cgal_program("Simple_cartesian.cpp") +create_single_source_cgal_program("Simple_homogeneous.cpp") +create_single_source_cgal_program("test_all_linear_intersections.cpp") +create_single_source_cgal_program("test_approximate_dihedral_angle_3.cpp") +create_single_source_cgal_program("test_bbox.cpp") +create_single_source_cgal_program("test_converter.cpp") +create_single_source_cgal_program("test_Has_conversion.cpp") +create_single_source_cgal_program("test_hash_functions.cpp") +create_single_source_cgal_program("test_kernel__.cpp") +create_single_source_cgal_program("test_projection_traits.cpp") +create_single_source_cgal_program("test_Projection_traits_xy_3_Intersect_2.cpp") + +if(CGAL_KERNEL_23_TEST_RT_FT_PREDICATE_FLAGS) + # Templated operators: + # - create a lot of possible combinations, which is expensive to test + # - create issues because some combinations might be RT-sufficient whereas others will require FT + # + # add_definitions(-DCGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS) + + create_single_source_cgal_program("atomic_compilation_test.cpp") + target_precompile_headers(atomic_compilation_test PUBLIC [["atomic_RT_FT_predicate_headers.h"]]) + + create_single_source_cgal_program("test_RT_or_FT_predicates.cpp") + target_compile_definitions(test_RT_or_FT_predicates PRIVATE + "CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}" + "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}") +endif() diff --git a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp index d8b24523c15..3c56a17f44b 100644 --- a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp +++ b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp @@ -14,6 +14,9 @@ // // Author(s) : Sylvain Pion +// This defines removes the operator/ from CGAL::Mpzf to check that functors not using +// the tag `Needs_FT<>` really only need a RT (ring type) without division. +#define CGAL_NO_MPZF_DIVISION_OPERATOR 1 #include #include diff --git a/Kernel_23/test/Kernel_23/atomic_compilation_test.cpp b/Kernel_23/test/Kernel_23/atomic_compilation_test.cpp new file mode 100644 index 00000000000..be26c19f042 --- /dev/null +++ b/Kernel_23/test/Kernel_23/atomic_compilation_test.cpp @@ -0,0 +1,2 @@ +// This executable is used by test_RT_or_FT_predicates.cpp +int main(int, char**) { } diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h index b70b9eea4b6..2b4b26dd388 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h @@ -22,9 +22,12 @@ #include #include #include +#include #include +CGAL_GENERATE_MEMBER_DETECTOR(needs_FT); + using CGAL::internal::use; // Accessory function testing functions that require sqrt(). @@ -75,6 +78,28 @@ _test_new_3_sqrt(const R& rep, CGAL::Tag_true) return true; } +template struct Test_needs_FT +{ + template void operator()(const T&...) const {} +}; + +template <> struct Test_needs_FT +{ + template + void operator()(const Compare_distance_3& compare_dist, + const Point_3& p1, const Point_3 p2, const Point_3& p3, + const Segment_3& s2, const Line_3& l1) const + { + assert(!compare_dist.needs_FT(p1, p2, p3)); + assert(!compare_dist.needs_FT(p2, s2, s2)); + assert(!compare_dist.needs_FT(p2, p2, s2)); + assert(!compare_dist.needs_FT(p1, s2, p2)); + assert(compare_dist.needs_FT(l1, p1, p1)); + assert(compare_dist.needs_FT(p2, p3, p2, p3)); + assert(compare_dist.needs_FT(p2, s2, l1, s2)); + } +}; template bool @@ -603,8 +628,16 @@ test_new_3(const R& rep) typename R::Compare_distance_3 compare_dist = rep.compare_distance_3_object(); Comparison_result tmp34ab = compare_dist(p2,p3,p4); + tmp34ab = compare_dist(p1, s2, s2); + tmp34ab = compare_dist(p1, p2, s2); + tmp34ab = compare_dist(p1, s2, p2); tmp34ab = compare_dist(p2,p3,p2,p3); tmp34ab = compare_dist(p1, p2, p3, p4); + tmp34ab = compare_dist(l2, p1, p1); + + Test_needs_FT::value> test_needs_ft; + test_needs_ft(compare_dist, p1, p2, p3, s2, l1); (void) tmp34ab; typename R::Compare_squared_distance_3 compare_sq_dist diff --git a/Kernel_23/test/Kernel_23/include/atomic_RT_FT_predicate_headers.h b/Kernel_23/test/Kernel_23/include/atomic_RT_FT_predicate_headers.h new file mode 100644 index 00000000000..81e656adb64 --- /dev/null +++ b/Kernel_23/test/Kernel_23/include/atomic_RT_FT_predicate_headers.h @@ -0,0 +1,27 @@ +#ifndef CGAL_KERNEL_23_TEST_ATOMIC_HEADERS_H +#define CGAL_KERNEL_23_TEST_ATOMIC_HEADERS_H + +#define CGAL_NO_MPZF_DIVISION_OPERATOR + +// These includes are there because this header is precompiled + +#include +#include +#include + +#include +#include + +namespace CGAL { +namespace Kernel_23_tests { + +struct Any +{ + template + operator T(); +}; + +} // namespace Kernel_23_tests +} // namespace CGAL + +#endif // CGAL_KERNEL_23_TEST_ATOMIC_HEADERS_H diff --git a/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp b/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp new file mode 100644 index 00000000000..03b2787cc0b --- /dev/null +++ b/Kernel_23/test/Kernel_23/test_RT_or_FT_predicates.cpp @@ -0,0 +1,503 @@ +#include +#include + +#include +#include +#include +#include +#include +#include + +// 0, nothing +// > 0, print RT_sufficient/FT_necessary errors and successes +// > 1, same as above + predicate being tested +// > 2, same as above + some general indications on what is going on +// > 4, same as above + even more indications on what is going on +// > 8, everything +#define CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY 2 + +std::vector predicates_types = { }; + +// @todo, technically somebody could create predicates with non-kernel objects (nor FT/Origin), e.g. `int`. +// In that case, these arguments would have to be added to the lists below since there is no scrapping +// of the predicate arguments, but simply trying all combinations of objects from these lists. +std::vector object_types_2 = { "FT", "Origin" }; +std::vector object_types_3 = { "FT", "Origin" }; + +// @todo potential operator()s with fewer than MIN_ARITY and more than MAX_ARITY are not tested +constexpr std::size_t MIN_ARITY = 0; +constexpr std::size_t MAX_ARITY = 12; + +const std::string kernel_name = "Simple_cartesian"; +const std::string FT_div = "double"; +const std::string RT_no_div = "CGAL::Mpzf"; + +enum Needs_FT_checks +{ + NO_CHECK = 0, + CHECK_NEEDS_FT, + CHECK_NO_NEEDS_FT +}; + +enum Compilation_result +{ + SUCCESSFUL = 0, // if it got to linking, it is also a successful compilation + FAILED_NO_MATCH, + FAILED_AMBIGUOUS_CALL, // ambiguous calls means the arity is valid + FAILED_NO_DIVISION_OPERATOR, // used to detect if a valid compilation can be done with RT + FAILED_STATIC_ASSERTION, // used to detect failures in the result type checks + UNKNOWN +}; + +inline const char* get_error_message(int error_code) +{ + // Messages corresponding to Error_code list above. Must be kept in sync! + static const char* error_message[UNKNOWN+1] = + { + "Success!", + "Failed: no match!", + "Failed: ambiguous call!", + "Failed: called division operator!", + "Failed: static assertion violated!", + "Unexpected error!" + }; + + if(error_code > UNKNOWN || error_code < 0) + return "Doubly unexpected error!!"; + else + return error_message[error_code]; +} + +std::string kernel_with_FT(const std::string& FT_name) +{ + return "CGAL::" + kernel_name + "<" + FT_name + ">"; +} + +// convert from e.g. Point_2 to CGAL::Point_2 +std::string parameter_with_namespace(const std::string& FT_name, + const std::string& o) +{ + if(o == "Any") + return "CGAL::Kernel_23_tests::Any"; + else if(o == "FT") + return "K::FT"; + else if(o == "Origin") + return "CGAL::Origin"; + else + return "CGAL::" + o + "<" + kernel_with_FT(FT_name) + " >"; +} + +int compile() +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << "====== Compiling atomic file... ======" << std::endl; +#endif + + return std::system("cmake --build " CGAL_STRINGIZE(CMAKE_BINARY_DIR) " -t atomic_compilation_test > log.txt 2>&1"); +} + +Compilation_result parse_output(const std::string& predicate_name, + const std::string& FT_name = {}, + const std::vector& parameters = {}) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << "====== Parsing compilation log... ======" << std::endl; +#endif + Compilation_result res = UNKNOWN; + + std::ifstream in("log.txt"); + if(!in) + { +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 0) + std::cerr << "Error: failed to open log file" << std::endl; +#endif + return UNKNOWN; + } + +#ifdef CGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS + // Compare_(squared)_distance_23 have templated operator()s, which are a lot of combinations to test. + // In templated operator()s, the compare is simply a call to squared_distance()s and a CGAL::compare(). + // Below prunes some exploration branches in case the first squared_distance() call does not even compile. + bool prune_compare_distance_branches = false; + if(predicate_name == "Compare_distance_2" || predicate_name == "Compare_distance_3" || + predicate_name == "Compare_squared_distance_2" || predicate_name == "Compare_squared_distance_3") + { + prune_compare_distance_branches = true; + } +#else + CGAL_USE(predicate_name); + CGAL_USE(FT_name); + CGAL_USE(parameters); +#endif + + std::string line; + while(getline(in, line)) + { +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 8) + std::cout << line << std::endl; +#endif + + if(line.find("no match for call") != std::string::npos) { + res = FAILED_NO_MATCH; + break; + } else if(line.find("use of deleted function") != std::string::npos) { + res = FAILED_NO_MATCH; + break; +#ifdef CGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS + } else if(prune_compare_distance_branches && parameters.size() > 1 && + parameters[0] != "Any" && parameters[1] != "Any" && + line.find(std::string{"no matching function for call to ‘squared_distance(const " + + parameter_with_namespace(FT_name, parameters[0]) + "&, const " + + parameter_with_namespace(FT_name, parameters[1])}) != std::string::npos) { + res = FAILED_NO_MATCH; + break; +#endif + } else if(line.find("ambiguous") != std::string::npos) { + res = FAILED_AMBIGUOUS_CALL; + break; + } else if(line.find("candidate") != std::string::npos) { + res = FAILED_AMBIGUOUS_CALL; + break; + } else if(line.find("no match for ‘operator/’") != std::string::npos) { + res = FAILED_NO_DIVISION_OPERATOR; + break; + } else if(line.find("no match for ‘operator/=’") != std::string::npos) { + res = FAILED_NO_DIVISION_OPERATOR; + break; + } else if(line.find("static assertion failed") != std::string::npos) { + res = FAILED_STATIC_ASSERTION; + break; + } else if(line.find("Built") != std::string::npos) { + res = SUCCESSFUL; + break; + } else if(line.find("undefined reference") != std::string::npos) { + // Can happen because the conversion Any -> kernel object is not implemented + res = SUCCESSFUL; + break; + } + } + +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << "Result of atomic test file is: " << get_error_message(res) << std::endl; +#endif + CGAL_postcondition(res != UNKNOWN); + + return res; +} + +void generate_atomic_compilation_test(const std::string& FT_name, + const std::string& predicate_name, + const std::vector& parameters, + const Needs_FT_checks check = NO_CHECK) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << "\n====== Generate atomic compilation test... ======" << std::endl; +#endif + +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << "\t" << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j;\n"; + + out << "int main(int, char**)\n"; + out << "{\n"; + + out << " P p{};\n"; + for(std::size_t j=0, i=parameters.size(); j::value));\n"; + else if(check == CHECK_NEEDS_FT) + out << ", NFT_B>::value));\n"; + } + + out << " return EXIT_SUCCESS;\n"; + out << "}\n"; + out.close(); +} + +void ensure_NO_Needs_FT(const std::string& predicate_name, + const std::vector& parameters) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cout << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cout << "Error: " << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cerr << "Unexpected error during Needs_FT checks" << std::endl; +#endif + assert(false); + } +} + +void ensure_Needs_FT(const std::string& predicate_name, + const std::vector& parameters) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 4) + std::cout << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cout << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cout << "Error: " << predicate_name << "("; + for(std::size_t j=0, i=parameters.size(); j 0) + std::cerr << "Unexpected error during Needs_FT checks" << std::endl; +#endif + assert(false); + } +} + +void test_predicate(const std::string& predicate_name, + const std::size_t object_pos, + const std::size_t arity, + // intentional copy, each sub-branch gets its own parameter list + std::vector parameters) +{ + const std::size_t last = arity - 1; + CGAL_precondition(object_pos <= last); + + CGAL_precondition(predicate_name.back() == '2' || predicate_name.back() == '3'); + const auto& object_types = (predicate_name.back() == '2') ? object_types_2 : object_types_3; + + for(const std::string& object_type : object_types) + { +#ifdef CGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS + // This pruning could be done for other predicates, but they're not as expensive so it doesn't matter + if((predicate_name == "Compare_distance_2" || predicate_name == "Compare_distance_3" || + predicate_name == "Compare_squared_distance_2" || predicate_name == "Compare_squared_distance_3" || + predicate_name == "Do_intersect_2" || predicate_name == "Do_intersect_3") && + object_type == "FT") + { + continue; + } +#endif + + parameters[object_pos] = object_type; + generate_atomic_compilation_test(RT_no_div, predicate_name, parameters); + auto compilation_result = compile(); + Compilation_result res = compilation_result == 0 ? + SUCCESSFUL : + parse_output(predicate_name, RT_no_div, parameters); + + // See if we can already (i.e., possibly with `Any`s) conclude on the current parameter list + if(res == FAILED_NO_MATCH) + { + // The object at the current position yields a compilation error, do not explore any further + continue; + } + else if(object_pos == last) + { + if(res == SUCCESSFUL) + { + ensure_NO_Needs_FT(predicate_name, parameters); + } + else if(res == FAILED_NO_DIVISION_OPERATOR) + { + ensure_Needs_FT(predicate_name, parameters); + } + } + else + { + // The object at the current position does not invalid the call, explore further this list + test_predicate(predicate_name, object_pos + 1, arity, parameters); + } + } +} + +void test_predicate(const std::string& predicate_name, + const std::size_t arity) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 2) + std::cout << "\n\n==== Test predicate with arity " << arity << "... ====" << std::endl; +#endif + + // Use "Any" to prune early: + // 1st try "Object_1, Any, ..., Any" (i - 1 "Any") + // -> if that doesn't compile, we're done with Object_1 and try "Object_2, Any, ..., Any" (i-1 "Any") + // -> if that compiles, try "Object_1, Object_1, Any, ..., Any" (i-2 "Any") + // etc. + + // the position of the object being changed/tested, when object_pos == arity - 1, + // then this is a call with full objects on which we can do the RT test + std::vector parameters(arity, "Any"); + + // Quick try to see if it even matches anything + generate_atomic_compilation_test(RT_no_div, predicate_name, parameters); + auto compilation_result = compile(); + Compilation_result res = compilation_result == 0 ? + SUCCESSFUL : + parse_output(predicate_name); + if(res == FAILED_NO_MATCH) // No point with this current arity + return; + + std::size_t object_pos = 0; + test_predicate(predicate_name, object_pos, arity, parameters); +} + +void test_predicate(const std::string& predicate_name) +{ +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 1) + std::cout << "\n\n\n== Test predicate: " << predicate_name << "... ==" << std::endl; +#endif + +#ifndef CGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS + if(predicate_name == "Compare_distance_2" || predicate_name == "Compare_distance_3" || + predicate_name == "Compare_squared_distance_2" || predicate_name == "Compare_squared_distance_3" || + predicate_name == "Do_intersect_2" || predicate_name == "Do_intersect_3") + { +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 1) + std::cout << "Skipping because 'CGAL_KERNEL_23_TEST_RT_FT_PREDICATES_TEST_PREDICATES_WITH_TEMPLATED_OPERATORS' is not defined!" << std::endl; +#endif + return; + } +#endif + + for(std::size_t i=MIN_ARITY; i<=MAX_ARITY; ++i) + test_predicate(predicate_name, i); +} + +// Just to not get a diff at the end of the test +void restore_atomic_file() +{ + std::ofstream out("../atomic_compilation_test.cpp"); + if(!out) + { + std::cerr << "Error: could not write into atomic compilation test" << std::endl; + std::exit(1); + } + + out << "// This executable is used by test_RT_or_FT_predicates.cpp\n"; + out << "int main(int, char**) { }\n"; + out.close(); +} + +int main(int , char**) +{ + // Get the predicates + #define CGAL_Kernel_pred(X, Y) predicates_types.push_back(#X); + #include + + // Get the objects + #define CGAL_Kernel_obj(X) { const std::string O = #X; \ + CGAL_precondition(O.back() == '2' || O.back() == '3'); \ + if(O.back() == ('2')) \ + object_types_2.push_back(#X); \ + else \ + object_types_3.push_back(#X); } + #include + +#if (CGAL_KERNEL_23_TEST_RT_FT_VERBOSITY > 1) + std::cout << predicates_types.size() << " predicates:" << std::endl; + for(const std::string& s : predicates_types) + std::cout << s << "\n"; + std::cout << std::endl; + + std::cout << object_types_2.size() << " 2D objects:" << std::endl; + for(const std::string& o : object_types_2) + std::cout << o << "\n"; + std::cout << std::endl; + + std::cout << object_types_3.size() << " 3D objects:" << std::endl; + for(const std::string& o : object_types_3) + std::cout << o << "\n"; + std::cout << std::endl; +#endif + + // Actual tests + for(const std::string& predicate_name : predicates_types) + { + test_predicate(predicate_name); + } + + restore_atomic_file(); + + return EXIT_SUCCESS; +} diff --git a/Kernel_23/test/Kernel_23/test_projection_traits.cpp b/Kernel_23/test/Kernel_23/test_projection_traits.cpp index 50171ee754d..6929698c39d 100644 --- a/Kernel_23/test/Kernel_23/test_projection_traits.cpp +++ b/Kernel_23/test/Kernel_23/test_projection_traits.cpp @@ -1,3 +1,4 @@ +#define CGAL_NO_MPZF_DIVISION_OPERATOR 1 #include #include diff --git a/Kernel_d/doc/Kernel_d/Concepts/LinearAlgebraTraits_d.h b/Kernel_d/doc/Kernel_d/Concepts/LinearAlgebraTraits_d.h index 27551d725a1..932880c6f89 100644 --- a/Kernel_d/doc/Kernel_d/Concepts/LinearAlgebraTraits_d.h +++ b/Kernel_d/doc/Kernel_d/Concepts/LinearAlgebraTraits_d.h @@ -118,7 +118,7 @@ and the columns of `spanning_vectors` are a maximal set of linearly independent solutions to the corresponding homogeneous system. -\pre `M.row_dimension() = b.dimension()`. +\pre `M.row_dimension() == b.dimension()`. */ static bool linear_solver(const Matrix& M, const Vector& b, Vector& x, NT& D, Matrix& spanning_vectors, Vector& c); @@ -127,14 +127,14 @@ Vector& x, NT& D, Matrix& spanning_vectors, Vector& c); determines whether the linear system \f$ M\cdot x = b\f$ is solvable. If yes, then \f$ (1/D) x\f$ is a solution, if not then \f$ c^T \cdot M = 0\f$ and \f$ c^T \cdot b \not= 0\f$. -\pre `M.row_dimension() = b.dimension()`. +\pre `M.row_dimension() == b.dimension()`. */ static bool linear_solver(const Matrix& M, const Vector& b, Vector& x, NT& D, Vector& c) ; /*! as above, but without the witness \f$ c\f$ -\pre `M.row_dimension() = b.dimension()`. +\pre `M.row_dimension() == b.dimension()`. */ static bool linear_solver(const Matrix& M, const Vector& b, Vector& x, NT& D) ; @@ -142,7 +142,7 @@ Vector& x, NT& D) ; /*! determines whether the system \f$ M \cdot x = b\f$ is solvable -\pre `M.row_dimension() = b.dimension()`. +\pre `M.row_dimension() == b.dimension()`. */ static bool is_solvable(const Matrix& M, const Vector& b) ; diff --git a/Kernel_d/doc/Kernel_d/Concepts/Matrix.h b/Kernel_d/doc/Kernel_d/Concepts/Matrix.h index 7a2c7d96e1a..f2daec7a033 100644 --- a/Kernel_d/doc/Kernel_d/Concepts/Matrix.h +++ b/Kernel_d/doc/Kernel_d/Concepts/Matrix.h @@ -325,7 +325,7 @@ Matrix operator-(); /*! Multiplication. -\pre `M.column_dimension() = M1.row_dimension()` +\pre `M.column_dimension() == M1.row_dimension()` */ Matrix operator*(const Matrix& M1) ; @@ -334,7 +334,7 @@ Matrix operator*(const Matrix& M1) Multiplication with vector. -\pre `M.column_dimension() = vec.dimension()` +\pre `M.column_dimension() == vec.dimension()` */ Vector operator*(const Vector& vec) ; diff --git a/Kernel_d/doc/Kernel_d/Concepts/Vector.h b/Kernel_d/doc/Kernel_d/Concepts/Vector.h index d5bfe190fa0..99214f381a3 100644 --- a/Kernel_d/doc/Kernel_d/Concepts/Vector.h +++ b/Kernel_d/doc/Kernel_d/Concepts/Vector.h @@ -119,14 +119,14 @@ Vector operator+(const Vector& v1) ; /*! Subtraction. -\pre `v.dimension() = v1.dimension()`. +\pre `v.dimension() == v1.dimension()`. */ Vector operator-(const Vector& v1) ; /*! Inner Product. -\pre `v.dimension() = v1.dimension()`. +\pre `v.dimension() == v1.dimension()`. */ NT operator*(const Vector& v1) ; diff --git a/Kernel_d/include/CGAL/Cartesian_d.h b/Kernel_d/include/CGAL/Cartesian_d.h index f23ed661412..cb4d1f848c2 100644 --- a/Kernel_d/include/CGAL/Cartesian_d.h +++ b/Kernel_d/include/CGAL/Cartesian_d.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -71,7 +71,7 @@ public: typedef typename Point_d_base::Cartesian_const_iterator Cartesian_const_iterator_d; - // Boolean had originally been Bool. It was renamed to avoid a conflict + // Boolean had originally been Bool. It was renamed to avoid a conflict // between a macro defined in Xlib.h poorly chosen to have the same name, // that is 'Bool'. typedef typename Same_uncertainty_nt::type diff --git a/Kernel_d/include/CGAL/Homogeneous_d.h b/Kernel_d/include/CGAL/Homogeneous_d.h index 5f8026fbbf5..b5f6981a468 100644 --- a/Kernel_d/include/CGAL/Homogeneous_d.h +++ b/Kernel_d/include/CGAL/Homogeneous_d.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -67,6 +67,24 @@ public: typedef typename Point_d_base::Cartesian_const_iterator Cartesian_const_iterator_d; + // Boolean had originally been Bool. It was renamed to avoid a conflict + // between a macro defined in Xlib.h poorly chosen to have the same name, + // that is 'Bool'. + typedef typename Same_uncertainty_nt::type + Boolean; + typedef typename Same_uncertainty_nt::type + Sign; + typedef typename Same_uncertainty_nt::type + Comparison_result; + typedef typename Same_uncertainty_nt::type + Orientation; + typedef typename Same_uncertainty_nt::type + Oriented_side; + typedef typename Same_uncertainty_nt::type + Bounded_side; + typedef typename Same_uncertainty_nt::type + Angle; + typedef Dynamic_dimension_tag Dimension; template diff --git a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h index 212480d843a..2c9a0e64955 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Sphere_d.h @@ -47,6 +47,7 @@ class Sphere_d_rep { public: Sphere_d_rep() : cp(0) {} Sphere_d_rep(int d) : P(d), cp(0) {} + Sphere_d_rep(int d, Orientation orient) : P(d), orient(orient), cp(0) {} template Sphere_d_rep(int d, ForwardIterator first, ForwardIterator last) : @@ -109,14 +110,13 @@ typedef typename std::vector< Point_d >::const_iterator point_iterator; /*{\Mcreation 4}*/ -Sphere_d(int d = 0) : Base( Rep(d+1) ) + Sphere_d(int d = 0) : Base( Rep(d+1, ZERO) ) /*{\Mcreate introduces a variable |\Mvar| of type |\Mname|. |\Mvar| is initialized to the empty sphere centered at the origin of $d$-dimensional space. }*/ { Point_d p(d); for (int i = 0; i <= d; i++) ptr()->P[i] = p; - ptr()->orient = ZERO; ptr()->cp = new Point_d(p); } diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/FindGoogleTest.cmake b/Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/FindGoogleTest.cmake index 37bd9a812d6..5e86a4dd4cf 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/FindGoogleTest.cmake +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/cmake/FindGoogleTest.cmake @@ -13,7 +13,7 @@ # use this file except in compliance with the License. You may obtain a copy # of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT diff --git a/Linear_cell_complex/benchmark/README.TXT b/Linear_cell_complex/benchmark/README.TXT index a721960047d..588995c5edb 100644 --- a/Linear_cell_complex/benchmark/README.TXT +++ b/Linear_cell_complex/benchmark/README.TXT @@ -18,9 +18,9 @@ INSTALLATION: 1) Install all the following libraries: CGAL: https://www.cgal.org/ -CGoGN: http://cgogn.u-strasbg.fr/ -OpenMesh: http://www.openmesh.org/ -OpenVolumeMesh: http://www.openvolumemesh.org/ +CGoGN: https://cgogn.github.io/ +OpenMesh: https://www.openmesh.org/ +OpenVolumeMesh: https://www.openvolumemesh.org/ 2) create links (or copy directory): * in the 2D directory: @@ -41,7 +41,7 @@ CGAL_BUILD_DIR being the build directory of the CGAL library. * In 2D, the programs take off files as input. * In 3D, lcc and cgogn take tetmesh and OpenVolumeMesh takes ovm. -You can create a tetmesh file using tetgen programm with an off file as input (http://tetgen.berlios.de/) with option -g to generate XXX.mesh file. Rename this file into XXX.tetmesh. Modify the file to keep only the two following sections: +You can create a tetmesh file using tetgen programm with an off file as input (https://www.berlios.de/software/tetgen/) with option -g to generate XXX.mesh file. Rename this file into XXX.tetmesh. Modify the file to keep only the two following sections: ********************** Vertices diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp index d157e9ba2e6..16b74ff6736 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp @@ -134,11 +134,10 @@ subdivide_lcc_3 (LCC & m) // 2) We subdivide each facet. m.negate_mark (treated); // All the darts are marked in O(1). - unsigned int nb = 0; + for (LCC::Dart_range::iterator it (m.darts().begin ()); m.number_of_marked_darts (treated) > 0; ++it) { - ++nb; if (m.is_marked (it, treated)) { // We unmark the darts of the facet to process only once dart/facet. diff --git a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp b/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp index f9f83500d76..58fd07d2bf9 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp @@ -21,7 +21,7 @@ int main(int narg, char** argv) <<"nbvertices nbedges"< Sat, 06 Feb 2010 12:29:02 +0100 diff --git a/Maintenance/deb/sid/debian/copyright b/Maintenance/deb/sid/debian/copyright index ecc6058b7dc..6390c1a2874 100644 --- a/Maintenance/deb/sid/debian/copyright +++ b/Maintenance/deb/sid/debian/copyright @@ -318,7 +318,7 @@ src/CGALCore and include/CGAL/CORE. Copyright (c) 1995-2004 Exact Computation Project All rights reserved. - This file is part of CORE (http://cs.nyu.edu/exact/core/). + This file is part of CORE (https://cs.nyu.edu/exact/core/). You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/Maintenance/deb/sid/debian/rules b/Maintenance/deb/sid/debian/rules index 4e3de31d8e9..a3533b8b2cb 100755 --- a/Maintenance/deb/sid/debian/rules +++ b/Maintenance/deb/sid/debian/rules @@ -2,7 +2,7 @@ # export DH_VERBOSE=1 -# See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake +# See https://wiki.debian.org/Hardening#Notes_for_packages_using_CMake CFLAGS := $(CFLAGS) $(CPPFLAGS) CXXFLAGS := $(CXXFLAGS) $(CPPFLAGS) @@ -26,11 +26,11 @@ override_dh_auto_configure: cd shared && QTDIR= cmake .. \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ -DWITH_CGAL_Qt3=OFF -DWITH_demos=OFF -DWITH_examples=OFF \ - -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE + -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE mkdir -p shared/demo/CGAL_ipelets cd shared/demo/CGAL_ipelets && QTDIR= cmake ../../../demo/CGAL_ipelets \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ - -DCGAL_DIR=$(CURDIR)/shared + -DCGAL_DIR=$(CURDIR)/shared override_dh_auto_build: $(MAKE) -C static diff --git a/Maintenance/deb/squeeze/debian/README.Debian b/Maintenance/deb/squeeze/debian/README.Debian index 4be997664d7..e1056ac3ab7 100644 --- a/Maintenance/deb/squeeze/debian/README.Debian +++ b/Maintenance/deb/squeeze/debian/README.Debian @@ -44,7 +44,7 @@ and pass the option -DQGLVIEWER_INCLUDE_DIR=/some/dir -to cmake. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522659 for more +to cmake. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522659 for more information. -- Joachim Reichel Sat, 06 Feb 2010 12:29:02 +0100 diff --git a/Maintenance/deb/squeeze/debian/copyright b/Maintenance/deb/squeeze/debian/copyright index ecc6058b7dc..6390c1a2874 100644 --- a/Maintenance/deb/squeeze/debian/copyright +++ b/Maintenance/deb/squeeze/debian/copyright @@ -318,7 +318,7 @@ src/CGALCore and include/CGAL/CORE. Copyright (c) 1995-2004 Exact Computation Project All rights reserved. - This file is part of CORE (http://cs.nyu.edu/exact/core/). + This file is part of CORE (https://cs.nyu.edu/exact/core/). You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/Maintenance/deb/squeeze/debian/rules b/Maintenance/deb/squeeze/debian/rules index 4e3de31d8e9..a3533b8b2cb 100755 --- a/Maintenance/deb/squeeze/debian/rules +++ b/Maintenance/deb/squeeze/debian/rules @@ -2,7 +2,7 @@ # export DH_VERBOSE=1 -# See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake +# See https://wiki.debian.org/Hardening#Notes_for_packages_using_CMake CFLAGS := $(CFLAGS) $(CPPFLAGS) CXXFLAGS := $(CXXFLAGS) $(CPPFLAGS) @@ -26,11 +26,11 @@ override_dh_auto_configure: cd shared && QTDIR= cmake .. \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ -DWITH_CGAL_Qt3=OFF -DWITH_demos=OFF -DWITH_examples=OFF \ - -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE + -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE mkdir -p shared/demo/CGAL_ipelets cd shared/demo/CGAL_ipelets && QTDIR= cmake ../../../demo/CGAL_ipelets \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ - -DCGAL_DIR=$(CURDIR)/shared + -DCGAL_DIR=$(CURDIR)/shared override_dh_auto_build: $(MAKE) -C static diff --git a/Maintenance/deb/wheezy/debian/README.Debian b/Maintenance/deb/wheezy/debian/README.Debian index 4be997664d7..e1056ac3ab7 100644 --- a/Maintenance/deb/wheezy/debian/README.Debian +++ b/Maintenance/deb/wheezy/debian/README.Debian @@ -44,7 +44,7 @@ and pass the option -DQGLVIEWER_INCLUDE_DIR=/some/dir -to cmake. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522659 for more +to cmake. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522659 for more information. -- Joachim Reichel Sat, 06 Feb 2010 12:29:02 +0100 diff --git a/Maintenance/deb/wheezy/debian/copyright b/Maintenance/deb/wheezy/debian/copyright index ecc6058b7dc..6390c1a2874 100644 --- a/Maintenance/deb/wheezy/debian/copyright +++ b/Maintenance/deb/wheezy/debian/copyright @@ -318,7 +318,7 @@ src/CGALCore and include/CGAL/CORE. Copyright (c) 1995-2004 Exact Computation Project All rights reserved. - This file is part of CORE (http://cs.nyu.edu/exact/core/). + This file is part of CORE (https://cs.nyu.edu/exact/core/). You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/Maintenance/deb/wheezy/debian/rules b/Maintenance/deb/wheezy/debian/rules index 4e3de31d8e9..a3533b8b2cb 100755 --- a/Maintenance/deb/wheezy/debian/rules +++ b/Maintenance/deb/wheezy/debian/rules @@ -2,7 +2,7 @@ # export DH_VERBOSE=1 -# See http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake +# See https://wiki.debian.org/Hardening#Notes_for_packages_using_CMake CFLAGS := $(CFLAGS) $(CPPFLAGS) CXXFLAGS := $(CXXFLAGS) $(CPPFLAGS) @@ -26,11 +26,11 @@ override_dh_auto_configure: cd shared && QTDIR= cmake .. \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ -DWITH_CGAL_Qt3=OFF -DWITH_demos=OFF -DWITH_examples=OFF \ - -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE + -DCGAL_ENABLE_PRECONFIG=OFF -DBUILD_SHARED_LIBS=TRUE -DCMAKE_SKIP_RPATH=TRUE mkdir -p shared/demo/CGAL_ipelets cd shared/demo/CGAL_ipelets && QTDIR= cmake ../../../demo/CGAL_ipelets \ -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ - -DCGAL_DIR=$(CURDIR)/shared + -DCGAL_DIR=$(CURDIR)/shared override_dh_auto_build: $(MAKE) -C static diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam index 60d4ad326c3..cb26334a389 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam @@ -2,13 +2,13 @@ # Copyright 2004 John Maddock # Copyright 2002, 2003, 2004, 2007 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) +# (See accompanying file LICENSE_1_0.txt or https://www.boost.org/LICENSE_1_0.txt) # This file is used to configure your Boost.Build installation. You can modify # this file in place, or you can place it in a permanent location so that it # does not get overwritten should you get a new version of Boost.Build. See: # -# http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html +# https://www.boost.org/build/doc/html/bbv2/overview/configuration.html # # for documentation about possible permanent locations. @@ -17,7 +17,7 @@ # example lines and adjust them to taste. The complete list of supported tools, # and configuration instructions can be found at: # -# http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html +# https://www.boost.org/build/doc/html/bbv2/reference/tools.html # # This file uses Jam language syntax to describe available tools. Mostly, @@ -31,7 +31,7 @@ # # More details about the syntax can be found at: # -# http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language +# https://www.boost.org/build/doc/html/jam/language.html # # ------------------ @@ -96,7 +96,7 @@ using gcc : : /usr/local/packages/gcc-4.5/bin/g++ ; using gcc : cxxdebug : "/usr/lib64/ccache/g++" # your path to the C++ compiler - : -D_GLIBCXX_DEBUG + : -D_GLIBCXX_DEBUG ; using gcc diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h index 8cfc61a0e88..1b633566c73 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h @@ -13,7 +13,7 @@ ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -25,7 +25,7 @@ ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qplugin.h b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qplugin.h index 559822a843e..d7e47535627 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qplugin.h +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-4.8_CXX0X/patch-qt-4.8/QtCore/qplugin.h @@ -13,7 +13,7 @@ ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -25,7 +25,7 @@ ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h index 8cfc61a0e88..1b633566c73 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qobjectdefs.h @@ -13,7 +13,7 @@ ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -25,7 +25,7 @@ ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qplugin.h b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qplugin.h index 559822a843e..d7e47535627 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qplugin.h +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-Fedora19_g++-trunk_CXX0X/patch-qt-4.8/QtCore/qplugin.h @@ -13,7 +13,7 @@ ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception @@ -25,7 +25,7 @@ ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and diff --git a/Maintenance/public_release/announcement/mailing-beta.eml b/Maintenance/public_release/announcement/mailing-beta.eml index e6de484eb6d..11b4295f32f 100644 --- a/Maintenance/public_release/announcement/mailing-beta.eml +++ b/Maintenance/public_release/announcement/mailing-beta.eml @@ -160,7 +160,7 @@ Most modules are distributed under the terms of the GPL Open Source license (GNU General Public License v3 or later versions). If your intended usage does not meet the criteria of the aforementioned licenses, a commercial license can be purchased from -GeometryFactory (http://www.geometryfactory.com/). +GeometryFactory (https://www.geometryfactory.com/). For further information and for downloading the library and its diff --git a/Maintenance/public_release/announcement/mailing.eml b/Maintenance/public_release/announcement/mailing.eml index 67f9e890a9e..23ea320c941 100644 --- a/Maintenance/public_release/announcement/mailing.eml +++ b/Maintenance/public_release/announcement/mailing.eml @@ -159,7 +159,7 @@ Most modules are distributed under the terms of the GPL Open Source license (GNU General Public License v3 or later versions). If your intended usage does not meet the criteria of the aforementioned licenses, a commercial license can be purchased from -GeometryFactory (http://www.geometryfactory.com/). +GeometryFactory (https://www.geometryfactory.com/). For further information and for downloading the library and its diff --git a/Maintenance/test_handling/create_testresult_page b/Maintenance/test_handling/create_testresult_page index ac7d8d5c28a..6a3632481b7 100755 --- a/Maintenance/test_handling/create_testresult_page +++ b/Maintenance/test_handling/create_testresult_page @@ -40,7 +40,7 @@ my @testresults; my $testresult_dir=cwd()."/TESTRESULTS"; # Inspired from -# http://cpansearch.perl.org/src/EDAVIS/Sort-Versions-1.5/Versions.pm +# https://metacpan.org/pod/Sort::Versions sub sort_releases($$) { # Take arguments in revert order: one wants to sort from the recent to @@ -596,7 +596,7 @@ sub print_little_header(){ my $release_version = substr($release_name, 5); print OUTPUT<<"EOF"; + "https://www.w3.org/TR/html4/strict.dtd"> @@ -622,14 +622,10 @@ Downloading internal releases

  • The doxygen documentation testpage (and the overview page)
  • +
  • +Diff of testsuites results
  • + EOF - if ( -r "announce.html" ) { - print OUTPUT<<"EOF"; -
  • Announcement of this release
  • -EOF - } - - print OUTPUT "\n"; } @@ -675,7 +671,7 @@ sub main() See the log here.

    - ">">Valid HTML 4.01 Strict

    diff --git a/Maintenance/test_handling/filter_testsuite/create_testresult_page b/Maintenance/test_handling/filter_testsuite/create_testresult_page index 399e57d5ddd..76ca849b01f 100755 --- a/Maintenance/test_handling/filter_testsuite/create_testresult_page +++ b/Maintenance/test_handling/filter_testsuite/create_testresult_page @@ -35,7 +35,7 @@ my @testresults; my $testresult_dir=cwd()."/TESTRESULTS"; # Inspired from -# http://cpansearch.perl.org/src/EDAVIS/Sort-Versions-1.5/Versions.pm +# https://metacpan.org/pod/Sort::Versions sub sort_releases($$) { # Take arguments in revert order: one wants to sort from the recent to @@ -591,7 +591,7 @@ sub print_little_header(){ my $release_version = substr($release_name, 5); print OUTPUT<<"EOF"; + "https://www.w3.org/TR/html4/strict.dtd"> @@ -665,7 +665,7 @@ sub main() See the log here.

    - ">">Valid HTML 4.01 Strict

    diff --git a/Matrix_search/doc/Matrix_search/PackageDescription.txt b/Matrix_search/doc/Matrix_search/PackageDescription.txt index 8ec5cfdffcb..202989f2da3 100644 --- a/Matrix_search/doc/Matrix_search/PackageDescription.txt +++ b/Matrix_search/doc/Matrix_search/PackageDescription.txt @@ -23,24 +23,17 @@ This chapter describes concepts, classes, and functions for monotone and sorted matrix search. -\cgalCRPSection{Assertions} - -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks "Checks" in the chapter on STL extensions. \cgalClassifedRefPages -- `CGAL::monotone_matrix_search` +- `CGAL::monotone_matrix_search()` - `CGAL::Dynamic_matrix` - `MonotoneMatrixSearchTraits` - `BasicMatrix` -- `CGAL::sorted_matrix_search` +- `CGAL::sorted_matrix_search()` - `CGAL::Sorted_matrix_search_traits_adaptor` - `SortedMatrixSearchTraits` */ - diff --git a/Matrix_search/include/CGAL/Cartesian_matrix.h b/Matrix_search/include/CGAL/Cartesian_matrix.h index d3ad276a715..1aa192ab2c8 100644 --- a/Matrix_search/include/CGAL/Cartesian_matrix.h +++ b/Matrix_search/include/CGAL/Cartesian_matrix.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { @@ -67,8 +67,8 @@ public: Value operator()(int r, int c) const { - CGAL_optimisation_precondition(r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition(c >= 0 && c < number_of_columns()); + CGAL_precondition(r >= 0 && r < number_of_rows()); + CGAL_precondition(c >= 0 && c < number_of_columns()); return op(row_vec[r], column_vec[c]); } diff --git a/Matrix_search/include/CGAL/Dynamic_matrix.h b/Matrix_search/include/CGAL/Dynamic_matrix.h index 83b9063cf3e..2ae86317ebb 100644 --- a/Matrix_search/include/CGAL/Dynamic_matrix.h +++ b/Matrix_search/include/CGAL/Dynamic_matrix.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace CGAL { @@ -56,8 +56,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition( r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition( c >= 0 && c < number_of_columns()); + CGAL_precondition( r >= 0 && r < number_of_rows()); + CGAL_precondition( c >= 0 && c < number_of_columns()); return (*matrix)( r << row_power, column_indices[c]); } @@ -70,18 +70,18 @@ public: void replace_column( int o, int n) { - CGAL_optimisation_precondition( o >= 0 && o < number_of_columns()); - CGAL_optimisation_precondition( n >= 0 && n < number_of_columns()); + CGAL_precondition( o >= 0 && o < number_of_columns()); + CGAL_precondition( n >= 0 && n < number_of_columns()); column_indices[o] = column_indices[n]; } void shrink_to_quadratic_size() { - CGAL_optimisation_precondition( number_of_columns() >= number_of_rows()); + CGAL_precondition( number_of_columns() >= number_of_rows()); column_indices.erase( column_indices.begin() + number_of_rows(), column_indices.end()); - CGAL_optimisation_postcondition( number_of_columns() == number_of_rows()); + CGAL_postcondition( number_of_columns() == number_of_rows()); } private: diff --git a/Matrix_search/include/CGAL/Transform_iterator.h b/Matrix_search/include/CGAL/Transform_iterator.h index c3ab6e8c437..18d4f9986ab 100644 --- a/Matrix_search/include/CGAL/Transform_iterator.h +++ b/Matrix_search/include/CGAL/Transform_iterator.h @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/Matrix_search/include/CGAL/monotone_matrix_search.h b/Matrix_search/include/CGAL/monotone_matrix_search.h index 4f527634e70..ae1bd6f4ce9 100644 --- a/Matrix_search/include/CGAL/monotone_matrix_search.h +++ b/Matrix_search/include/CGAL/monotone_matrix_search.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -57,9 +57,9 @@ monotone_matrix_search( // ------ // get even rows of M: Matrix* M_new = M.extract_all_even_rows(); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_columns() == M.number_of_columns()); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_rows() == 0 || M_new->number_of_rows() == ( M.number_of_rows() + 1) >> 1); @@ -75,7 +75,7 @@ monotone_matrix_search( reduction_table[M_new->number_of_rows()] = M.number_of_columns() - 1; _reduce_matrix( *M_new, reduction_table, compare_strictly); - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_columns() == M_new->number_of_rows()); } // if ( M_new->number_of_rows() < M_new->number_of_columns()) @@ -92,7 +92,7 @@ monotone_matrix_search( // recursion: - CGAL_optimisation_assertion( + CGAL_assertion( M_new->number_of_rows() >= M_new->number_of_columns()); // table to store the rmax values of M_new: @@ -160,7 +160,7 @@ _reduce_matrix( // and returns for each column of the resulting // matrix its column index in the original matrix { - CGAL_optimisation_precondition( + CGAL_precondition( M.number_of_columns() >= M.number_of_rows()); // active columns are 0, ..., j1, j2, ..., M.x_dim()-1 int j1( 0), j2( 1); @@ -191,7 +191,7 @@ _reduce_matrix( // have been deleted, now move columns // j2 .. M.number_of_columns()-1 to the first part while ( j1 < M.number_of_rows() - 1) { - CGAL_optimisation_assertion( j2 < M.number_of_columns()); + CGAL_assertion( j2 < M.number_of_columns()); M.replace_column( ++j1, j2); *(t+j1) = j2++; } diff --git a/Matrix_search/include/CGAL/sorted_matrix_search.h b/Matrix_search/include/CGAL/sorted_matrix_search.h index dd21234b4f5..d481ce8c07a 100644 --- a/Matrix_search/include/CGAL/sorted_matrix_search.h +++ b/Matrix_search/include/CGAL/sorted_matrix_search.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include #include @@ -159,13 +159,13 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) Cell_container active_cells; // set of input matrices must not be empty: - CGAL_optimisation_precondition( f != l); + CGAL_precondition( f != l); // for each input matrix insert a cell into active_cells: InputIterator i( f); int maxdim( -1); while ( i != l) { - CGAL_optimisation_expensive_precondition( + CGAL_expensive_precondition( PaddedMatrix( *i).is_sorted()); active_cells.push_back( Cell( PaddedMatrix( *i))); maxdim = max BOOST_PREVENT_MACRO_SUBSTITUTION ( max BOOST_PREVENT_MACRO_SUBSTITUTION ( (*i).number_of_columns(), @@ -173,7 +173,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) maxdim); ++i; } - CGAL_optimisation_precondition( maxdim > 0); + CGAL_precondition( maxdim > 0); // current cell dimension: @@ -239,7 +239,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) break; // there has to be at least one cell left: - CGAL_optimisation_assertion( active_cells.size() > 0); + CGAL_assertion( active_cells.size() > 0); // ------------------------------------------------------ // compute medians of smallest and largest elements: @@ -285,7 +285,7 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) { return equal_to< Value >()(lower_median, Cell_min< Cell >()(c)); }); - CGAL_optimisation_assertion(lower_median_cell != active_cells.end()); + CGAL_assertion(lower_median_cell != active_cells.end()); // ------------------------------------------------------ // test feasibility of medians and remove cells accordingly: Cell_iterator new_end; @@ -385,8 +385,8 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t) } // for (;;) // there must be only one cell left: - CGAL_optimisation_assertion( active_cells.size() == 1); - CGAL_optimisation_assertion( ccd == 1); + CGAL_assertion( active_cells.size() == 1); + CGAL_assertion( ccd == 1); return ((*active_cells.begin()).min)(); } diff --git a/Matrix_search/package_info/Matrix_search/dependencies b/Matrix_search/package_info/Matrix_search/dependencies index 226536b676a..50ab94de3e7 100644 --- a/Matrix_search/package_info/Matrix_search/dependencies +++ b/Matrix_search/package_info/Matrix_search/dependencies @@ -5,7 +5,6 @@ Kernel_23 Matrix_search Modular_arithmetic Number_types -Optimisation_basic Profiling_tools STL_Extension Stream_support diff --git a/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h deleted file mode 100644 index 060cb8994e8..00000000000 --- a/Mesh_2/doc/Mesh_2/CGAL/lloyd_optimize_mesh_2.h +++ /dev/null @@ -1,119 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh2Functions - -The function `lloyd_optimize_mesh_2()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are not moved. - -\tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, -with vertex base and face base of its underlying `TriangulationDataStructure_2` -being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. -The argument `cdt`, passed by reference, provides the initial mesh -and is modified by the algorithm to represent the final optimized mesh. - -\tparam PointIterator must be an iterator with value type `Kernel::Point_2` - -The function has several optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `CGAL::Timer`. -The default value is 0 and means that there is no time limit. -\pre `time_limit` \f$ \geq\f$ 0 - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. -\pre `max_iteration_number`\f$ \geq\f$ 0 - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given fraction of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. -\pre 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 - -- `parameters::freeze_bound` is designed to reduce running time of each -optimization iteration. Any vertex that has a displacement less than a given -fraction of the length of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. -The default value is 0.001. If it is set to 0, freezing of vertices is disabled. -\pre 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -- `parameters::seeds_begin` and `parameters::seeds_end` -are begin and end input iterators to iterate on seed points. -The sequence [`parameters::seeds_begin`, `parameters::seeds_end`) -defines the domain in which the mesh was generated, and should be optimized. - -- `parameters::mark`. If `mark` is set to true, the mesh domain -is the union of the bounded connected components including at least one seed. -If `mark` is false, the domain is the union of the bounded components including -no seed. Note that the unbounded component of the plane is never optimized. -The default value is false. - - - - -\return -The function `lloyd_optimize_mesh_2()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
      -
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
    • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_2()` stops because it has performed `max_iteration_number` iterations. -
    • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_2()` stops because the convergence criterion -is met. -
    • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`freeze_bound` parameter is set to a positive value. -
    • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_2()` stops because -most vertices have been frozen, and no better convergence can be reached. -
    - -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// move less than 0.001*shortest_incident_edge_length -lloyd_optimize_mesh_2(cdt, - parameters::convergence=0.01, - parameters::freeze_bound=0.001); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::refine_Delaunay_mesh_2()` - -*/ - -template -CGAL::Mesh_optimization_return_code -lloyd_optimize_mesh_2(CDT& cdt, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.001, - double parameters::freeze_bound = 0.001, - PointIterator parameters::seeds_begin = PointIterator(), - PointIterator parameters::seeds_end = PointIterator(), - bool parameters::mark = false); - -} /* namespace CGAL */ diff --git a/Mesh_2/doc/Mesh_2/Doxyfile.in b/Mesh_2/doc/Mesh_2/Doxyfile.in index 06825acdea6..a277235f466 100644 --- a/Mesh_2/doc/Mesh_2/Doxyfile.in +++ b/Mesh_2/doc/Mesh_2/Doxyfile.in @@ -1,3 +1,4 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 2D Conforming Triangulations and Meshes" +INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_2.h diff --git a/Mesh_2/doc/Mesh_2/Mesh_2.txt b/Mesh_2/doc/Mesh_2/Mesh_2.txt index 4ccab5bedb4..7d31bb1fc85 100644 --- a/Mesh_2/doc/Mesh_2/Mesh_2.txt +++ b/Mesh_2/doc/Mesh_2/Mesh_2.txt @@ -278,6 +278,7 @@ After Delaunay refinement, angles are in the interval [28.5; 121.9] degrees. After 10 iterations of Lloyd optimization, they are in [29.1; 110.8]. 100 iterations take them to [29.3; 109.9]. \cgalFigureEnd +As of \cgal 5.6, `lloyd_optimize_mesh_2()` uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. \subsection Mesh_2Examples Examples diff --git a/Mesh_2/doc/Mesh_2/dependencies b/Mesh_2/doc/Mesh_2/dependencies index 0c0f7765312..5ef261da50f 100644 --- a/Mesh_2/doc/Mesh_2/dependencies +++ b/Mesh_2/doc/Mesh_2/dependencies @@ -4,5 +4,5 @@ STL_Extension Algebraic_foundations Circulator Stream_support -Triangulation_2 BGL +Triangulation_2 diff --git a/Mesh_2/examples/Mesh_2/mesh_optimization.cpp b/Mesh_2/examples/Mesh_2/mesh_optimization.cpp index 81fda66fe61..d52e882a065 100644 --- a/Mesh_2/examples/Mesh_2/mesh_optimization.cpp +++ b/Mesh_2/examples/Mesh_2/mesh_optimization.cpp @@ -52,8 +52,9 @@ int main() std::cout << "Run Lloyd optimization..."; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = 10); + CGAL::parameters::number_of_iterations(10)); std::cout << " done." << std::endl; + std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl; } diff --git a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h index 3a49d756a71..fe4d4fd9869 100644 --- a/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h +++ b/Mesh_2/include/CGAL/Constrained_Delaunay_triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h b/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h index b03ca56d811..eb61e4bf50a 100644 --- a/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h +++ b/Mesh_2/include/CGAL/Constrained_voronoi_diagram_2.h @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace CGAL { @@ -415,8 +416,8 @@ template Cvd_cell_2 dual(const Tr& tr, const typename Tr::Vertex_handle& v) { - CGAL_triangulation_precondition( v != typename Tr::Vertex_handle()); - CGAL_triangulation_precondition( !tr.is_infinite(v)); + CGAL_precondition( v != typename Tr::Vertex_handle()); + CGAL_precondition( !tr.is_infinite(v)); Constrained_voronoi_diagram_2 diagram(tr); return diagram.cvd_cell(v); @@ -436,8 +437,8 @@ Cvd_cell_2 dual(const Tr& tr, // typedef Tr::Geom_traits::Ray_2 Ray; // typedef Tr::Geom_traits::Vector_2 Vector_2; // -// CGAL_triangulation_precondition( v != Vertex_handle()); -// CGAL_triangulation_precondition( !tr.is_infinite(v)); +// CGAL_precondition( v != Vertex_handle()); +// CGAL_precondition( !tr.is_infinite(v)); // // // The Circulator moves ccw. // std::vector segments; diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_2.h index ac01fe0e68d..f2dc490f3f2 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_2.h @@ -29,7 +29,7 @@ template class Delaunay_mesher_2 { - /** \name \c Tr types */ + /** \name `Tr` types */ typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Face_handle Face_handle; typedef typename Tr::Edge Edge; @@ -118,10 +118,10 @@ private: public: /** \name MARKING FUNCTIONS */ - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. Connected components of seeds are marked with the value of - \a mark. Other components are marked with \c !mark. The connected - component of infinite faces is always marked with \c false. + \a mark. Other components are marked with `!mark`. The connected + component of infinite faces is always marked with `false`. */ template void set_seeds(InputIterator b, InputIterator e, @@ -190,7 +190,7 @@ public: propagate_marks(tr.infinite_face(), false); } - /** Propagates the mark \c mark recursively. */ + /** Propagates the mark `mark` recursively. */ static void propagate_marks(const Face_handle fh, bool mark) { // std::queue only works with std::list on VC++6, and not with diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h index 583929efe30..9caf4f52b7b 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h @@ -26,7 +26,7 @@ template class Delaunay_mesher_no_edge_refinement_2 { - /** \name \c Tr types */ + /** \name `Tr` types */ typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Face_handle Face_handle; typedef typename Tr::Edge Edge; @@ -109,10 +109,10 @@ private: public: /** \name MARKING FUNCTIONS */ - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. Connected components of seeds are marked with the value of - \a mark. Other components are marked with \c !mark. The connected - component of infinite faces is always marked with \c false. + \a mark. Other components are marked with `!mark`. The connected + component of infinite faces is always marked with `false`. */ template void set_seeds(InputIterator b, InputIterator e, @@ -181,7 +181,7 @@ public: propagate_marks(tr.infinite_face(), false); } - /** Propagates the mark \c mark recursivly. */ + /** Propagates the mark `mark` recursivly. */ static void propagate_marks(const Face_handle fh, bool mark) { // std::queue only works with std::list on VC++6, and not with diff --git a/Mesh_2/include/CGAL/Mesh_2/Clusters.h b/Mesh_2/include/CGAL/Mesh_2/Clusters.h index 7ac17276f29..93a42015025 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Clusters.h @@ -70,7 +70,7 @@ public: /** \name Clusters public types */ /** - * \c Cluster register several informations about clusters. + * `Cluster` register several informations about clusters. * A cluster is a set of vertices v_i incident to one vertice * v_0, so that angles between segments [v_0, v_i] is less than 60 * degres. @@ -127,7 +127,7 @@ private: Tr& tr; /**< The triangulation itself. */ /** - * Multimap \c Vertex_handle -> \c Cluster + * Multimap `Vertex_handle -> Cluster` * Each vertex can have several clusters. */ Cluster_map cluster_map; @@ -178,14 +178,14 @@ public: private: /** - * Computes clusters of the vertex \c v, using the auxiliary function + * Computes clusters of the vertex `v`, using the auxiliary function * construct_cluster(). */ void create_clusters_of_vertex(const Vertex_handle v); /** - * Adds the sequence [\c begin, \c end] to the cluster \c c and adds it - * to the clusters of the vertex \c v. + * Adds the sequence `[begin, end]` to the cluster `c` and adds it + * to the clusters of the vertex `v`. */ void construct_cluster(const Vertex_handle v, const Constrained_edge_circulator& begin, @@ -196,7 +196,7 @@ public: /** \name Functions to manage clusters during the refinement process. */ /** - * Update the cluster of [\c va,\c vb], putting \c vm instead of \c vb. + * Updates the cluster of `[va,vb]`, putting `vm` instead of `vb`. * If reduction=false, the edge [va,vm] is not set reduced. */ void update_cluster(Cluster& c, iterator it, @@ -205,8 +205,8 @@ public: bool reduction = true); /** - * Returns the cluster of [\c va,\c vb] in \c c and return true - * if it is in a cluster. Returns also a const_iterator in \c it. + * Returns the cluster of `[va,vb]` in `c` and return true + * if it is in a cluster. Returns also a const_iterator in `it`. */ bool get_cluster(const Vertex_handle va, const Vertex_handle vb, Cluster& c, iterator& it); diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 0ffcca179cc..4c6dacd7802 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -21,7 +21,7 @@ #define CGAL_MESH_2_OPTIMIZER_VERBOSE #endif -#include +#include #include #include #include @@ -92,7 +92,7 @@ public: void set_time_limit(double time) { time_limit_ = time; } double time_limit() const { return time_limit_; } - /** The value type of \a InputIterator should be \c Point, and represents + /** The value type of \a InputIterator should be `Point`, and represents seeds. */ template @@ -108,7 +108,7 @@ public: } } - Mesh_optimization_return_code operator()(const int nb_iterations) + Mesh_optimization_return_code operator()(const std::size_t nb_iterations) { running_time_.reset(); running_time_.start(); @@ -141,7 +141,7 @@ public: bool convergence_stop = false; // Iterate - int i = -1; + std::size_t i = -1; while ( ++i < nb_iterations && ! is_time_limit_reached() ) { this->before_move(); @@ -222,7 +222,7 @@ public: private: /** - * Returns moves for vertices of set \c moving_vertices + * Returns moves for vertices of set `moving_vertices`. */ Moves_vector compute_moves(Vertex_set& moving_vertices) { @@ -260,7 +260,7 @@ private: } /** - * Returns the move for vertex \c v + * Returns the move for vertex `v`. */ Vector_2 compute_move(const Vertex_handle& v) { @@ -284,7 +284,7 @@ private: } /** - * Returns the minimum cicumradius length of faces incident to \c v + * Returns the minimum cicumradius length of faces incident to `v`. */ FT min_sq_circumradius(const Vertex_handle& v) const { @@ -395,8 +395,8 @@ private: seeds_.end(), seeds_mark_/*faces that are not in domain are tagged false*/); //Connected components of seeds are marked with the value of - // \a mark. Other components are marked with \c !mark. The connected - // component of infinite faces is always marked with \c false. + // \a mark. Other components are marked with `!mark`. The connected + // component of infinite faces is always marked with `false`. } void after_all_moves() @@ -464,7 +464,7 @@ private: bool seeds_mark_; double time_limit_; - CGAL::Timer running_time_; + CGAL::Real_timer running_time_; std::list big_moves_; diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h index 94236ba7ea0..b37602a8b57 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_sizing_field.h @@ -57,20 +57,20 @@ public: } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Point_2& p) const { return this->operator()(p, last_face_); } /** - * Returns size at point \c p, using \c v to accelerate \c p location + * Returns size at point `p`, using `v` to accelerate `p` location * in triangulation */ FT operator()(const Point_2& p, const Vertex_handle& v) const { return this->operator()(p, v->face()); } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Point_2& p, const Face_handle& c) const { @@ -99,7 +99,7 @@ public: private: /** - * Returns size at point \c p, by interpolation inside facet + * Returns size at point `p`, by interpolation inside facet. */ FT interpolate_on_face_vertices(const Point_2& #ifdef CGAL_MESH_2_SIZING_FIELD_USE_BARYCENTRIC_COORDINATES @@ -128,8 +128,8 @@ private: } /** - * Returns size at point \c p, by interpolation inside edge - * (\c e f is assumed to be an infinite face) + * Returns size at point `p`, by interpolation inside edge + * (`f` is assumed to be an infinite face) */ FT interpolate_on_edge_vertices(const Point_2& #ifdef CGAL_MESH_2_SIZING_FIELD_USE_BARYCENTRIC_COORDINATES diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 8f2cf435d60..94a585cf134 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -41,7 +41,7 @@ namespace Mesh_2 { namespace details { - /** This class defines several auxiliary types for \c Refine_edges. */ + /** This class defines several auxiliary types for `Refine_edges`. */ template struct Refine_edges_base_types { @@ -50,7 +50,7 @@ namespace Mesh_2 { typedef std::pair Constrained_edge; - /** Object predicate that tests if a given \c Constrained_Edge is + /** Object predicate that tests if a given `Constrained_Edge` is really an edge of the triangulation and is constrained. */ class Is_a_constrained_edge { @@ -98,7 +98,7 @@ namespace Mesh_2 { typedef typename Tr::Point Point; typedef typename Tr::Geom_traits Geom_traits; - /** Operator that takes an edge (\c fh, \c index). */ + /** Operator that takes an edge (`fh`, `index`). */ bool operator()(const Tr& tr, const Face_handle& fh, const int i) const @@ -117,7 +117,7 @@ namespace Mesh_2 { ); } - /** Operator that takes an edge (\c va, \c vb). */ + /** Operator that takes an edge (`va`, `vb`). */ bool operator()(const Tr& tr, const Vertex_handle& va, const Vertex_handle& vb) const @@ -132,7 +132,7 @@ namespace Mesh_2 { } /** - * Operator that takes an edge (\c fh, \c index) and a point \c p. + * Operator that takes an edge (`fh`, `index`) and a point `p`. * Tests if the point encroached the edge. */ bool operator()(const Tr& tr, @@ -147,7 +147,7 @@ namespace Mesh_2 { } /** - * Operator that takes an edge (\c va, \c vb) and a point \c p. + * Operator that takes an edge (`va`, `vb`) and a point `p`. * Tests if the point encroached the edge. */ bool operator()(const Tr& tr, @@ -179,7 +179,7 @@ namespace Mesh_2 { typedef typename Tr::Point Point; typedef typename Tr::Geom_traits Geom_traits; - /** Operator that takes an edge (\c fh, \c index). */ + /** Operator that takes an edge (`fh`, `index`). */ bool operator()(const Tr& tr, const Face_handle& fh, const int i) const @@ -197,7 +197,7 @@ namespace Mesh_2 { return aux_outside_of_circle(tr, vi, vb, va, mvi); } - /** Operator that takes an edge (\c va, \c vb). */ + /** Operator that takes an edge (`va`, `vb`). */ bool operator()(const Tr& tr, const Vertex_handle& va, const Vertex_handle& vb) const @@ -269,7 +269,7 @@ namespace Mesh_2 { * \param Is_locally_conform defines the locally conform criterion: Gabriel * or Delaunay. It defaults to the Garbriel criterion. * \param Container is the type of container. It defaults to a filtered - * queue of \c Vertex_handle pair (see \c Filtered_queue_container). + * queue of `Vertex_handle` pair (see `Filtered_queue_container`). */ template < class Tr, @@ -615,7 +615,7 @@ public: protected: /** \name Auxiliary functions */ - /** Add an \c Edge \c e in the queue. */ + /** Add an edge `e` in the queue. */ void add_constrained_edge_to_be_conformed(const Edge& e) { const Vertex_handle& va = e.first->vertex(tr. cw(e.second)); @@ -624,7 +624,7 @@ protected: // base class } - /** Add an edge (\c va,\c vb) in the queue. */ + /** Add an edge `(va, vb)` in the queue. */ void add_constrained_edge_to_be_conformed(const Vertex_handle& va, const Vertex_handle& vb) { diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h index 442ab8b3ff4..e6efb736235 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_visitor.h @@ -65,7 +65,7 @@ public: Null_mesh_visitor previous_level() const { return null_mesh_visitor; } /** - * Store vertex handles and markers at left and right of the edge \c e. + * Store vertex handles and markers at left and right of the edge `e`. */ void before_conflicts(const Edge& e, const Point&) { @@ -84,7 +84,7 @@ public: faces_mesher.before_insertion_impl(Face_handle(), p, z); } - /** Restore markers in the star of \c v. */ + /** Restore markers in the star of `v`. */ void after_insertion(const Vertex_handle& v) { Tr& tr = faces_mesher.triangulation_ref_impl(); diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h index 827a7dc7557..889403114c4 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges_with_clusters.h @@ -27,13 +27,13 @@ namespace Mesh_2 { /** * This class is the base for the first level of Mesh_2: the edge * conforming level. It \e does handle clusters. - * To handle clusters, an helping \c Clusters object is used. + * To handle clusters, an helping `Clusters` object is used. * * \param Tr is the type of triangulation on which the level acts. * \param Is_locally_conform defines the locally conform criterion: Gabriel * or Delaunay. It defaults to the Garbriel criterion. * \param Container is the type of container. It defaults to a filtered - * queue of \c Vertex_handle pair (see \c Filtered_queue_container). + * queue of `Vertex_handle` pair (see `Filtered_queue_container`). */ template < class Tr, diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h index 1d7126e80e9..f5e9dfc41c4 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_faces.h @@ -212,7 +212,7 @@ public: } } - /** Restore markers in the star of \c v. */ + /** Restore markers in the star of `v`. */ void after_insertion_impl(const Vertex_handle& v) { #ifdef CGAL_MESH_2_VERBOSE @@ -254,11 +254,11 @@ public: Mesh_2::Face_badness is_bad(Quality q) const; /** - * Adds the sequence [\c begin, \c end[ to the list + * Adds the sequence `[begin, end[` to the list * of bad faces. * Use this overriden function if the list of bad faces can be * computed easily without testing all faces. - * \param Fh_it is an iterator of \c Face_Handle. + * \param Fh_it is an iterator of `Face_Handle`. */ template void set_bad_faces(Fh_it begin, Fh_it end) diff --git a/Mesh_2/include/CGAL/Triangulation_conformer_2.h b/Mesh_2/include/CGAL/Triangulation_conformer_2.h index 6993cbf24dd..28e8c5868e3 100644 --- a/Mesh_2/include/CGAL/Triangulation_conformer_2.h +++ b/Mesh_2/include/CGAL/Triangulation_conformer_2.h @@ -38,10 +38,10 @@ protected: /** \name INITIALIZED */ enum Initialization { - NONE, /**< \c this is not initialized. */ - CLUSTERS, /**< \c this clusters are initialized. */ - DELAUNAY, /**< \c this has been \e Delaunay-initialized. */ - GABRIEL /**< \c this has been \e Gabriel-initialized. */ + NONE, /**< `this` is not initialized. */ + CLUSTERS, /**< `this` clusters are initialized. */ + DELAUNAY, /**< `this` has been \e Delaunay-initialized. */ + GABRIEL /**< `this` has been \e Gabriel-initialized. */ }; // --- PROTECTED DATAS --- diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 56f9d84b16e..fe7a7c321ac 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -15,61 +15,168 @@ #include -#include - #include #include #include #include #include -#include -#include + +#include #include -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - namespace CGAL { -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif +/*! + * @ingroup PkgMesh2Functions + * + * The function `lloyd_optimize_mesh_2()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `lloyd_optimize_mesh_2()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear + * in each cell of the Voronoi diagram of the mesh vertices. + * + * The optimizer `lloyd_optimize_mesh_2()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are not moved. + * + * @tparam CDT is required to be or derive from `CGAL::Constrained_Delaunay_triangulation_2`, + * with vertex base and face base of its underlying `TriangulationDataStructure_2` + * being models of `DelaunayMeshVertexBase_2` and `DelaunayMeshFaceBase_2`, respectively. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param cdt the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{seeds} + * \cgalParamDescription{2D points used to define the domain to mesh. + * If `seeds_are_in_domain==true`, the mesh domain is the union of + * the bounded connected components including at least + * one seed. If `seeds_are_in_domain==false`, the domain is the + * union of the bounded components including no seed.} + * \cgalParamType{a class model of `ConstRange` whose iterator is a model of `InputIterator` with `CDT::Point_2` as value type.} + * \cgalParamDefault{No seed.} + * \cgalParamNEnd + * + * \cgalParamNBegin{seeds_are_in_domain} + * \cgalParamDescription{specified if seeds indicate bounded connected components inside or outside of the domain.} + * \cgalParamType{`bool`} + * \cgalParamDefault{false} + * \cgalParamNEnd + * + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamPrecondition{`max_iteration_number >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{CPU time limit (in seconds) after which the optimization process is stopped. + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit` \f$ \geq\f$ 0} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * + * \cgalParamNBegin{convergence} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamPrecondition{`0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.001} + * \cgalParamNEnd + * + * \cgalNamedParamsEnd + * + * @returns an enum value providing some information about the outcome of the algorithm. + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::refine_Delaunay_mesh_2()` + */ +template +Mesh_optimization_return_code +lloyd_optimize_mesh_2(CDT& cdt, const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using parameters::choose_parameter; + using parameters::get_parameter; + using parameters::get_parameter_reference; + using parameters::is_default_parameter; - BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_mesh_2, - parameters::tag, - (required (in_out(cdt),*)) - (optional - (max_iteration_number_, *, 0 ) - (convergence_, *, 0.001 ) - (time_limit_, *, 0. ) - (freeze_bound_, *, 0.001 ) - (seeds_begin_, *, CGAL::Emptyset_iterator())//see comments below - (seeds_end_, *, CGAL::Emptyset_iterator())//see comments below - (mark_, *, false) //if "false", seeds indicate "outside" regions - ) - ) + std::size_t max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.001); + const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), 0.001); + const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); + // Seeds + // { + typedef std::vector Default_seeds; + typedef typename internal_np::Lookup_named_param_def::reference Seeds; + Default_seeds ds; + Seeds seeds = choose_parameter(get_parameter_reference(np, internal_np::seeds), ds); + // } + const bool mark = choose_parameter(get_parameter(np, internal_np::seeds_are_in_domain), false); + + if (is_default_parameter::value || + is_default_parameter::value) { return lloyd_optimize_mesh_2_impl(cdt, - max_iteration_number_, - convergence_, - freeze_bound_, - time_limit_, - seeds_begin_, - seeds_end_, - mark_); + max_iterations, + convergence_ratio, + freeze_bound, + time_limit, + seeds.begin(), + seeds.end(), + mark); } + else + { + return lloyd_optimize_mesh_2_impl(cdt, + max_iterations, + convergence_ratio, + freeze_bound, + time_limit, + choose_parameter(get_parameter(np, internal_np::i_seed_begin_iterator), CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::i_seed_end_iterator), CGAL::Emptyset_iterator()), + mark); + } +} -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING + // Overload handling parameters passed with operator= + template + Mesh_optimization_return_code + lloyd_optimize_mesh_2(CDT& cdt, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return lloyd_optimize_mesh_2(cdt, internal_np::combine_named_parameters(np1, np2, nps...)); + } /** * this partial specialization is a workaround @@ -83,7 +190,7 @@ namespace CGAL template Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, - const int max_iterations, + const std::size_t max_iterations, const double convergence_ratio, const double freeze_bound, const double time_limit, @@ -99,7 +206,7 @@ namespace CGAL template Mesh_optimization_return_code lloyd_optimize_mesh_2_impl(CDT& cdt, - const int max_iterations, + const std::size_t max_iterations, const double convergence_ratio, const double freeze_bound, const double time_limit, @@ -124,7 +231,7 @@ namespace CGAL #endif // 1000 iteration max to avoid infinite loop - int nb_iterations = (0 == max_iterations) + std::size_t nb_iterations = (0 == max_iterations) ? 1000 : max_iterations; @@ -139,11 +246,8 @@ namespace CGAL return rc; } +#endif // DOXYGEN_RUNNING } //end namespace CGAL -CGAL_PRAGMA_DIAG_POP - -#include - #endif diff --git a/Mesh_2/package_info/Mesh_2/dependencies b/Mesh_2/package_info/Mesh_2/dependencies index a0eb105c10e..8e839394994 100644 --- a/Mesh_2/package_info/Mesh_2/dependencies +++ b/Mesh_2/package_info/Mesh_2/dependencies @@ -1,5 +1,4 @@ Algebraic_foundations -BGL Circulator Distance_2 Hash_map diff --git a/Mesh_2/test/Mesh_2/test_double_map.cpp b/Mesh_2/test/Mesh_2/test_double_map.cpp index 7ef6a121834..f7f82d21647 100644 --- a/Mesh_2/test/Mesh_2/test_double_map.cpp +++ b/Mesh_2/test/Mesh_2/test_double_map.cpp @@ -12,7 +12,7 @@ typedef CGAL::Double_map Map; int main(int argc, char** argv) { - unsigned int number_of_elements = 500; + int number_of_elements = 500; #ifdef CGAL_USE_BOOST_BIMAP std::cerr << "(Using the \"Boost.Bimap implementation\" of ...)\n\n"; @@ -58,14 +58,14 @@ int main(int argc, char** argv) assert(f.empty() && f2.empty()); /* AUTOMATIC CHECKS */ std::cerr << "Filling f with " << number_of_elements << " random integers...\n"; - for(unsigned int n=0; nsecond; @@ -152,7 +152,7 @@ int main(int argc, char** argv) assert(counter==number_of_elements); std::cerr << "Filling f with f(i)=i*i, i=0.." << number_of_elements -1 << "...\n"; - for(unsigned int n=0; n #include @@ -54,6 +56,50 @@ struct Lloyd_tester cdt.number_of_vertices() <= 640 ); + const size_type number_of_constraints = number_of_constrained_edges(cdt); + const size_type number_of_vertices1 = cdt.number_of_vertices(); + + CGAL::Mesh_optimization_return_code rc + = CGAL::lloyd_optimize_mesh_2(cdt, + CGAL::parameters::number_of_iterations(10). + convergence(0.001). + freeze_bound(0.001). + seeds(seeds)); + const size_type number_of_vertices2 = cdt.number_of_vertices(); + std::cerr << " done (return code = "<< rc <<").\n"; + std::cerr << "Number of vertices: " << number_of_vertices2 << "\n\n"; + + assert( cdt.is_valid() ); + assert( number_of_vertices1 == number_of_vertices2 ); + assert( number_of_constraints == number_of_constrained_edges(cdt)); + } +}; + +struct Lloyd_tester_original_BP_API +{ + void operator()(CDT& cdt) const + { + std::vector seeds; + seeds.reserve(32); + + std::cerr << "Reading fish-and-rectangle.poly..."; + std::ifstream poly_file("fish-and-rectangle.poly"); + CGAL::IO::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); + assert( cdt.is_valid() ); + + std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() + << "\nNumber of seeds: " << seeds.size() << "\n\n"; + + std::cerr << "Meshing the triangulation with size 0.1..."; + CGAL::refine_Delaunay_mesh_2(cdt, + CGAL::parameters::seeds(seeds). + criteria(Criteria(0.125, 0.1))); + std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() << "\n\n"; + assert( cdt.is_valid() ); + assert( 580 <= cdt.number_of_vertices() && + cdt.number_of_vertices() <= 640 ); + + const size_type number_of_constraints = number_of_constrained_edges(cdt); const size_type number_of_vertices1 = cdt.number_of_vertices(); @@ -80,5 +126,11 @@ int main() CDT cdt; Lloyd_tester tester; tester(cdt); + + std::cerr << "TESTING lloyd_optimize_mesh_2 with Epick (original Boost Parameter API)...\n\n"; + cdt = CDT(); + Lloyd_tester_original_BP_API tester_bis; + tester_bis(cdt); + return 0; } diff --git a/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp b/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp index 88b379f1a1f..ef11be72b58 100644 --- a/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp +++ b/Mesh_2/test/Mesh_2/test_mesh_opti_projection_traits.cpp @@ -54,7 +54,7 @@ int main() std::cout << "Run Lloyd optimization..."; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = 10); + CGAL::parameters::number_of_iterations(10)); std::cout << " done." << std::endl; std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl; diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index e28abce381a..a07ee4b3f16 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -253,7 +253,6 @@ #include #include //#include -//#include //#include //#include //#include diff --git a/Mesh_3/benchmark/Mesh_3/concurrency.cpp b/Mesh_3/benchmark/Mesh_3/concurrency.cpp index ea383a78832..006c917b990 100644 --- a/Mesh_3/benchmark/Mesh_3/concurrency.cpp +++ b/Mesh_3/benchmark/Mesh_3/concurrency.cpp @@ -7,7 +7,7 @@ #endif // Without TBB_USE_THREADING_TOOL Intel Inspector XE will report false positives in Intel TBB -// (http://software.intel.com/en-us/articles/compiler-settings-for-threading-error-analysis-in-intel-inspector-xe/) +// (https://www.intel.com/content/www/us/en/developer/articles/technical/compiler-settings-for-threading-error-analysis-in-intel-inspector-xe.html) #ifdef _DEBUG # define TBB_USE_THREADING_TOOL #endif diff --git a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h deleted file mode 100644 index 59808d44899..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Labeled_mesh_domain_3.h +++ /dev/null @@ -1,318 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Domains - -\brief The class `Labeled_mesh_domain_3` implements indexed domains. - -This class is a model of concept `MeshDomain_3`. - -Any boundary facet is labeled , with a, where b!=0. - -This class includes a labeling function that provides the index of the subdomain in which any -query point lies. An intersection between a segment and bounding -surfaces is detected when both segment endpoints are associated with different -values of subdomain indices. The intersection is then constructed by bisection. -The bisection stops when the query segment is shorter than an error bound -`e` given by the product of the -length of the diagonal of the bounding box (in world coordinates), or the radius of the bounding sphere, and -a relative error bound passed as argument to the constructor of `Labeled_mesh_domain_3`. - -This class has a constructor taking a labeling function. It has also three -static template member functions that act as named constructors: -
      -
    • `create_gray_image_mesh_domain()`, to create a domain from a 3D gray image, -
    • `create_labeled_image_mesh_domain()`, to create a domain from a 3D labeled image, and -
    • `create_implicit_mesh_domain()`, to create a domain from an implicit function. -
    - -\tparam BGT is a geometric traits class that provides -the basic operations to implement -intersection tests and intersection computations -through a bisection method. This parameter must be instantiated -with a model of the concept `BisectionGeometricTraits_3`. - -\cgalHeading{Labeling function} - -A labeling function `f` must return `0` if the point isn't located in any subdomain. The return type of labeling functions is an integer. - -Let `p` be a Point. -
      -
    • `f(p)=0` means that `p` is outside domain.
    • -
    • `f(p)=a`, `a!=0` means that `p` is inside subdomain `a`.
    • -
    -`CGAL::Implicit_multi_domain_to_labeling_function_wrapper` is a good candidate for this template parameter -if there are several components to mesh. - -The function type can be any model of the concept `Callable` compatible with the signature `Subdomain_index(const Point_3&)`: it can be a function, a function object, a lambda expression... that takes a `%Point_3` as argument, and returns a type convertible to `Subdomain_index`. - -\cgalModels MeshDomain_3 - -\sa `Implicit_multi_domain_to_labeling_function_wrapper` -\sa `CGAL::make_mesh_3()`. - -*/ -template -class Labeled_mesh_domain_3 -{ -public: - -/// \name Types -///@{ - -/// The subdomain index of this model of `MeshDomain_3`. -typedef int Subdomain_index; - -/// The type of object that stores the function using type-erasure -typedef std::function Labeling_function; - -///@} -/// \name Types imported from the geometric traits class -///@{ - -/// The point type of the geometric traits class -typedef typename Geom_traits::Point_3 Point_3; -/// The sphere type of the geometric traits class -typedef typename Geom_traits::Sphere_3 Sphere_3; -/// The iso-cuboid type of the geometric traits class -typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; -/// The number type (a field type) of the geometric traits class -typedef typename Geom_traits::FT FT; -///@} - -/// \name Creation -/// @{ -/*! \brief Construction from a function, a bounding -object and a relative error bound. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -- `parameters::function` (mandatory) the labeling function, compatible with `Labeling_function`. -- `parameters::bounding_object` (mandatory) the bounding object is either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), or a bounding `Iso_cuboid_3`. It bounds the meshable space. -- `parameters::relative_error_bound` (optional) the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diameter of the bounding object. Its default value is `FT(1e-3)`. - -\cgalHeading{Example} -From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): -\snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation - - */ -template -Labeled_mesh_domain_3(const A_i&...); - -///@} - -/// \name Creation of domains from implicit functions - -/*! -\brief Construction from an implicit function - -This static method is a named constructor. It constructs a domain -whose bounding surface is described implicitly as the zero level set of a -function. The domain to be discretized is assumed to be the domain where -the function has negative values. - -The method takes as argument a bounding sphere which is required to -circumscribe the surface and to have its center inside the domain. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -
      -
    • `parameters::function` (mandatory) the implicit function, -compatible with the signature `FT(Point_3)`: it takes a point as argument, -and returns a scalar value. That object must be model of `CopyConstructible`. -
    • `parameters::bounding_object` (mandatory) the bounding object is -either a bounding sphere (of type `Sphere_3`), a bounding box (type -`Bbox_3`), or a bounding `Iso_cuboid_3`. It must bounds the surface, and -its center must be inside the domain. -
    - -\cgalHeading{Examples} - -From the example (\ref Mesh_3/mesh_implicit_sphere.cpp), where the name of -the parameters is not specified, as they are given is the same order as the -parameters definition: - -\snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation - -From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): - -\snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_implicit_mesh_domain(A_i&...); - -/// \name Creation of domains from 3D images - - -/*! -\brief Construction from a 3D gray image - -This static method is a named constructor. It constructs a domain -described by a 3D gray image. A 3D gray image is a grid of voxels, -where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to -be discretized is the union of voxels that lie inside a surface -described by an isolevel value, called \a isovalue. The voxels lying -inside the domain have gray level values that are larger than the -isovalue. - -The value of voxels is interpolated to a gray level value at any query point. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -The parameters are optional unless otherwise specified. -
      - -
    • `parameters::image` (mandatory) the input 3D image. Must -be a `CGAL::Image_3` object. - -
    • `parameters::iso_value` the isovalue, inside - `image`, of the surface describing the boundary of the object to be - meshed. Its default value is `0`. - -
    • `parameters::image_values_to_subdom_indices` a function or - a function object, compatible with the signature - `Subdomain_index(double)`. This function returns the subdomain index - corresponding to a pixel value. If this parameter is used, then the - parameter `iso_value` is ignored. - -
    • `parameter::value_outside` the value attached to voxels - outside of the domain to be meshed. It should be lower than - `iso_value`. Its default value is `0`. - -
    • `parameter::relative_error_bound` is the relative error - bound, relative to the diameter of the box of the image. Its default - value is `FT(1e-3)`.
    - -\cgalHeading{Examples} - -From the example (\ref Mesh_3/mesh_3D_gray_image.cpp), where the name -of the parameters is not specified, as they are given is the same -order as the parameters definition: - -\snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation - -From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): - -\snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_gray_image_mesh_domain(A_i&...); - -/*! -\brief Construction from a 3D labeled image - -This static method is a named constructor. It constructs a -domain described by a 3D labeled image. A 3D labeled image is a grid -of voxels, where each voxel is associated with an index (a subdomain -index) characterizing the subdomain in which the voxel lies. The -domain to be discretized is the union of voxels that have non-zero -values. - -This constructor uses named parameters (from the Boost Parameter -Library). They can be specified in any order. - -\cgalHeading{Named Parameters} -The parameters are optional unless otherwise specified. -
      - -
    • `parameters::image` (mandatory) the input 3D image. Must -be a `CGAL::Image_3` object. - -
    • `parameters::weights` an input 3D image that provides -weights associated to each voxel (the word type is `unsigned char`, -and the voxels values are integers between 0 and 255). -The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. -Its dimensions must be the same as the dimensions of `parameters::image`. - -
    • `parameter::value_outside` the value attached to voxels - outside of the domain to be meshed. Its default value is `0`. - -
    • `parameter::relative_error_bound` is the relative error - bound, relative to the diameter of the box of the image. Its default - value is `FT(1e-3)`.
    - -\cgalHeading{Example} - -From the example (\ref Mesh_3/mesh_3D_image.cpp): - -\snippet Mesh_3/mesh_3D_image.cpp Domain creation - -From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), -where the labeled image is used with a precomputed 3D image of weights : - -\snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation - - */ -template -static -Labeled_mesh_domain_3 -create_labeled_image_mesh_domain(A_i&...); - -/// \name Deprecated constructors -/// -/// Those three constructors have been deprecated since CGAL-4.13, and -/// replaced by the constructor using the Boost Parameter Library. -/// -/// @{ - -/*! -\brief Construction from a labeling function, a bounding Sphere and a relative error bound. -\param f the labeling function. -\param bounding_sphere the bounding sphere of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the radius of -`bounding_sphere`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Sphere_3& bounding_sphere, - const FT& relative_error_bound = FT(1e-3)); - -/*! -\brief Construction from a labeling function, a bounding box and a relative error bound. -\param f the labeling function. -\param bbox the bounding box of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of -`bounding_box`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Bbox_3& bbox, - const FT& relative_error_bound = FT(1e-3)); - -/*! -\brief Construction from a function, a bounding Iso_cuboid_3 and a relative error bound. -\param f the function. -\param bbox the bounding box of the meshable space. -\param relative_error_bound is the relative error bound used to compute intersection points between the implicit surface and query segments. The -bisection is stopped when the length of the intersected segment is less than the product of `relative_error_bound` by the diagonal of -`bounding_box`. -\deprecated This constructor is deprecated since CGAL-4.13, and -replaced by the constructor using the Boost Parameter Library. -*/ -Labeled_mesh_domain_3(Labeling_function f, - const Iso_cuboid_3& bbox, - const FT& relative_error_bound = FT(1e-3)); - -/// @} - -}; /* end Labeled_mesh_domain_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h new file mode 100644 index 00000000000..65fa962d512 --- /dev/null +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_3/parameters.h @@ -0,0 +1,456 @@ +namespace CGAL { + +namespace parameters { + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::manifold()` is used to drive the + * meshing algorithm for surfaces. + * It ensures that the surface of the output mesh is a manifold surface + * without boundaries. + * The manifold property of the output mesh can be achieved only if the input surface + * is a manifold. + * Note that the meshing algorithm provably terminates only if the input + * sharp edges have been protected, using the + * feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::non_manifold()` + */ +unspecified_type manifold(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::non_manifold()` is used to drive the + * meshing algorithm for surfaces. + * It does not ensure that the surface of the output mesh is a manifold surface. + * The manifold property of the output mesh might nevertheless result from an appropriate + * choice of meshing criteria. + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::manifold()` + */ +unspecified_type non_manifold(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::manifold_with_boundary()` is used to drive the + * meshing algorithm for surfaces. + * It ensures that the surface of the output mesh is a manifold surface which + * may have boundaries. + * The manifold property of the output mesh can be achieved only if the input surface + * is a manifold. + * Note that the meshing algorithm provably terminates only if the input + * sharp edges have been protected, using the + * feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::non_manifold()` + * \sa `CGAL::parameters::manifold()` + */ +unspecified_type manifold_with_boundary(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::exude()` allows the user to trigger a call to `exude_mesh_3()` in the + * `make_mesh_3()` and `refine_mesh_3()` mesh generation functions. + * It also allows the user to pass parameters + * to the optimization function `exude_mesh_3()` through these mesh generation functions. + * + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with an exudation step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::exude()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::exude(parameters::time_limit(10))); + * \endcode + * + * \sa `CGAL::parameters::no_exude()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type exude(const Named_function_parameters& np = parameters::default_values()); + +/*! + * \ingroup PkgMesh3Parameters + * + * Provides an option indicating that 0 and 1-dimensional features + * have to be taken into account (the domain must be a model of `MeshDomainWithFeatures_3`). + * This is the default behavior when the domain is a model + * of `MeshDomainWithFeatures_3`. + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::no_features()` + * + */ +unspecified_type features(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::lloyd()` allows the user to trigger a call of + * `lloyd_optimize_mesh_3()` in the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()`. It also allows the user to pass + * parameters to the optimization function + * `lloyd_optimize_mesh_3()` through these mesh generation functions. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamPrecondition{`max_iteration_number >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamPrecondition{`0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with lloyd optimization step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::lloyd()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::lloyd(parameters::time_limit(10))); + * + * \endcode + * + * \sa `CGAL::parameters::no_lloyd()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type lloyd(const Named_function_parameters& np = parameters::default_values()); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_exude()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no exudation must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without exudation + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_exude()); + * \endcode + * + * \sa `CGAL::parameters::exude()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +unspecified_type no_exude(); + +/*! + * \ingroup PkgMesh3Parameters + * + * Provides an option indicating no special treatment should be done + * with 0 and 1-dimensional features. + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::parameters::features()` + * + */ +unspecified_type no_features(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_lloyd()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no lloyd optimization must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without lloyd optimization + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_lloyd()); + * \endcode + * + * \sa `CGAL::parameters::lloyd()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +unspecified_type no_lloyd(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_odt()` allows the user to tell the mesh generation functions + * `make_mesh_3()` and `refine_mesh_3()` that no ODT optimization must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without odt optimization + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_odt()); + * \endcode + * + * \sa `CGAL::parameters::odt()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +unspecified_type no_odt(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::no_perturb()` allows the user to tell mesh generation global functions + * `make_mesh_3()` and `refine_mesh_3()` that no perturbation must be done. + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation without perturbation + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::no_perturb()); + * \endcode + * + * \sa `CGAL::parameters::perturb()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +unspecified_type no_perturb(); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::odt()` allows the user to trigger a call to + * `CGAL::odt_optimize_mesh_3()` in + * `CGAL::make_mesh_3()` and `CGAL::refine_mesh_3()` mesh optimization functions. It also + * allows the user to pass parameters to the optimization function + * `odt_optimize_mesh_3()` through these mesh generation functions. + * + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, + * a CPU time limit after which the optimization process is stopped. This time is + * measured using `Real_timer`. + * The default value is 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{sets a limit on the number of performed iterations. + * The default value of 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamType{`std::size_t`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{is a stopping criterion based on convergence: + * the optimization process is stopped, when at the last iteration, + * the displacement of any vertex is less than a given percentage of the length + * the shortest edge incident to that vertex. + * The parameter `convergence` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= convergence <= 1`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex + * that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is + * not relocated). The parameter `freeze_bound` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= freeze_bound <= 1`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true`, + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with odt optimization step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::odt()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::odt(parameters::time_limit(10))); + * \endcode + * + * \sa `CGAL::parameters::no_odt()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type odt(const Named_function_parameters& np = parameters::default_values()); + +/*! + * \ingroup PkgMesh3Parameters + * + * The function `parameters::perturb()` allows the user to trigger a call to + * `perturb_mesh_3()` in + * `make_mesh_3()` and `refine_mesh_3()` mesh generation functions. It also + * allows the user to pass parameters + * to the optimization function `perturb_mesh_3()` through these mesh generation functions. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Mesh generation with a perturbation step + * C3t3 c3t3 = make_mesh_3(domain, + * criteria, + * parameters::perturb()); + * + * refine_mesh_3(c3t3, + * domain, + * criteria, + * parameters::perturb(parameters::time_limit(10))); + * + * \endcode + * + * \sa `CGAL::parameters::no_perturb()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * + */ +template +unspecified_type perturb(const Named_function_parameters& np = parameters::default_values()); + +} /* namespace parameters */ + +} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h deleted file mode 100644 index f6511eda70b..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_criteria_3.h +++ /dev/null @@ -1,161 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3MeshClasses - -The class `Mesh_criteria_3` is a model of both concepts `MeshCriteria_3` -and `MeshCriteriaWithFeatures_3`. -It gathers the refinement criteria for mesh tetrahedra and -surface facets where -surface facets are facets in the mesh approximating the domain surface patches. -In addition, for domain with exposed 1-dimensional features, -the class `Mesh_criteria_3` -handles the definition of a sizing field to guide the discretization of -1-dimensional features. - -\tparam Tr has to be instantiated with the type used for -`C3T3::Triangulation`, -where `C3T3` is the model of `MeshComplex_3InTriangulation_3` -used in the mesh generation process, -and `C3T3::Triangulation` its nested triangulation type. - -\cgalModels `MeshCriteria_3` - -\cgalHeading{Example} - -\code{.cpp} - -// Create a Mesh_criteria_3 object with all cell and facet parameters set -Mesh_criteria_3 criteria (parameters::facet_angle=30, - parameters::facet_size=1, - parameters::facet_distance=0.1, - parameters::cell_radius_edge_ratio=2, - parameters::cell_size=1.5); - -// Create a Mesh_criteria_3 object with size ignored (note that the order changed) -Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio=2, - parameters::facet_angle=30, - parameters::facet_distance=0.1); - -\endcode - -\sa `MeshCriteria_3` -\sa `MeshCriteriaWithFeatures_3` -\sa `MeshCellCriteria_3` -\sa `MeshEdgeCriteria_3` -\sa `MeshFacetCriteria_3` -\sa `MeshDomainField_3` -\sa `CGAL::Mesh_cell_criteria_3` -\sa `CGAL::Mesh_edge_criteria_3` -\sa `CGAL::Mesh_facet_criteria_3` -\sa `CGAL::Mesh_facet_topology` - -*/ -template< typename Tr > -class Mesh_criteria_3 -{ -public: - -/// \name Types -/// @{ - -/*! -The criteria for edges. -*/ -typedef Mesh_edge_criteria_3 Edge_criteria; - -/*! -The criteria for facets. -*/ -typedef Mesh_facet_criteria_3 Facet_criteria; - -/*! -The -criteria for cells. -*/ -typedef Mesh_cell_criteria_3 Cell_criteria; - -/// @} - -/// \name Creation -/// @{ - -/*! -Construction from facet and cell criteria. The edge criteria are ignored -in this case. -*/ -Mesh_criteria_3(const Facet_criteria& facet_criteria, - const Cell_criteria& cell_criteria); - -/*! -Construction from edge, facet and cell criteria. -*/ -Mesh_criteria_3(const Edge_criteria& edge_criteria, - const Facet_criteria& facet_criteria, - const Cell_criteria& cell_criteria); - -/*! -\brief Construction from criteria parameters. This constructor uses named -parameters (from Boost.Parameter) for convenient criteria -construction. - -\tparam FT must be a model of `Field` -\tparam Fieldi (`i`=1,..,4) should be either a model -of the concept `Field` or a model of the concept `MeshDomainField_3` - -The parameters are named parameters and can be passed in any order -provided their name is given (see example below). The name of each -parameter is the one that is written in the description of the -function (e.g. `parameters::facet_size`). - -The description of each parameter is as follows: - -- `edge_size`: a scalar field (resp. a constant) providing a space varying -(resp. a uniform) -upper bound for the lengths of curve edges. This parameter has to be set to a positive -value when 1-dimensional features protection is used. - -- `facet_angle`: a lower bound for the angles (in degrees) of the -surface mesh facets. - -- `facet_size`: a scalar field (resp. a constant) describing -a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls. - -- `facet_distance`: a scalar field (resp. a constant) describing a space varying (resp. a uniform) -upper bound for the distance between the facet circumcenter and the center of its surface -Delaunay ball. - -- `facet_topology`: the set of topological constraints -which have to be verified by each surface facet. The default value is -`CGAL::FACET_VERTICES_ON_SURFACE`. See `Mesh_facet_topology` manual page to -get all possible values. - -- `cell_radius_edge_ratio`: an upper bound for the radius-edge ratio of the mesh tetrahedra. - -- `cell_size`: a scalar field (resp. a constant) describing -a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra. - -Note that each size or distance parameter can be specified using two ways: either as -a scalar field or as a numerical value when the field is uniform. - -Each parameter has a special default value `ignored` which means that the -corresponding criterion will be ignored. -Numerical sizing or distance values, as well as scalar fields -should be given in the unit used for coordinates of points in the mesh domain class -of the mesh generation process. - -*/ -template -Mesh_criteria_3(Field1 parameters::edge_size = ignored, - FT parameters::facet_angle = ignored, - Field2 parameters::facet_size = ignored, - Field3 parameters::facet_distance = ignored, - Mesh_facet_topology parameters::facet_topology = CGAL::FACET_VERTICES_ON_SURFACE, - FT parameters::cell_radius_edge_ratio = ignored, - Field4 parameters::cell_size = ignored); - -/// @} - -}; /* end Mesh_criteria_3 */ -} /* end namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h deleted file mode 100644 index e9b8167c8e2..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/exude_mesh_3.h +++ /dev/null @@ -1,81 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. - -The sliver exudation process consists in optimizing the weights of vertices -of the weighted Delaunay triangulation in such a way that slivers disappear and -the quality of the mesh improves. - -\warning This optimizer modifies the weight of vertices of the triangulation and, -if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -The function has two optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} -- `parameters::time_limit` is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using the `Real_timer` class. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The exudation process considers in turn all the mesh cells -that have a smallest dihedral angle less than `sliver_bound` -and tries to make them disappear by weighting their vertices. -The optimization process -stops when every cell in the mesh achieves this quality. -The default value is 0 and means that there is no targeted bound: -the exuder then runs as long as -it can improve the smallest dihedral angles of the set of cells -incident to some vertices. - -\return -The function `exude_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
      -
    • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
    • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve -the smallest dihedral angle of the set of cells incident to some vertex in the mesh. -
    - -\cgalHeading{Example} - -\code{.cpp} -// Exude without sliver_bound, using at most 10s CPU time -exude_mesh_3(c3t3, - parameters::time_limit=10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -exude_mesh_3(C3T3& c3t3, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h deleted file mode 100644 index b891d23810f..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/lloyd_optimize_mesh_3.h +++ /dev/null @@ -1,116 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `lloyd_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear -in each cell of the Voronoi diagram of the mesh vertices. - -The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::%max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::%convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the -length of the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `lloyd_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
      -
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
    • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
    • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
    • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
    • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
    - -\cgalHeading{Example} - - -\code{.cpp} -// Lloyd-smoothing until convergence reaches 0.01, freezing vertices which -// move less than 0.001*shortest_incident_edge_length -lloyd_optimize_mesh_3(c3t3, - domain, - parameters::convergence=0.01, - parameters::freeze_bound=0.001, - parameters::do_freeze=true); - -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -\note This function requires the \ref thirdpartyEigen library. -*/ - -template -Mesh_optimization_return_code -lloyd_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h deleted file mode 100644 index 312b556343f..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/make_mesh_3.h +++ /dev/null @@ -1,170 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `make_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd-smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Mesh_3_section_examples ). - - -\tparam C3T3 is required to be a model of -the concept `MeshComplex_3InTriangulation_3`, -and a model of `MeshComplexWithFeatures_3InTriangulation_3` -if the domain is a model of `MeshDomainWithFeatures_3`. -This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3`, or of the refined concept -`MeshDomainWithFeatures_3` -if the domain has corners and curves that need to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - - -\tparam MC has to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
      -
    • \link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
    • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
    - -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_mesh_3()` -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `parameters::manifold()` -\sa `parameters::manifold_with_boundary()` -\sa `parameters::non_manifold()` -\sa `exude_mesh_3()` -\sa `perturb_mesh_3()` -\sa `lloyd_optimize_mesh_3()` -\sa `odt_optimize_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` - -*/ - -template -C3T3 make_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h deleted file mode 100644 index eab650a577a..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/odt_optimize_mesh_3.h +++ /dev/null @@ -1,111 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `odt_optimize_mesh_3()` is a mesh optimization process -based on the minimization of a global energy function. - -In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted -as the \f$ L^1\f$-norm of the error achieved -when the function \f$ x^2\f$ is interpolated on the mesh domain -using a piecewise linear function which is linear in each mesh cell. - -The optimizer `odt_optimize_mesh_3()` works in iterative steps. -At each iteration, mesh vertices are moved into -positions that bring to zero the energy gradient -and the Delaunay triangulation is updated. -Vertices on the mesh boundaries are handled -in a special way so as to preserve an accurate -representation of the domain boundaries. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `convergence` \f$ \leq\f$ 1 and 0 \f$ \leq\f$ `freeze_bound` \f$ \leq\f$ 1 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has four optional parameters which are named parameters -(we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::max_iteration_number` sets a limit on the -number of performed iterations. The default value of 0 means that there is -no limit on the number of performed iterations. - -- `parameters::convergence` is a stopping criterion based on convergence: -the optimization process is stopped, when at the last iteration, -the displacement of any vertex is less than a given percentage of the length -the shortest edge incident to that vertex. -The parameter `convergence` gives the threshold ratio. - -- `parameters::freeze_bound` is designed to reduce running time of each optimization iteration. Any vertex -that has a displacement less than a given percentage of the length (the of its shortest incident edge, is frozen (i.e.\ is -not relocated). The parameter `freeze_bound` gives the threshold ratio. - -- `parameters::do_freeze` completes the `freeze_bound` parameter. If it is set to `true` (default value), -frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that -moves, unfreezes all its incident vertices. - - -\return -The function `odt_optimize_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
      -
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
    • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. -
    • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion -is achieved. -
    • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the -`do_freeze` parameter is set to true. -
    • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because -most vertices have been frozen, and no better convergence can be reached. -
    - -\cgalHeading{Example} - -\code{.cpp} -// 100 iterations of ODT-smoothing -odt_optimize_mesh_3(c3t3, - domain, - parameters::max_iteration_number = 100, - parameters::convergence = 0); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -odt_optimize_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h deleted file mode 100644 index 216f3d5e662..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/perturb_mesh_3.h +++ /dev/null @@ -1,91 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `perturb_mesh_3()` is a mesh optimizer that -improves the quality of a Delaunay mesh -by changing the positions of some vertices of the mesh. - -The perturber tries to improve the dihedral angles of the worst cells in the mesh -degree by degree: the -step number `n` is considered as successful -if after this step the worst tetrahedron of the mesh has a minimal dihedral -angle larger than `n` degrees. -The perturber exits if this is not the case. - -\pre `time_limit` \f$ \geq\f$ 0 and 0 \f$ \leq\f$ `sliver_bound` \f$ \leq\f$ 180 - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. -The argument `c3t3`, passed by -reference, provides the initial mesh -and is modified by the algorithm -to represent the final optimized mesh. - -\tparam MD is required to be a model of the concept -`MeshDomain_3`. The argument `domain` must be the `MD` -object used to create the `c3t3` parameter. - -The function has two optional parameters which are named parameters (we use the Boost.Parameter library). -Therefore, when calling the function, the parameters can be provided in any order -provided that the names of the parameters are used -(see example at the bottom of this page). - -\cgalHeading{Named Parameters} - -- `parameters::time_limit` -is used to set up, in seconds, -a CPU time limit after which the optimization process is stopped. This time is -measured using `Real_timer`. -The default value is 0 and means that there is no time limit. - -- `parameters::sliver_bound` -is designed to give, in degrees, a targeted -lower bound on dihedral angles of mesh cells. -The function `perturb_mesh_3()` runs as long as steps are successful -and step number `sliver_bound` (after which -the worst tetrahedron in the mesh has a smallest angle larger than -`sliver_bound` degrees) has not been reached. -The default value is 0 and means that there is no targeted bound: -the perturber then runs as long as -steps are successful. - - -\return -The function `perturb_mesh_3()` returns a value of type `CGAL::Mesh_optimization_return_code` -which is: -
      -
    • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. -
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. -
    • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. -
    - - -\cgalHeading{Example} - -\code{.cpp} -// Perturb until every dihedral angle of the mesh is >= 10 degrees -// No time bound is set -perturb_mesh_3(c3t3, - domain, - parameters::sliver_bound = 10); -\endcode - -\sa `CGAL::Mesh_optimization_return_code` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` - -*/ - -template -Mesh_optimization_return_code -perturb_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h b/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h deleted file mode 100644 index afeebe8c634..00000000000 --- a/Mesh_3/doc/Mesh_3/CGAL/refine_mesh_3.h +++ /dev/null @@ -1,517 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgMesh3Functions - -The function `refine_mesh_3()` is a 3D -mesh generator. It produces simplicial meshes which discretize -3D domains. - -The mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process -can be activated or not, -according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_mesh_3()` may be used to refine a previously -computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); - -CGAL::refine_mesh_3(c3t3, domain, new_criteria); -\endcode - -Please note that we guarantee the result if and only if the domain does -not change from one refinement to the next one. - - -\tparam C3T3 is required to be a model of -the concept -`MeshComplex_3InTriangulation_3`, -and a model of `MeshComplexWithFeatures_3InTriangulation_3` -if the domain is a model of `MeshDomainWithFeatures_3`. -The argument `c3t3` is passed by -reference as this object is modified by the refinement process. As the -refinement process only adds points to the triangulation, all -vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. Object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D triangulation -embedding the mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `MeshCellBase_3` -respectively. - -\tparam MD is required to be a model of -the concept `MeshDomain_3` or of the refined concept -`MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` -is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` -if the domain has exposed features. The argument `criteria` of -type `MC` specifies the -size and shape requirements for mesh tetrahedra -and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `manifold` allows the user to drive the meshing algorithm, -and ensure that the output mesh surface follows the given manifold criterion. -It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()` -and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold -surface if the input surface is not manifold. - -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::parameters::manifold` -\sa `CGAL::parameters::manifold_with_boundary` -\sa `CGAL::parameters::non_manifold` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::parameters::exude` -\sa `CGAL::parameters::no_exude` -\sa `CGAL::parameters::perturb` -\sa `CGAL::parameters::no_perturb` -\sa `CGAL::parameters::lloyd` -\sa `CGAL::parameters::no_lloyd` -\sa `CGAL::parameters::odt` -\sa `CGAL::parameters::no_odt` - -*/ - -template -void refine_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude(), - parameters::internal::Manifold_options manifold = parameters::non_manifold()); - -namespace parameters { - - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::manifold()` is used to drive the - meshing algorithm for surfaces. - It ensures that the surface of the output mesh is a manifold surface - without boundaries. - The manifold property of the output mesh can be achieved only if the input surface - is a manifold. - Note that the meshing algorithm provably terminates only if the input - sharp edges have been protected, using the - feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). - - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::manifold_with_boundary()` - \sa `CGAL::parameters::non_manifold()` - */ - parameters::internal::Manifold_options manifold(); - - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::non_manifold()` is used to drive the - meshing algorithm for surfaces. - It does not ensure that the surface of the output mesh is a manifold surface. - The manifold property of the output mesh might nevertheless result from an appropriate - choice of meshing criteria. - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::manifold_with_boundary()` - \sa `CGAL::parameters::manifold()` - */ - parameters::internal::Manifold_options non_manifold(); - - /*! - \ingroup PkgMesh3Parameters - - The function `parameters::manifold_with_boundary()` is used to drive the - meshing algorithm for surfaces. - It ensures that the surface of the output mesh is a manifold surface which - may have boundaries. - The manifold property of the output mesh can be achieved only if the input surface - is a manifold. - Note that the meshing algorithm provably terminates only if the input - sharp edges have been protected, using the - feature protection (see \ref Mesh_3Protectionof0and1dimensionalExposed). - - \sa `CGAL::make_mesh_3()` - \sa `CGAL::refine_mesh_3()` - \sa `CGAL::parameters::non_manifold()` - \sa `CGAL::parameters::manifold()` - */ - parameters::internal::Manifold_options manifold_with_boundary(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::exude()` allows the user to trigger a call to `exude_mesh_3()` in the -`make_mesh_3()` and `refine_mesh_3()` mesh generation functions. -It also allows the user to pass parameters -to the optimization function `exude_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `exude_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with an exudation step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::exude()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::exude(parameters::time_limit=10)); -\endcode - -\sa `CGAL::parameters::no_exude()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Exude_options exude( - double parameters::time_limit = 0, - double parameters::sliver_bound = 0); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::features()` provides a value of internal type `Features` -to specify if 0 and 1-dimensional features have to be taken into account. -The provided value is a default value that triggers the representation -of corners and curves in the mesh when the domain is a model -of `MeshDomainWithFeatures_3`. - -Provides a `Features_options` value such that -0 and 1-dimensional input features are taken into account -if domain is a model of the refined concept `MeshDomainWithFeatures_3`. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::parameters::no_features()` - -*/ -parameters::internal::Features_options features(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::lloyd()` allows the user to trigger a call of -`lloyd_optimize_mesh_3()` in the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()`. It also allows the user to pass -parameters to the optimization function -`lloyd_optimize_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of the `lloyd_optimize_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with lloyd optimization step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::lloyd()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::lloyd(parameters::time_limit=10)); - -\endcode - -\sa `CGAL::parameters::no_lloyd()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Lloyd_options lloyd( -double parameters::time_limit = 0, -std::size_t parameters::max_iteration_number = 0, -double parameters::convergence = 0.02, -double parameters::freeze_bound = 0.01, -bool parameters::do_freeze=true); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_exude()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no exudation must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without exudation -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_exude()); -\endcode - -\sa `CGAL::parameters::exude()` -\sa `CGAL::exude_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Exude_options no_exude(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_features()` allows the user to prevent the handling -of 0 and 1-dimensional features. This is useful when the -domain is a model of `MeshDomainWithFeatures_3` -and the user does not want corners and curves -to be accurately represented -in the mesh. - -Returns a `Features_options` value that prevents the mesh generator -to take into account 0 and 1-dimensional input features. - -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` -\sa `CGAL::parameters::features()` - -*/ -parameters::internal::Features_options no_features(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_lloyd()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no lloyd optimization must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without lloyd optimization -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_lloyd()); -\endcode - -\sa `CGAL::parameters::lloyd()` -\sa `CGAL::lloyd_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Lloyd_options no_lloyd(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_odt()` allows the user to tell the mesh generation functions -`make_mesh_3()` and `refine_mesh_3()` that no odt optimization must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without odt optimization -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_odt()); -\endcode - -\sa `CGAL::parameters::odt()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Odt_options no_odt(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::no_perturb()` allows the user to tell mesh generation global functions -`make_mesh_3()` and `refine_mesh_3()` that no perturbation must be done. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation without perturbation -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::no_perturb()); -\endcode - -\sa `CGAL::parameters::perturb()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Perturb_options no_perturb(); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::odt()` allows the user to trigger a call to -`CGAL::odt_optimize_mesh_3()` in -`CGAL::make_mesh_3()` and `CGAL::refine_mesh_3()` mesh optimization functions. It also -allows the user to pass parameters to the optimization function -`odt_optimize_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `odt_optimize_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with odt optimization step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::odt()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::odt(parameters::time_limit=10)); -\endcode - -\sa `CGAL::parameters::no_odt()` -\sa `CGAL::odt_optimize_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Odt_options odt( -double parameters::time_limit = 0, -std::size_t parameters::max_iteration_number = 0, -double parameters::convergence = 0.02, -double parameters::freeze_bound = 0.01, -bool parameters::do_freeze=true); - -/*! -\ingroup PkgMesh3Parameters - -The function `parameters::perturb()` allows the user to trigger a call to -`perturb_mesh_3()` in -`make_mesh_3()` and `refine_mesh_3()` mesh generation functions. It also -allows the user to pass parameters -to the optimization function `perturb_mesh_3()` through these mesh generation functions. - -\cgalHeading{Parameters} - -The parameters are named parameters. They are the same (i.e.\ they have the same -name and the same default values) as the parameters of `perturb_mesh_3()` -function. See its manual page for further details. - -\cgalHeading{Example} - -\code{.cpp} -// Mesh generation with a perturbation step -C3t3 c3t3 = make_mesh_3(domain, - criteria, - parameters::perturb()); - -refine_mesh_3(c3t3, - domain, - criteria, - parameters::perturb(parameters::time_limit=10)); - -\endcode - -\sa `CGAL::parameters::no_perturb()` -\sa `CGAL::perturb_mesh_3()` -\sa `CGAL::make_mesh_3()` -\sa `CGAL::refine_mesh_3()` - -*/ -parameters::internal::Perturb_options perturb( - double parameters::time_limit = 0, - double parameters::sliver_bound = 0); - -} /* namespace parameters */ - -} /* namespace CGAL */ diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h index 644c5a94eed..84a1f461abb 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshCriteriaWithFeatures_3.h @@ -12,11 +12,10 @@ additionnally encapsulates the concept `MeshEdgeCriteria_3`, that describes the requirements, in terms of sizing, for the discretization of the domain \f$ 1\f$-dimensional features. -\cgalRefines `MeshDomain_3` +\cgalRefines `MeshCriteria_3` \cgalHasModel `CGAL::Mesh_criteria_3` -\sa `MeshCriteria_3` \sa `MeshEdgeCriteria_3` \sa `MeshFacetCriteria_3` \sa `MeshCellCriteria_3` diff --git a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h index 7b596fc79dc..279762200af 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h +++ b/Mesh_3/doc/Mesh_3/Concepts/MeshDomainWithFeatures_3.h @@ -89,13 +89,13 @@ const Point_3& p, const Curve_index& ci, FT d) const; /// @{ /*! -Returns the length of the curve segment from \c p to \c q, on the curve -with index \c curve_index. +Returns the length of the curve segment from `p` to `q`, on the curve +with index `curve_index`. -If the curve with index \c curve_index is a loop, the +If the curve with index `curve_index` is a loop, the orientation identifies which portion of the loop corresponds to the curve -segment, otherwise \c orientation must be compatible with the orientation -of \c p and \c q on the curve. +segment, otherwise `orientation` must be compatible with the orientation +of `p` and `q` on the curve. */ FT curve_segment_length(const Point_3& p, const Point_3& q, const Curve_index& curve_index, @@ -121,14 +121,14 @@ CGAL::Sign distance_sign(const Point_3& p, const Point_3& q, /*! Returns the length of curve with index -\c curve_index +`curve_index` */ FT curve_length(const Curve_index& curve_index) const; /*! -Returns `true` if the portion of the curve of index \c index, -between the points \c c1 and \c c2, is covered by the spheres of -centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2 -respectively. The points \c c1 and \c c2 are assumed to lie on the curve. +Returns `true` if the portion of the curve of index `index`, +between the points `c1` and `c2`, is covered by the spheres of +centers `c1` and `c2` and squared radii `sq_r1` and `sq_r2` +respectively. The points `c1` and `c2` are assumed to lie on the curve. */ bool is_curve_segment_covered(const Curve_index& index, CGAL::Orientation orientation, diff --git a/Mesh_3/doc/Mesh_3/Doxyfile.in b/Mesh_3/doc/Mesh_3/Doxyfile.in index 5865b0989ca..13f34ec4653 100644 --- a/Mesh_3/doc/Mesh_3/Doxyfile.in +++ b/Mesh_3/doc/Mesh_3/Doxyfile.in @@ -6,8 +6,16 @@ ALIASES += "cgalDescribePolylineType=A polyline is defined as a sequence of poin INPUT += \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \ - ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_facet_topology.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Labeled_mesh_domain_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_criteria_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_facet_topology.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_vertex_base_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_cell_base_3.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Compact_mesh_cell_base_3.h @@ -28,3 +36,5 @@ HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg ${CGAL_PACKAGE_DOC_DIR}/fig/no-protection-complex.png EXAMPLE_PATH += ${CGAL_PACKAGE_INCLUDE_DIR} # non-documented headers are advertised + +EXCLUDE_SYMBOLS += details diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index fabeb649e60..29ba32bd500 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -301,29 +301,24 @@ of the `C3T3`. They can be removed using the function `remove_isolated_vertices( \section Mesh_3_section_interface Interface +As of \cgal 5.6, this package uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. + \subsection Mesh_3TheGlobalFunctions The Global Functions A 3D mesh generation process is launched through a call to one of the two following functions: \code{.cpp} -template +template C3T3 make_mesh_3(const MeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); -template +template void refine_mesh_3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); \endcode The function `make_mesh_3()` generates from scratch a mesh @@ -581,7 +576,7 @@ is an isosurface defined by an implicit function. \cgalFigureRef{figureimplicit_domain} shows a cut view of the resulting mesh. -Note the use of named parameters (from Boost library) in the +Note the use of named parameters in the constructor of the `Mesh_criteria` instance. \cgalExample{Mesh_3/mesh_implicit_sphere.cpp} diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp index fa7e38b7dca..d877389a530 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image.cpp @@ -23,8 +23,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -37,12 +36,12 @@ int main(int argc, char*argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, 2.9f, 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp index 1c99e0379f1..71b3a5950a4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_multiple_values.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; template struct Image_to_multiple_iso_level_sets { @@ -63,18 +62,17 @@ int main(int argc, char*argv[]) } // Domain - namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain - (p::image = image, - p::image_values_to_subdomain_indices = - Image_to_multiple_iso_level_sets(iso_values), - p::value_outside = 0.f + (params::image(image). + image_values_to_subdomain_indices( + Image_to_multiple_iso_level_sets(iso_values)). + value_outside(0.f) ); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 86edd7f2e78..afed1a34b52 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -32,8 +32,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -46,12 +45,12 @@ int main(int argc, char* argv[]) } /// [Domain creation] Mesh_domain domain = - Mesh_domain::create_gray_image_mesh_domain(image, 2.9f, 0.f); + Mesh_domain::create_gray_image_mesh_domain(image, params::iso_value(2.9f).value_outside(0.f)); /// [Domain creation] /// [Mesh criteria] - Mesh_criteria criteria(facet_angle = 30, facet_size = 6, facet_distance = 2, - cell_radius_edge_ratio = 3, cell_size = 8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3; diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp index a42b1144a0a..55799a97747 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp @@ -79,18 +79,17 @@ int main(int argc, char* argv[]) return 0; } /// [Domain creation] - // To avoid verbose function and named parameters call - using namespace CGAL::parameters; + namespace params = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_gray_image_mesh_domain (image, - image_values_to_subdomain_indices = Less(iso), - value_outside = 0); + params::image_values_to_subdomain_indices(Less(iso)). + value_outside(0)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=fs, facet_distance=fd, - cell_radius_edge_ratio=3, cell_size=cs); + Mesh_criteria criteria(params::facet_angle(30).facet_size(fs).facet_distance(fd). + cell_radius_edge_ratio(3).cell_size(cs)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp index dbae9919419..484863d158c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -45,8 +44,8 @@ int main(int argc, char* argv[]) /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=4, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(4). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp index c7f205091ba..2f07fbf3abf 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; typedef CGAL::Mesh_constant_domain_field_3 Sizing_field; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -55,8 +54,8 @@ int main(int argc, char* argv[]) domain.index_from_subdomain_index(127)); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=2, - cell_radius_edge_ratio=3, cell_size=size); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(2). + cell_radius_edge_ratio(3).cell_size(size)); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index fcf5d94744d..253c41a920b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -44,8 +43,8 @@ int main() Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=3, facet_distance=1, - cell_radius_edge_ratio=3, cell_size=3); + Mesh_criteria criteria(params::facet_angle(30).facet_size(3).facet_distance(1). + cell_radius_edge_ratio(3).cell_size(3)); /// [Meshing] C3t3 c3t3; diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp index 877fa104635..15d8c843bcf 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_features.cpp @@ -32,8 +32,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; /// [Add 1D features] #include "read_polylines.h" @@ -92,9 +91,9 @@ int main(int argc, char* argv[]) /// [Call add_1D_features] /// Note that `edge_size` is needed with 1D-features [Mesh criteria] - Mesh_criteria criteria(edge_size=6, - facet_angle=30, facet_size=6, facet_distance=4, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::edge_size(6). + facet_angle(30).facet_size(6).facet_distance(4). + cell_radius_edge_ratio(3).cell_size(8)); /// [Mesh criteria] // Meshing diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp index 0374a315707..bfb9e3190ba 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_weighted_image.cpp @@ -24,8 +24,7 @@ using C3t3 = CGAL::Mesh_complex_3_in_triangulation_3; // Criteria using Mesh_criteria = CGAL::Mesh_criteria_3; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -39,19 +38,19 @@ int main(int argc, char* argv[]) /// [Loads image] /// [Domain creation] - const float sigma = 10.f; + const float sigma = (std::max)(image.vx(), (std::max)(image.vy(), image.vz())); CGAL::Image_3 img_weights = CGAL::Mesh_3::generate_label_weights(image, sigma); Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, - weights = img_weights, - relative_error_bound = 1e-6); + params::weights(img_weights). + relative_error_bound(1e-6)); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=0.5, - cell_radius_edge_ratio=3, cell_size=8); + Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(0.5). + cell_radius_edge_ratio(3).cell_size(8)); /// [Meshing] C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 90577147ecb..8f42c8f556d 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -19,7 +19,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -76,18 +76,18 @@ int main() Mesh_domain domain(Function_wrapper(v, vps), K::Sphere_3(CGAL::ORIGIN, 5.*5.)); // Set mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 30, facet_size = 0.2, - cell_radius_edge_ratio = 2, cell_size = 0.4); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(30).facet_size(0.2). + cell_radius_edge_ratio(2).cell_size(0.4)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3,params::time_limit(12)); // Output std::ofstream medit_file("out_cubes_intersection.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index fd9f1780c62..568f3fec14a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -20,7 +20,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -163,18 +163,18 @@ int main() domain.add_features(polylines.begin(),polylines.end()); // Set mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 30, facet_size = 0.2, - cell_radius_edge_ratio = 2, cell_size = 0.4); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(30).facet_size(0.2). + cell_radius_edge_ratio(2).cell_size(0.4)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out_cubes_intersection_with_features.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp index c0ba926d412..d2ab9f47a39 100644 --- a/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_hybrid_mesh_domain.cpp @@ -190,8 +190,7 @@ FT sphere_centered_at_111 (const Point& p) return dx*dx+dy*dy+dz*dz-1; } -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -215,8 +214,7 @@ int main() // (Warning: Sphere_3 constructor uses square radius !) Implicit_domain sphere_domain = Implicit_domain::create_implicit_mesh_domain(sphere_centered_at_111, - K::Sphere_3(K::Point_3(1, 1, 1), - 2.)); + K::Sphere_3(K::Point_3(1, 1, 1), K::FT(2))); Domain domain(sphere_domain, polyhedron_domain); @@ -240,7 +238,7 @@ int main() // Mesh generation (without optimization) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); // Output dump_c3t3(c3t3, "out"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index 4d9187f5692..0dcf61431e5 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -12,7 +12,7 @@ // IO #include -using namespace CGAL::parameters; +namespace params = CGAL::parameters; #ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_tag Concurrency_tag; @@ -49,7 +49,8 @@ int main() v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), 1e-6); + Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, CGAL::square(K::FT(5))), + params::relative_error_bound(1e-6)); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation @@ -57,13 +58,13 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index e3ec7922475..adff2af9689 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -12,8 +12,6 @@ // IO #include -using namespace CGAL::parameters; - // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef FT_to_point_function_wrapper Function; @@ -46,11 +44,10 @@ int main() vps.push_back("+-"); /// [Domain creation] (Warning: Sphere_3 constructor uses square radius !) - namespace param = CGAL::parameters; - Mesh_domain domain(param::function = Function_wrapper(v, vps), - param::bounding_object = K::Sphere_3(CGAL::ORIGIN, - 5.*5.), - param::relative_error_bound = 1e-6); + namespace params = CGAL::parameters; + Mesh_domain domain(Function_wrapper(v, vps), + K::Sphere_3(CGAL::ORIGIN, CGAL::square(K::FT(5))), + params::relative_error_bound(1e-6)); /// [Domain creation] // Set mesh criteria @@ -59,13 +56,13 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Perturbation (maximum cpu time: 10s, targeted dihedral angle: default) - CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(10)); // Exudation - CGAL::exude_mesh_3(c3t3,12); + CGAL::exude_mesh_3(c3t3, params::time_limit(12)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp index da98a23a98c..db7dabd145e 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_ellipsoid.cpp @@ -35,8 +35,7 @@ FT ellipsoid_function (const Point& p) return x2+2*y2+4*z2-1; } -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -51,7 +50,7 @@ int main() Mesh_criteria criteria(facet_criteria, cell_criteria); // Mesh generation (without optimization) - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_wo.mesh"); @@ -59,7 +58,7 @@ int main() medit_file.close(); // Perturbation (5s, 12degree) - CGAL::perturb_mesh_3(c3t3, domain, time_limit=5, sliver_bound=12); + CGAL::perturb_mesh_3(c3t3, domain, params::time_limit(5).sliver_bound(12)); // Exudation CGAL::exude_mesh_3(c3t3); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index 2e318913c84..d2cec7e4d94 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -28,8 +28,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function (const Point& p) @@ -39,13 +38,13 @@ int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(sphere_function, - K::Sphere_3(CGAL::ORIGIN, 2.)); + Mesh_domain::create_implicit_mesh_domain( sphere_function, + K::Sphere_3(CGAL::ORIGIN, K::FT(2))); /// [Domain creation] // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025, - cell_radius_edge_ratio=2, cell_size=0.1); + Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025). + cell_radius_edge_ratio(2).cell_size(0.1)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp index 61c3952bb68..7c4ad34100b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size.cpp @@ -42,8 +42,7 @@ struct Spherical_sizing_field } }; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function (const Point& p) @@ -52,20 +51,18 @@ FT sphere_function (const Point& p) int main() { /// [Domain creation] (Warning: Sphere_3 constructor uses squared radius !) - namespace p = CGAL::parameters; Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (p::function = &sphere_function, - p::bounding_object = K::Sphere_3(CGAL::ORIGIN, 2.) + (sphere_function, K::Sphere_3(CGAL::ORIGIN, K::FT(2)) ); /// [Domain creation] // Mesh criteria Spherical_sizing_field size; - Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025, - cell_radius_edge_ratio=2, cell_size=size); + Mesh_criteria criteria(params::facet_angle(30).facet_size(0.1).facet_distance(0.025). + cell_radius_edge_ratio(2).cell_size(size)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_exude().no_perturb()); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 4d0e36ff5d3..5d9354615ee 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Mesh Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char* argv[]) { @@ -42,20 +41,20 @@ int main(int argc, char* argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_size=5, facet_distance=1.5, - cell_radius_edge_ratio=2, cell_size=7); + Mesh_criteria criteria(params::facet_angle(30).facet_size(5).facet_distance(1.5). + cell_radius_edge_ratio(2).cell_size(7)); // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degrees) C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_exude(), - perturb(sliver_bound=10, time_limit=15)); + params::no_exude(). + perturb(params::sliver_bound(10).time_limit(15))); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); - CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit=15); + CGAL::perturb_mesh_3(c3t3_bis, domain, params::time_limit(15)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index b4db268fc59..42b8c1d0c4a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Mesh Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -41,21 +40,21 @@ int main(int argc, char*argv[]) Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image); // Mesh criteria - Mesh_criteria criteria(facet_angle=30, facet_distance=1.2, - cell_radius_edge_ratio=2); + Mesh_criteria criteria(params::facet_angle(30).facet_distance(1.2). + cell_radius_edge_ratio(2)); // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - lloyd(time_limit=30), - no_perturb(), - exude(time_limit=10, sliver_bound=10)); + params::lloyd(params::time_limit(30)). + no_perturb(). + exude(params::time_limit(10).sliver_bound(10))); // Mesh generation and optimization in several call C3t3 c3t3_bis = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); - CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit=30); - CGAL::exude_mesh_3(c3t3_bis, sliver_bound=10, time_limit=10); + CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, params::time_limit(30)); + CGAL::exude_mesh_3(c3t3_bis, params::sliver_bound(10), params::time_limit(10)); // Output std::ofstream medit_file("out.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp index eaee6876dc8..b502b7593e6 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex.cpp @@ -31,8 +31,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; const char* const filenames[] = { "meshes/patch-01.off", @@ -71,9 +70,9 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 8, - facet_angle = 25, facet_size = 8, facet_distance = 0.2, - cell_radius_edge_ratio = 3, cell_size = 10); + Mesh_criteria criteria(params::edge_size(8). + facet_angle(25).facet_size(8).facet_distance(0.2). + cell_radius_edge_ratio(3).cell_size(10)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp index bc4b4821dca..9bf6c385370 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_complex_sm.cpp @@ -33,8 +33,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; const char* const filenames[] = { "meshes/patch-01.off", @@ -94,9 +93,9 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 8, - facet_angle = 25, facet_size = 8, facet_distance = 0.2, - cell_radius_edge_ratio = 3, cell_size = 10); + Mesh_criteria criteria(params::edge_size(8). + facet_angle(25).facet_size(8).facet_distance(0.2). + cell_radius_edge_ratio(3).cell_size(10)); #ifdef CGAL_MESHING_STEPS_WITH_CIN std::cout << "Ready for mesh generation ? (y or n)"; diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index eb24c7ef70a..cd56e3bc5c7 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -29,8 +29,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -54,11 +53,11 @@ int main(int argc, char*argv[]) Mesh_domain domain(polyhedron); // Mesh criteria (no cell_size set) - Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, - cell_radius_edge_ratio=3); + Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008). + cell_radius_edge_ratio(3)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -66,10 +65,10 @@ int main(int argc, char*argv[]) medit_file.close(); // Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets - Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); + Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03)); // Mesh refinement (and make the output manifold) - CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold()); + CGAL::refine_mesh_3(c3t3, domain, new_criteria, params::manifold()); // Output medit_file.open("out_2.mesh"); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp index c7ab9c43a4d..eac3d9a4701 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_sm.cpp @@ -28,8 +28,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -53,11 +52,11 @@ int main(int argc, char*argv[]) Mesh_domain domain(polyhedron); // Mesh criteria (no cell_size set) - Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, - cell_radius_edge_ratio=3); + Mesh_criteria criteria(params::facet_angle(25).facet_size(0.15).facet_distance(0.008). + cell_radius_edge_ratio(3)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output std::ofstream medit_file("out_1.mesh"); @@ -65,7 +64,7 @@ int main(int argc, char*argv[]) medit_file.close(); // Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets - Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); + Mesh_criteria new_criteria(params::cell_radius_edge_ratio(3).cell_size(0.03)); // Mesh refinement CGAL::refine_mesh_3(c3t3, domain, new_criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp index c6b092e5db1..917aeec1cf4 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp @@ -29,8 +29,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -55,9 +54,9 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25).facet_size(0.05).facet_distance(0.005). + cell_radius_edge_ratio(3).cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp index a05a3aa1669..cbdf8b90b97 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp @@ -30,8 +30,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -56,9 +55,9 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25).facet_size(0.05).facet_distance(0.005). + cell_radius_edge_ratio(3).cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp index d6ab36133bc..520c1b1eb4c 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp @@ -34,8 +34,7 @@ typedef CGAL::Mesh_criteria_3 Mesh_criteria; // Sizing field typedef CGAL::Mesh_3::Lipschitz_sizing Lip_sizing; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -69,12 +68,12 @@ int main(int argc, char*argv[]) 0.5); //max_size // Mesh criteria - Mesh_criteria criteria(edge_size = min_size, - facet_angle = 25, - facet_size = min_size, - facet_distance = 0.005, - cell_radius_edge_ratio = 3, - cell_size = lip_sizing); + Mesh_criteria criteria(params::edge_size(min_size). + facet_angle(25). + facet_size(min_size). + facet_distance(0.005). + cell_radius_edge_ratio(3). + cell_size(lip_sizing)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp index 51009ad7cb8..4f81ca6ce6f 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp @@ -26,8 +26,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main(int argc, char*argv[]) { @@ -53,13 +52,16 @@ int main(int argc, char*argv[]) domain.detect_features(); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, facet_size = 0.05, facet_distance = 0.005, - cell_radius_edge_ratio = 3, cell_size = 0.05); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.05). + facet_distance(0.005). + cell_radius_edge_ratio(3). + cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - no_perturb(), no_exude()); + params::no_perturb().no_exude()); std::cerr << t.time() << " sec." << std::endl; // Output diff --git a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp index 7458ae88390..781631cdb5a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp @@ -37,8 +37,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT sphere_function1 (const Point& p) @@ -65,9 +64,11 @@ int main() K::Sphere_3(Point(1, 0, 0), 6.)); // Mesh criteria - Mesh_criteria criteria(edge_size = 0.15, - facet_angle = 25, facet_size = 0.15, - cell_radius_edge_ratio = 2, cell_size = 0.15); + Mesh_criteria criteria(params::edge_size(0.15). + facet_angle(25). + facet_size(0.15). + cell_radius_edge_ratio(2). + cell_size(0.15)); // Create edge that we want to preserve Polylines polylines (1); @@ -85,7 +86,7 @@ int main() // Mesh generation without feature preservation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, - CGAL::parameters::no_features()); + params::no_features()); std::ofstream medit_file("out-no-protection.mesh"); CGAL::IO::write_MEDIT(medit_file, c3t3); diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp index 3a22bb35526..2edfeed09cb 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface.cpp @@ -22,8 +22,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -49,13 +48,13 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, - facet_size = 0.1, - facet_distance = 0.001); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.1). + facet_distance(0.001)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp index 1ddf6772d04..58aadb62dc7 100644 --- a/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp +++ b/Mesh_3/examples/Mesh_3/remesh_polyhedral_surface_sm.cpp @@ -21,8 +21,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< // Criteria typedef CGAL::Mesh_criteria_3 Mesh_criteria; -// To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; int main() { @@ -48,13 +47,13 @@ int main() domain.detect_features(); //includes detection of borders // Mesh criteria - Mesh_criteria criteria(edge_size = 0.025, - facet_angle = 25, - facet_size = 0.1, - facet_distance = 0.001); + Mesh_criteria criteria(params::edge_size(0.025). + facet_angle(25). + facet_size(0.1). + facet_distance(0.001)); // Mesh generation - C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); + C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, params::no_perturb().no_exude()); // Output the facets of the c3t3 to an OFF file. The facets will not be // oriented. diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index f8ea786fb06..2663b352f08 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -123,21 +122,21 @@ public: } #endif - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet <4); bits_ |= char(1 << facet); } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); bits_ = char(bits_ & (15 & ~(1 << facet))); } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -194,7 +193,7 @@ public: ++this->m_erase_counter; } - /// Marks \c facet as visited + /// Marks `facet` as visited void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -206,7 +205,7 @@ public: } } - /// Marks \c facet as not visited + /// Marks `facet` as not visited void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -219,7 +218,7 @@ public: } } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -351,7 +350,7 @@ public: Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return V[i]; } @@ -374,13 +373,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -403,7 +402,7 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } @@ -412,8 +411,8 @@ public: void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -426,10 +425,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; @@ -462,7 +461,7 @@ public: // but there's not much we can do for this now. void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); invalidate_weighted_circumcenter_cache(); V[i] = v; } @@ -527,42 +526,42 @@ public: bool is_cache_valid() const { return sliver_cache_validity_; } void reset_cache_validity() const { sliver_cache_validity_ = false; } - /// Set surface index of \c facet to \c index + /// Set surface index of `facet` to `index` void set_surface_patch_index(const int facet, const Surface_patch_index& index) { CGAL_precondition(facet>=0 && facet<4); surface_index_table_[facet] = index; } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_patch_index surface_patch_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_index_table_[facet]; } - /// Sets surface center of \c facet to \c point + /// Sets surface center of `facet` to `point` void set_facet_surface_center(const int facet, const Point_3& point) { CGAL_precondition(facet>=0 && facet<4); surface_center_table_[facet] = point; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Point_3 get_facet_surface_center(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_center_table_[facet]; } - /// Sets surface center index of \c facet to \c index + /// Sets surface center index of `facet` to `index` void set_facet_surface_center_index(const int facet, const Index& index) { CGAL_precondition(facet>=0 && facet<4); surface_center_index_table_[facet] = index; } - /// Returns surface center of \c facet + /// Returns surface center of `facet` Index get_facet_surface_center_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -585,7 +584,7 @@ public: void set_surface_index(const int facet, const Surface_index& index) { set_surface_patch_index(facet,index); } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet` Surface_index surface_index(const int facet) const { return surface_patch_index(facet); } #endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h index 2cc5e2cb59d..99bc1e6b313 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -64,12 +64,12 @@ public: const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, + : Base(parameters::function = Wrapper(image, Transform(iso_value), Transform(iso_value)(value_outside)), - Mesh_3::internal::compute_bounding_box(image), - error_bound, - p_rng) + parameters::bounding_object = Mesh_3::internal::compute_bounding_box(image), + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) { CGAL_assertion(Transform(iso_value)(value_outside) == 0); } @@ -79,10 +79,10 @@ public: const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, transform, transform(value_outside)), - Mesh_3::internal::compute_bounding_box(image), - error_bound, - p_rng) + : Base(parameters::function = Wrapper(image, transform, transform(value_outside)), + parameters::bounding_object = Mesh_3::internal::compute_bounding_box(image), + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) { CGAL_assertion(transform(value_outside) == 0); } diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 3b969f95e8d..764444851de 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -65,8 +65,8 @@ public: const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(f), bounding_sphere, error_bound, - Null_subdomain_index(), p_rng) {} + : Base(parameters::function = Wrapper(f), parameters::bounding_object = bounding_sphere, parameters::relative_error_bound = error_bound, + parameters::null_subdomain_index = Null_subdomain_index(), parameters::p_rng = p_rng) {} /// Destructor virtual ~Implicit_mesh_domain_3() {} diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 31ffaee34c8..bc2ff03ff73 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -75,9 +75,9 @@ public: Subdomain_index value_outside = 0, Null null = Null(), CGAL::Random* p_rng = nullptr) - : Base(Wrapper(image, Identity(), value_outside), - compute_bounding_box(image), - error_bound, + : Base(parameters::function = Wrapper(image, Identity(), value_outside), + parameters::bounding_object = compute_bounding_box(image), + parameters::relative_error_bound = error_bound, parameters::null_subdomain_index = null, parameters::p_rng = p_rng) {} @@ -85,10 +85,10 @@ public: Labeled_image_mesh_domain_3(const Image& image, const FT error_bound, CGAL::Random* p_rng) - : Base(Wrapper(image), - compute_bounding_box(image), - error_bound, - p_rng) + : Base(parameters::function = Wrapper(image), + parameters::bounding_object = compute_bounding_box(image), + parameters::relative_error_bound = error_bound, + parameters::p_rng = p_rng) {} /// Destructor @@ -97,7 +97,7 @@ public: using Base::bbox; private: - /// Returns a box enclosing image \c im + /// Returns a box enclosing image `im` Bbox_3 compute_bounding_box(const Image& im) const { return Bbox_3(-im.vx()+im.tx(), diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 5acc5b01507..6faf6ee86ba 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -43,10 +42,7 @@ // support for implicit functions #include - -#include -#include -#include +#include #ifdef CGAL_MESH_3_VERBOSE # include #endif @@ -76,7 +72,7 @@ namespace internal { template void operator()(T*) const { } }; - /// Returns a box enclosing image \c im + // Returns a box enclosing image `im` inline Bbox_3 compute_bounding_box(const Image_3& im) { return Bbox_3(-1+im.tx(),-1+im.ty(),-1+im.tz(), @@ -124,6 +120,7 @@ namespace internal { } // end namespace CGAL::Mesh_3::internal } // end namespace CGAL::Mesh_3 +#ifndef DOXYGEN_RUNNING struct Null_subdomain_index { template bool operator()(const T& x) const { return 0 == x; } @@ -137,11 +134,15 @@ struct Construct_pair_from_subdomain_indices { return result_type(a, b); } }; // end class template Construct_pair_from_subdomain_indices +#endif + +namespace details +{ template -class Labeled_mesh_domain_3_impl_details +class Labeled_mesh_domain_3_impl { protected: typedef Surface_patch_index_ Surface_patch_index; @@ -150,7 +151,7 @@ protected: typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; typedef typename Geom_traits::FT FT; typedef std::shared_ptr CGAL_Random_share_ptr_t; - /// Returns squared error bound from \c bbox and \c error + // Returns squared error bound from `bbox` and `error` FT squared_error_bound(const Iso_cuboid_3& bbox, const FT& error) const { typename Geom_traits::Compute_squared_distance_3 squared_distance = @@ -181,28 +182,11 @@ protected: return Construct_pair_from_subdomain_indices(); } - template - Labeled_mesh_domain_3_impl_details(ArgumentPack const& args) - : function_(args[parameters::function]) - , bbox_(iso_cuboid(args[parameters::bounding_object])) - , cstr_s_p_index(args[parameters::construct_surface_patch_index | - construct_pair_functor()]) - , null(args[parameters::null_subdomain_index | Null_subdomain_index()]) - , p_rng_(args[parameters::p_rng|0] == 0 ? - CGAL_Random_share_ptr_t(new CGAL::Random(0)) : - CGAL_Random_share_ptr_t(args[parameters::p_rng|(CGAL::Random*)(0)], - Mesh_3::internal::Do_not_delete())) - , squared_error_bound_ - ( squared_error_bound(bbox_, - args[parameters::relative_error_bound|FT(1e-3)])) - { - } - template - Labeled_mesh_domain_3_impl_details(const Function& f, + Labeled_mesh_domain_3_impl(const Function& f, const Bounding_object& bounding, const FT& error_bound, Construct_surface_patch_index cstr_s_p_i, @@ -218,68 +202,135 @@ protected: , squared_error_bound_(squared_error_bound(bbox_,error_bound)) {} - /// The function which answers subdomain queries + // The function which answers subdomain queries typedef std::function Function; Function function_; - /// The bounding box + // The bounding box const Iso_cuboid_3 bbox_; typedef std::function< Surface_patch_index(Subdomain_index, Subdomain_index)> Construct_surface_patch_index; Construct_surface_patch_index cstr_s_p_index; - /// The functor that decides which sub-domain indices correspond to the - /// outside of the domain. + // The functor that decides which sub-domain indices correspond to the + // outside of the domain. typedef std::function Null; Null null; - /// The random number generator used by Construct_initial_points + // The random number generator used by Construct_initial_points CGAL_Random_share_ptr_t p_rng_; - /// Error bound relative to sphere radius + // Error bound relative to sphere radius FT squared_error_bound_; -}; // Labeled_mesh_domain_3_impl_details +}; // Labeled_mesh_domain_3_impl -/** - * \class Labeled_mesh_domain_3 - * - * Function f must take his values into N. - * Let p be a Point. - * - f(p)=0 means that p is outside domain. - * - f(p)=a, a!=0 means that p is inside subdomain a. - * - * Any boundary facet is labelled , with a, where b!=0. - */ +} // namespace details + +/*! +\ingroup PkgMesh3Domains + +\brief The class `Labeled_mesh_domain_3` implements indexed domains. + +This class is a model of concept `MeshDomain_3`. + +Any boundary facet is labeled , with a, where b!=0. + +This class includes a labeling function that provides the index of the subdomain in which any +query point lies. An intersection between a segment and bounding +surfaces is detected when both segment endpoints are associated with different +values of subdomain indices. The intersection is then constructed by bisection. +The bisection stops when the query segment is shorter than an error bound +`e` given by the product of the +length of the diagonal of the bounding box (in world coordinates), or the radius of the bounding sphere, and +a relative error bound passed as argument to the constructor of `Labeled_mesh_domain_3`. + +This class has a constructor taking a labeling function. It has also three +static template member functions that act as named constructors: +
      +
    • `create_gray_image_mesh_domain()`, to create a domain from a 3D gray image, +
    • `create_labeled_image_mesh_domain()`, to create a domain from a 3D labeled image, and +
    • `create_implicit_mesh_domain()`, to create a domain from an implicit function. +
    + +\tparam BGT is a geometric traits class that provides +the basic operations to implement +intersection tests and intersection computations +through a bisection method. This parameter must be instantiated +with a model of the concept `BisectionGeometricTraits_3`. + +\cgalHeading{Labeling function} + +A labeling function `f` must return `0` if the point isn't located in any subdomain. The return type of labeling functions is an integer. + +Let `p` be a Point. +
      +
    • `f(p)=0` means that `p` is outside domain.
    • +
    • `f(p)=a`, `a!=0` means that `p` is inside subdomain `a`.
    • +
    +`CGAL::Implicit_multi_domain_to_labeling_function_wrapper` is a good candidate for this template parameter +if there are several components to mesh. + +The function type can be any model of the concept `Callable` compatible with the signature `Subdomain_index(const Point_3&)`: it can be a function, a function object, a lambda expression... that takes a `%Point_3` as argument, and returns a type convertible to `Subdomain_index`. + +\cgalModels `MeshDomain_3` + +\sa `Implicit_multi_domain_to_labeling_function_wrapper` +\sa `CGAL::make_mesh_3()`. + +*/ template > -class Labeled_mesh_domain_3 : - protected Labeled_mesh_domain_3_impl_details +class Labeled_mesh_domain_3 +#ifndef DOXYGEN_RUNNING +: protected details::Labeled_mesh_domain_3_impl +#endif { public: //------------------------------------------------------- // Index Types //------------------------------------------------------- - /// Type of indexes for cells of the input complex + // Type of indexes for cells of the input complex +/// \name Types +///@{ + /// The subdomain index of this model of `MeshDomain_3` typedef Subdomain_index_ Subdomain_index; + // +#ifdef DOXYGEN_RUNNING + /// The type of object that stores the function using type-erasure. + typedef std::function< Subdomain_index(const Point_3 &)> Labeling_function; +///@} + +/// \name Types imported from the geometric traits class +///@{ + /// The point type of the geometric traits class + typedef typename Geom_traits::Point_3 Point_3; + /// The sphere type of the geometric traits class + typedef typename Geom_traits::Sphere_3 Sphere_3; + /// The iso-cuboid type of the geometric traits class + typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; + /// The number type (a field type) of the geometric traits class + typedef typename Geom_traits::FT FT; +///@} +#else typedef boost::optional Subdomain; - /// Type of indexes for cells of the input complex + // Type of indexes for cells of the input complex typedef Surface_patch_index_ Surface_patch_index; typedef boost::optional Surface_patch; - /// Type of indexes to characterize the lowest dimensional face of the input - /// complex on which a vertex lie + // Type of indexes to characterize the lowest dimensional face of the input + // complex on which a vertex lie typedef typename CGAL::Mesh_3::internal:: Index_generator::Index Index; private: - typedef Labeled_mesh_domain_3_impl_details Impl_details; typedef typename Impl_details::Null Null; typedef typename Impl_details::Construct_surface_patch_index @@ -287,7 +338,7 @@ private: typedef typename Impl_details::Function Function; public: - /// Geometric object types + // Geometric object types typedef typename BGT::Point_3 Point_3; typedef typename BGT::Segment_3 Segment_3; typedef typename BGT::Ray_3 Ray_3; @@ -310,208 +361,509 @@ public: typedef typename BGT::FT FT; typedef BGT Geom_traits; - - - BOOST_PARAMETER_CONSTRUCTOR(Labeled_mesh_domain_3, - (Impl_details), - parameters::tag, - (required - (function_,(Function)) - (bounding_object_,*) - ) - (optional - (relative_error_bound_, (const FT&)) - (p_rng_, (CGAL::Random*)) - (null_subdomain_index_,(Null)) - (construct_surface_patch_index_, - (Construct_surface_patch_index)) - ) - ) using Impl_details::construct_pair_functor; - /** - * Backward-compatibility constructors, with `null_subdomain_index` as - * fourth parameter. - * @{ - */ - Labeled_mesh_domain_3(const Function& f, - const Sphere_3& bounding_sphere, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bounding_sphere, - error_bound, - construct_pair_functor(), - null, p_rng) {} - - Labeled_mesh_domain_3(const Function& f, - const Bbox_3& bbox, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bbox, - error_bound, - construct_pair_functor(), - null, p_rng) {} - - Labeled_mesh_domain_3(const Function& f, - const Iso_cuboid_3& bbox, - const FT& error_bound = FT(1e-3), - Null null = Null_subdomain_index(), - CGAL::Random* p_rng = nullptr) - : Impl_details(f, bbox, error_bound, - construct_pair_functor(), - null, p_rng) - {} - /** - * @} - */ - - /// Named constructors - /// @{ -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable: 4003) #endif - // see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +/// \name Creation +/// @{ + /*! \brief Construction from a function, a bounding object and a relative error bound. + * + * \tparam Function a type compatible with `Labeling_function` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \tparam Bounding_object either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), + * or a bounding `Iso_cuboid_3` + * + * \param function the labeling function + * \param bounding_object the bounding object bounding the meshable space. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{the relative error bound used to compute intersection points between the implicit surface and query segments. + * The bisection is stopped when the length of the intersected segment is less than the product + * of `relative_error_bound` by the diameter of the bounding object.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * \cgalHeading{Example} + * From the example (\ref Mesh_3/mesh_implicit_domains_2.cpp): + * \snippet Mesh_3/mesh_implicit_domains_2.cpp Domain creation + * + */ + template + Labeled_mesh_domain_3(const Function& function, + const Bounding_object& bounding_object, + const CGAL_NP_CLASS& np = parameters::default_values(), + typename std::enable_if>::type* = nullptr) + :Impl_details(function, + bounding_object, + parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) + {} +///@} + +#ifndef DOXYGEN_RUNNING + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS& np) + :Impl_details(parameters::get_parameter(np, internal_np::function_param), + parameters::get_parameter(np, internal_np::bounding_object_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::error_bound), FT(1e-3)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::surface_patch_index), construct_pair_functor()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::null_subdomain_index_param), Null_subdomain_index()), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::rng), nullptr)) + {} + + // Overload handling parameters passed with operator= + template + Labeled_mesh_domain_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + : Labeled_mesh_domain_3(internal_np::combine_named_parameters(np1, np2, nps...)) + {} - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_gray_image_mesh_domain, - parameters::tag, - (required - (image_, (const CGAL::Image_3&)) - ) - (optional - (iso_value_, *, 0) - (value_outside_, *, 0) - (relative_error_bound_, (const FT&), - FT(1e-3)) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (image_values_to_subdomain_indices_, *, - Null_functor()) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) +#ifndef CGAL_NO_DEPRECATED_CODE + template +#if !defined(BOOST_MSVC) + CGAL_DEPRECATED +#endif + Labeled_mesh_domain_3(const Function& function, + const Bounding_object& bounding_object, + double error_bound, + typename std::enable_if>::type* = nullptr) + : Labeled_mesh_domain_3(function, + bounding_object, + parameters::relative_error_bound(error_bound)) + {} +#endif +#endif + +/// \name Creation of domains from 3D images +/// @{ + /*! + * \brief Construction from a 3D gray image + * + * This static method is a named constructor. It constructs a domain + * described by a 3D gray image. A 3D gray image is a grid of voxels, + * where each voxel is associated with a gray level value. Unless otherwise specified by the parameter `image_values_to_subdom_indices`, the domain to + * be discretized is the union of voxels that lie inside a surface + * described by an isolevel value, called \a isovalue. The voxels lying + * inside the domain have gray level values that are larger than the + * isovalue. + * + * The value of voxels is interpolated to a gray level value at any query point. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param image_ the input 3D image. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{iso_value} + * \cgalParamDescription{the isovalue, inside + * `image`, of the surface describing the boundary of the object to be + * meshed.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{image_values_to_subdomain_indices} + * \cgalParamDescription{a function or a function object, compatible with the signature + * `Subdomain_index(double)`. This function returns the subdomain index + * corresponding to a pixel value. If this parameter is used, then the + * parameter `iso_value` is ignored.} + * \cgalParamDefault{Null_functor()} + * \cgalParamNEnd + * \cgalParamNBegin{value_outside} + * \cgalParamDescription{the value attached to voxels + * outside of the domain to be meshed. It should be lower than + * `iso_value`.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Examples} + * + * From the example (\ref Mesh_3/mesh_3D_gray_image.cpp): + * + * \snippet Mesh_3/mesh_3D_gray_image.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_3D_gray_vtk_image.cpp): + * + * \snippet Mesh_3/mesh_3D_gray_vtk_image.cpp Domain creation + * + */ + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { + using parameters::get_parameter; + using parameters::choose_parameter; + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (create_gray_image_wrapper - (image_, - iso_value_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); + (p::function = create_gray_image_wrapper + (image_, + iso_value_, + image_values_to_subdomain_indices_, + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_labeled_image_mesh_domain, - parameters::tag, - (required - (image_, (const CGAL::Image_3&)) - ) - (optional - (relative_error_bound_, (const FT&), - FT(1e-3)) - (weights_, (const CGAL::Image_3&), CGAL::Image_3()) - (value_outside_, *, 0) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (image_values_to_subdomain_indices_, *, - Null_functor()) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) + /*! + * \brief Construction from a 3D labeled image + * + * This static method is a named constructor. It constructs a + * domain described by a 3D labeled image. A 3D labeled image is a grid + * of voxels, where each voxel is associated with an index (a subdomain + * index) characterizing the subdomain in which the voxel lies. The + * domain to be discretized is the union of voxels that have non-zero + * values. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \param image_ the input 3D image. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{weights} + * \cgalParamDescription{an input 3D image that provides + * weights associated to each voxel (the word type is `unsigned char`, + * and the voxels values are integers between 0 and 255). + * The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`. + * Its dimensions must be the same as the dimensions of `parameters::image`.} + * \cgalParamDefault{CGAL::Image_3()} + * \cgalParamExtra{A const reference will be taken to the parameter passed.} + * \cgalParamNEnd + * \cgalParamNBegin{value_outside} + * \cgalParamDescription{the value attached to voxels + * outside of the domain to be meshed. It should be lower than + * `iso_value`.} + * \cgalParamDefault{0} + * \cgalParamNEnd + * + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Example} + * + * From the example (\ref Mesh_3/mesh_3D_image.cpp): + * + * \snippet Mesh_3/mesh_3D_image.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_3D_weighted_image.cpp), + * where the labeled image is used with a precomputed 3D image of weights : + * + * \snippet Mesh_3/mesh_3D_weighted_image.cpp Domain creation + * + */ + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, const CGAL_NP_CLASS& np = parameters::default_values()) { + using parameters::get_parameter; + using parameters::get_parameter_reference; + using parameters::choose_parameter; + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + const CGAL::Image_3& weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), CGAL::Image_3()); + CGAL_USE(iso_value_); namespace p = CGAL::parameters; + if (weights_.is_valid()) { return Labeled_mesh_domain_3 - (create_weighted_labeled_image_wrapper - (image_, - weights_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); + (p::function = create_weighted_labeled_image_wrapper + (image_, + weights_, + image_values_to_subdomain_indices_, + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); } else { return Labeled_mesh_domain_3 - (create_labeled_image_wrapper - (image_, - image_values_to_subdomain_indices_, - value_outside_), - Mesh_3::internal::compute_bounding_box(image_), - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); + (p::function = create_labeled_image_wrapper + (image_, + image_values_to_subdomain_indices_, + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); } } +/// @} - BOOST_PARAMETER_MEMBER_FUNCTION( - (Labeled_mesh_domain_3), - static create_implicit_mesh_domain, - parameters::tag, - (required - (function_, *) - (bounding_object_,*) - ) - (optional - (relative_error_bound_, (const FT&), - FT(1e-3)) - (p_rng_, (CGAL::Random*), (CGAL::Random*)(0)) - (null_subdomain_index_,*,Null_functor()) - (construct_surface_patch_index_, *, - Null_functor()) - ) - ) +#ifndef DOXYGEN_RUNNING + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS& np) { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter; + using parameters::get_parameter_reference; + using parameters::choose_parameter; + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); + auto iso_value_ = choose_parameter(get_parameter(np, internal_np::iso_value_param), 0); + auto value_outside_ = choose_parameter(get_parameter(np, internal_np::voxel_value), 0); + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + auto image_values_to_subdomain_indices_ = choose_parameter(get_parameter(np, internal_np::image_subdomain_index), Null_functor()); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); namespace p = CGAL::parameters; return Labeled_mesh_domain_3 - (make_implicit_to_labeling_function_wrapper(function_), - bounding_object_, - p::relative_error_bound = relative_error_bound_, - p::p_rng = p_rng_, - p::null_subdomain_index = - create_null_subdomain_index(null_subdomain_index_), - p::construct_surface_patch_index = - create_construct_surface_patch_index(construct_surface_patch_index_)); + (p::function = create_gray_image_wrapper + (image_, + iso_value_, + image_values_to_subdomain_indices_, + value_outside_), + p::bounding_object = Mesh_3::internal::compute_bounding_box(image_), + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } -CGAL_PRAGMA_DIAG_POP + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL::Image_3& image_, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return create_gray_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); + } + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_gray_image_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return create_gray_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } -#if defined(BOOST_MSVC) -# pragma warning(pop) + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS& np) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + using parameters::get_parameter_reference; + const CGAL::Image_3& image_ = get_parameter_reference(np,internal_np::image_3_param); + return create_labeled_image_mesh_domain(image_, np); + } + + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL::Image_3& image_, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return create_labeled_image_mesh_domain(image_, internal_np::combine_named_parameters(np1, np2, nps...)); + } + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_labeled_image_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return create_labeled_image_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } #endif - /// @} - /** - * Constructs a set of \ccc{n} points on the surface, and output them to - * the output iterator \ccc{pts} whose value type is required to be - * \ccc{std::pair}. +/// \name Creation of domains from implicit functions +/// @{ + + /*! + * \brief Construction from an implicit function + * + * This static method is a named constructor. It constructs a domain + * whose bounding surface is described implicitly as the zero level set of a + * function. The domain to be discretized is assumed to be the domain where + * the function has negative values. + * + * The method takes as argument a bounding sphere which is required to + * circumscribe the surface and to have its center inside the domain. + * + * \tparam Function a type compatible with the signature `FT(Point_3)`: it takes a point as argument, + * and returns a scalar value. That object must be model of `CopyConstructible` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * \tparam Bounding_object either a bounding sphere (of type `Sphere_3`), a bounding box (type `Bbox_3`), + * or a bounding `Iso_cuboid_3` + * + * \param function the implicit function + * \param bounding_object object boundint the meshable domain and its center is inside the domain. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{relative_error_bound} + * \cgalParamDescription{ is the relative error + * bound, relative to the diameter of the box of the image.} + * \cgalParamDefault{FT(1e-3)} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \cgalHeading{Examples} + * + * From the example (\ref Mesh_3/mesh_implicit_sphere.cpp): + * + * \snippet Mesh_3/mesh_implicit_sphere.cpp Domain creation + * + * From the example (\ref Mesh_3/mesh_implicit_sphere_variable_size.cpp): + * + * \snippet Mesh_3/mesh_implicit_sphere_variable_size.cpp Domain creation + * + */ + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const Function& function, + const Bounding_object& bounding_object, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , typename std::enable_if>::type* = nullptr +#endif +) + { + using parameters::get_parameter; + using parameters::choose_parameter; + FT relative_error_bound_ = choose_parameter(get_parameter(np, internal_np::error_bound), FT(1e-3)); + CGAL::Random* p_rng_ = choose_parameter(get_parameter(np, internal_np::rng), nullptr); + auto null_subdomain_index_ = choose_parameter(get_parameter(np, internal_np::null_subdomain_index_param), Null_functor()); + auto construct_surface_patch_index_ = choose_parameter(get_parameter(np, internal_np::surface_patch_index), Null_functor()); + namespace p = CGAL::parameters; + return Labeled_mesh_domain_3 + (p::function = make_implicit_to_labeling_function_wrapper(function), + p::bounding_object = bounding_object, + p::relative_error_bound = relative_error_bound_, + p::p_rng = p_rng_, + p::null_subdomain_index = + create_null_subdomain_index(null_subdomain_index_), + p::construct_surface_patch_index = + create_construct_surface_patch_index(construct_surface_patch_index_)); + } +/// @} +#ifndef DOXYGEN_RUNNING + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS& np = parameters::default_values()) + { + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + static_assert(!parameters::is_default_parameter::value, "Value for required parameter not found"); + + using parameters::get_parameter; + return create_implicit_mesh_domain(parameters::get_parameter(np, internal_np::function_param), + parameters::get_parameter(np, internal_np::bounding_object_param), + np); + } + + // Overload handling parameters passed with operator= + template + static Labeled_mesh_domain_3 create_implicit_mesh_domain(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + { + return create_implicit_mesh_domain(internal_np::combine_named_parameters(np1, np2, nps...)); + } + + +#ifndef CGAL_NO_DEPRECATED_CODE + template + CGAL_DEPRECATED + static Labeled_mesh_domain_3 + create_gray_image_mesh_domain(const CGAL::Image_3& image_, + double iso_value, + double value_outside=0, + double relative_error_bound = 1e-3, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex(), + NullSubdomainIndex null_subdomain_index_ = NullSubdomainIndex(), + ConstructSurfacePatchIndex construct_surface_patch_index_ = ConstructSurfacePatchIndex()) + { + return create_gray_image_mesh_domain(image_, parameters::iso_value(iso_value) + .image_values_to_subdomain_indices(image_values_to_subdom_indices) + .value_outside(value_outside) + .relative_error_bound(relative_error_bound) + .p_rng(rng).null_subdomain_index(null_subdomain_index_) + .construct_surface_patch_index(construct_surface_patch_index_)); + } + + template + CGAL_DEPRECATED + static Labeled_mesh_domain_3 + create_labeled_image_mesh_domain(const CGAL::Image_3& image_, + double relative_error_bound, + const CGAL::Image_3& weights_ = CGAL::Image_3(), + int value_outside=0, + CGAL::Random* rng = nullptr, + SubdomainIndex image_values_to_subdom_indices = SubdomainIndex(), + NullSubdomainIndex null_subdomain_index_ = NullSubdomainIndex(), + ConstructSurfacePatchIndex construct_surface_patch_index_ = ConstructSurfacePatchIndex()) + { + return create_labeled_image_mesh_domain(image_, parameters::weights(weights_) + .image_values_to_subdomain_indices(image_values_to_subdom_indices) + .value_outside(value_outside) + .relative_error_bound(relative_error_bound) + .p_rng(rng) + .null_subdomain_index(null_subdomain_index_) + .construct_surface_patch_index(construct_surface_patch_index_)); + } +#endif + + + /* + * Constructs a set of `n` points on the surface, and output them to + * the output iterator `pts` whose value type is required to be + * `std::pair`. */ struct Construct_initial_points { @@ -525,21 +877,21 @@ CGAL_PRAGMA_DIAG_POP const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Construct_initial_points object + // Returns Construct_initial_points object Construct_initial_points construct_initial_points_object() const { return Construct_initial_points(*this); } - /** + /* * Returns a bounding box of the domain */ Bbox_3 bbox() const { return this->bbox_.bbox(); } - /** - * Returns true if point~\ccc{p} is in the domain. If \ccc{p} is in the + /* + * Returns true if point `p` is in the domain. If `p` is in the * domain, the parameter index is set to the index of the subdomain * including $p$. It is set to the default value otherwise. */ @@ -560,16 +912,16 @@ CGAL_PRAGMA_DIAG_POP const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Is_in_domain object + // Returns Is_in_domain object Is_in_domain is_in_domain_object() const { return Is_in_domain(*this); } - /** - * Returns true is the element \ccc{type} intersect properly any of the + /* + * Returns `true` if the element `type` intersect properly any of the * surface patches describing the either the domain boundary or some * subdomain boundary. - * \ccc{Type} is either \ccc{Segment_3}, \ccc{Ray_3} or \ccc{Line_3}. + * `Type` is either `Segment_3`, `Ray_3` or `Line_3`. * Parameter index is set to the index of the intersected surface patch - * if \ccc{true} is returned and to the default \ccc{Surface_patch_index} + * if `true` is returned and to the default `Surface_patch_index` * value otherwise. */ struct Do_intersect_surface @@ -593,8 +945,8 @@ CGAL_PRAGMA_DIAG_POP } private: - /// Returns true if points \c a & \c b do not belong to the same subdomain - /// \c index is set to the surface index of subdomains f(a), f(b) + // Returns true if points `a` and `b` do not belong to the same subdomain + // `index` is set to the surface index of subdomains f(a), f(b) Surface_patch operator()(const Point_3& a, const Point_3& b) const { // If f(a) != f(b), then [a,b] intersects some surface. Here we consider @@ -613,8 +965,8 @@ CGAL_PRAGMA_DIAG_POP return Surface_patch(); } - /** - * Clips \c query to a segment \c s, and call operator()(s) + /* + * Clips `query` to a segment `s`, and call `operator()(s)` */ template Surface_patch clip_to_segment(const Query& query) const @@ -631,19 +983,19 @@ CGAL_PRAGMA_DIAG_POP const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Do_intersect_surface object + // Returns Do_intersect_surface object Do_intersect_surface do_intersect_surface_object() const { return Do_intersect_surface(*this); } - /** - * Returns a point in the intersection of the primitive \ccc{type} + /* + * Returns a point in the intersection of the primitive `type` * with some boundary surface. - * \ccc{Type1} is either \ccc{Segment_3}, \ccc{Ray_3} or \ccc{Line_3}. - * The integer \ccc{dimension} is set to the dimension of the lowest + * `Type1` is either `Segment_3`, `Ray_3` or `Line_3`. + * The integer `dimension` is set to the dimension of the lowest * dimensional face in the input complex containing the returned point, and - * \ccc{index} is set to the index to be stored at a mesh vertex lying + * `index` is set to the index to be stored at a mesh vertex lying * on this face. */ struct Construct_intersection @@ -670,11 +1022,11 @@ CGAL_PRAGMA_DIAG_POP } private: - /** + /* * Returns a point in the intersection of [a,b] with the surface - * \c a must be the source point, and \c b the out point. It's important + * `a` must be the source point, and `b` the out point. It's important * because it drives bisection cuts. - * Indeed, the returned point is the first intersection from \c [a,b] + * Indeed, the returned point is the first intersection from `[a,b]` * with a subdomain surface. */ Intersection operator()(const Point_3& a, const Point_3& b) const @@ -743,7 +1095,7 @@ CGAL_PRAGMA_DIAG_POP } } - /// Clips \c query to a segment \c s, and call operator()(s) + // Clips `query` to a segment `s`, and call `operator()(s)` template Intersection clip_to_segment(const Query& query) const { @@ -759,36 +1111,36 @@ CGAL_PRAGMA_DIAG_POP const Labeled_mesh_domain_3& r_domain_; }; - /// Returns Construct_intersection object + // Returns Construct_intersection object Construct_intersection construct_intersection_object() const { return Construct_intersection(*this); } - /** + /* * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } - /** + /* * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } - /** - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + /* + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } - /** + /* * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } @@ -810,7 +1162,7 @@ CGAL_PRAGMA_DIAG_POP // ----------------------------------- protected: - /// Returns Surface_patch_index from \c i and \c j + // Returns Surface_patch_index from `i` and `j` Surface_patch_index make_surface_index(const Subdomain_index i, const Subdomain_index j) const { @@ -820,7 +1172,7 @@ protected: return this->cstr_s_p_index(j, i); } - /// Returns the bounding sphere of an Iso_cuboid_3 + // Returns the bounding sphere of an Iso_cuboid_3 Sphere_3 bounding_sphere(const Iso_cuboid_3& bbox) const { typename BGT::Construct_sphere_3 sphere = BGT().construct_sphere_3_object(); @@ -986,11 +1338,13 @@ protected: } public: - /// Returns bounding box + // Returns bounding box const Iso_cuboid_3& bounding_box() const { return this->bbox_; } +#endif //DOXYGEN_RUNNING }; // end class Labeled_mesh_domain_3 +#ifndef DOXYGEN_RUNNING //------------------------------------------------------- // Method implementation //------------------------------------------------------- @@ -1072,7 +1426,7 @@ Construct_initial_points::operator()(OutputIterator pts, #endif return pts; } - +#endif } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 2ad57f27cc0..53ada34e04b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -712,18 +712,18 @@ public: { } /** - * @brief tries to move \c old_vertex to \c new_position in the mesh + * @brief tries to move `old_vertex` to `new_position` in the mesh * @param old_vertex the old vertex * @param move the translation from the old position to the new - * @param new_position the new position of \c old_vertex + * @param new_position the new position of `old_vertex` * @param criterion the criterion which will be used to verify the new * position is ok. c3t3 minimal value of new criterion shall not decrease. * @param modified_vertices contains the vertices incident to cells which * may have been impacted by relocation * @return a pair which contains: - * - a bool which is \c true if the move has been done. + * - a bool which is `true` if the move has been done. * - a Vertex_handle which is always filled and may be the new vertex (if - * the move is a success), or the vertex which lies at \c v's position in + * the move is a success), or the vertex which lies at `v`'s position in * the updated c3t3. */ template @@ -735,7 +735,7 @@ public: OutputIterator modified_vertices, bool *could_lock_zone = nullptr); - /** @brief tries to move \c old_vertex to \c new_position in the mesh + /** @brief tries to move `old_vertex` to `new_position` in the mesh * * Same as update_mesh, but with the precondition that * Th().no_topological_change(tr_, old_vertex, new_position, @@ -750,7 +750,7 @@ public: bool *could_lock_zone = nullptr); /** - * Updates mesh moving vertex \c old_vertex to \c new_position. Returns the + * Updates mesh moving vertex `old_vertex` to `new_position`. Returns the * new vertex of the triangulation. * * Insert into modified vertices the vertices which are impacted by to move. @@ -762,7 +762,7 @@ public: bool fill_modified_vertices = true); /** - * Updates mesh moving vertex \c old_vertex to \c new_position. Returns the + * Updates mesh moving vertex `old_vertex` to `new_position`. Returns the * new vertex of the triangulation. */ Vertex_handle update_mesh(const Vertex_handle& old_vertex, @@ -799,14 +799,14 @@ public: #endif /** - * @brief Project \c p on surface, using incident facets of \c v + * @brief Project `p` on surface, using incident facets of `v` * @param v The vertex from which p was moved * @param p The point to project * @param index The index of the surface patch where v lies, if known. * @return the projected point * - * \c p is projected as follows using normal of least square fitting plane - * on \c v incident surface points. If \c index is specified, only + * `p` is projected as follows using normal of least square fitting plane + * on `v` incident surface points. If `index` is specified, only * surface points that are on the same surface patch are used to compute * the fitting plane. */ @@ -815,16 +815,16 @@ public: Surface_patch_index index = Surface_patch_index()) const; /** - * Returns the minimum value for criterion for incident cells of \c vh + * Returns the minimum value for criterion for incident cells of `vh` */ template FT min_incident_value(const Vertex_handle& vh, const SliverCriterion& criterion) const; /** - * Moves \c old_vertex to \c new_position - * Stores the cells which have to be updated in \c outdated_cells - * Updates the Vertex_handle old_vertex to its new value in \c moving_vertices + * Moves `old_vertex` to `new_position` + * Stores the cells which have to be updated in `outdated_cells` + * Updates the Vertex_handle old_vertex to its new value in `moving_vertices` * The second one (with the could_lock_zone param) is for the parallel version */ Vertex_handle move_point(const Vertex_handle& old_vertex, @@ -839,11 +839,11 @@ public: bool *could_lock_zone) const; /** - * Try to lock ALL the incident cells and return in \c cells the ones - * whose \c filter says "true". + * Try to lock ALL the incident cells and return in `cells` the ones + * whose `filter` says `true`. * Return value: - * - false: everything is unlocked and \c cells is empty - * - true: ALL incident cells are locked and \c cells is filled + * - false: everything is unlocked and `cells` is empty + * - true: ALL incident cells are locked and `cells` is filled */ template bool @@ -852,10 +852,10 @@ public: const Filter &filter) const; /** - * Try to lock ALL the incident cells and return in \c cells the slivers + * Try to lock ALL the incident cells and return in `cells` the slivers * Return value: - * - false: everything is unlocked and \c cells is empty - * - true: incident cells are locked and \c cells contains all slivers + * - false: everything is unlocked and `cells` is empty + * - true: incident cells are locked and `cells` contains all slivers */ template bool @@ -872,8 +872,8 @@ public: Cell_vector &slivers) const; /** - * Outputs to out the sliver (wrt \c criterion and \c sliver_bound) incident - * to \c v + * Outputs to out the sliver (wrt `criterion` and `sliver_bound`) incident + * to `v` */ template OutputIterator @@ -891,7 +891,7 @@ public: OutputIterator out) const; /** - * Returns the sliver (wrt \c criterion and \c sliver_bound) incident to \c v + * Returns the sliver (wrt `criterion` and `sliver_bound`) incident to `v` */ template Cell_vector @@ -917,7 +917,7 @@ public: /** - * Returns the number of slivers incident to \c v + * Returns the number of slivers incident to `v` */ template std::size_t @@ -932,8 +932,8 @@ public: const FT& sliver_bound) const; /** - * Returns the minimum criterion value of cells contained in \c cells - * Precondition: cells of \c cells must not be infinite. + * Returns the minimum criterion value of cells contained in `cells` + * Precondition: cells of `cells` must not be infinite. * Warning: Here we don't check if cells are in c3t3 */ template @@ -1092,10 +1092,10 @@ private: , c3t3_(c3t3) {} /** - * @brief Updates facet \c facet in c3t3 + * @brief Updates facet `facet` in c3t3 * @param facet the facet to update - * @param update if set to \c false, checking only is done - * @return true if \c facet is in c3t3 + * @param update if set to `false`, checking only is done + * @return true if `facet` is in c3t3 */ Surface_patch operator()(const Facet& facet, const bool update = true) const { @@ -1103,15 +1103,15 @@ private: } /** - * @brief Updates facet \c facet in c3t3 + * @brief Updates facet `facet` in c3t3 * @param facet the facet to update - * @param update_c3t3 if set to \c false, checking only is done - * @param update_surface_center if set to \c true, the facet surface + * @param update_c3t3 if set to `false`, checking only is done + * @param update_surface_center if set to `true`, the facet surface * center is updated. - * @return true if \c facet is in c3t3 + * @return true if `facet` is in c3t3 * - * By default, \c update_c3t3 is \c true, and \c update_surface_center - * is equal to \c update_c3t3. + * By default, `update_c3t3` is `true`, and `update_surface_center` + * is equal to `update_c3t3`. */ Surface_patch operator()(const Facet& facet, const bool update_c3t3, @@ -1162,10 +1162,10 @@ private: } /** - * @brief Updates cell \c ch in c3t3 + * @brief Updates cell `ch` in c3t3 * @param ch the cell to update - * @param update if set to \c false, checking only is done - * @return true if \c ch is in c3t3 + * @param update if set to `false`, checking only is done + * @return true if `ch` is in c3t3 */ Subdomain operator()(const Cell_handle& ch, const bool update = true) const { @@ -1556,7 +1556,7 @@ private: // Private methods // ----------------------------------- /** - * Returns the minimum criterion value of c3t3 cells contained in \c cells. + * Returns the minimum criterion value of c3t3 cells contained in `cells`. */ template FT min_sliver_in_c3t3_value(const Cell_vector& cells, @@ -1586,7 +1586,7 @@ private: } /** - * Removes objects of [begin,end[ range from \c c3t3_ + * Removes objects of [begin,end[ range from `c3t3_` */ template void remove_from_c3t3(ForwardIterator begin, ForwardIterator end) const @@ -1596,7 +1596,7 @@ private: } /** - * Remove cells and facets of \c cells from c3t3 + * Remove cells and facets of `cells` from c3t3 */ template < typename ForwardIterator > void remove_cells_and_facets_from_c3t3(ForwardIterator cells_begin, @@ -1608,7 +1608,7 @@ private: } /** - * Insert into \c out the vertices of range [cells_begin,cells_end[ + * Insert into `out` the vertices of range [cells_begin,cells_end[ */ template void fill_modified_vertices(InputIterator cells_begin, @@ -1688,15 +1688,15 @@ private: Surface_patch_index index = Surface_patch_index()) const; /** - * @brief Project \c p on surface, using incident facets of \c v + * @brief Project `p` on surface, using incident facets of `v` * @param v The vertex from which p was moved * @param p The point to project * @param index The index of the surface patch where v lies, if known. * @return a `boost::optional` with the projected point if the projection * was possible, or `boost::none`. * - * \c p is projected using the normal of least square fitting plane - * on \c v incident surface points. If \c index is specified, only + * `p` is projected using the normal of least square fitting plane + * on `v` incident surface points. If `index` is specified, only * surface points that are on the same surface patch are used to compute * the fitting plane. */ @@ -1706,8 +1706,8 @@ private: Surface_patch_index index = Surface_patch_index()) const; /** - * @brief Returns the projection of \c p, using direction of - * \c projection_vector + * @brief Returns the projection of `p`, using direction of + * `projection_vector` */ Bare_point project_on_surface_aux(const Bare_point& p, @@ -1715,8 +1715,8 @@ private: const Vector_3& projection_vector) const; /** - * Reverts the move from \c old_point to \c new_vertex. Returns the inserted - * vertex located at \c old_point + * Reverts the move from `old_point` to `new_vertex`. Returns the inserted + * vertex located at `old_point` * and an output iterator on outdated cells */ template @@ -1736,7 +1736,7 @@ private: } /** - * Returns the boundary of restricted facets of \c facets, + * Returns the boundary of restricted facets of `facets`, and the list of vertices of all restricted facets, which should not contain the vertex that is moving */ @@ -1746,7 +1746,7 @@ private: Vertex_set& incident_surface_vertices) const; /** - * Returns the boundary of restricted facets of \c cells + * Returns the boundary of restricted facets of `cells` and the list of vertices of all restricted facets. */ Facet_boundary @@ -1760,13 +1760,13 @@ private: } /** - * Returns false if there is a vertex belonging to one facet of \c facets + * Returns false if there is a vertex belonging to one facet of `facets` * which has not his dimension < 3 */ bool check_no_inside_vertices(const Facet_vector& facets) const; /** - * Returns the impacted cells when moving \c vertex to \c conflict_point + * Returns the impacted cells when moving `vertex` to `conflict_point` */ template OutputIterator @@ -1805,7 +1805,7 @@ private: DeletedCellsOutputIterator deleted_cells) const; /** - * Updates \c boundary wrt \c edge: if edge is already in boundary we remove + * Updates `boundary` wrt `edge`: if edge is already in boundary we remove * it, else we add it. */ void update_boundary(Facet_boundary& boundary, @@ -1831,7 +1831,7 @@ private: } /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ Facet_vector get_facets(const Cell_vector& cells) const @@ -1900,7 +1900,7 @@ private: } #else /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ template @@ -1991,7 +1991,7 @@ private: /** - * Returns the facets of \c cells (returns each facet only once i.e. use + * Returns the facets of `cells` (returns each facet only once i.e. use * canonical facet) */ template @@ -2060,7 +2060,7 @@ private: } /** - * Restore mesh for cells and facets of \c cells, using domain_ + * Restore mesh for cells and facets of `cells`, using domain_ */ template void restore_mesh(ForwardIterator first_cell, ForwardIterator last_cell) @@ -2070,7 +2070,7 @@ private: } /** - * Restore mesh for cells of \c cells and facets of \c facets, using domain_ + * Restore mesh for cells of `cells` and facets of `facets`, using domain_ */ template void restore_mesh(CellForwardIterator first_cell, @@ -2085,8 +2085,8 @@ private: } /** - * Returns true if facets of \c facets have the same boundary as - * \c old_boundary, and if the list of vertices has not changed. + * Returns true if facets of `facets` have the same boundary as + * `old_boundary`, and if the list of vertices has not changed. */ bool check_surface_mesh(const Vertex_handle& moving_vertex, const Facet_vector& facets, @@ -2113,7 +2113,7 @@ private: } /** - * Orders handles \c h1, \c h2 & \c h3 + * Orders handles `h1`, `h2` & `h3` */ template void order_handles(Handle& h1, Handle& h2, Handle& h3) const @@ -3349,8 +3349,8 @@ move_point_no_topo_change(const Vertex_handle& old_vertex, /** - * @brief Returns the projection of \c p, using direction of - * \c projection_vector + * @brief Returns the projection of `p`, using direction of + * `projection_vector` */ template typename C3T3_helpers::Bare_point diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h index e1d54932eb6..1c0adbcd617 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_plus_weights_to_labeled_function_wrapper.h @@ -107,9 +107,9 @@ public: ~Image_plus_weights_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point \c p + * Returns an int corresponding to the label at point `p`. * @param p the input point - * @return the label at point \c p + * @return the label at point `p` */ template return_type operator()(const Point_3& p) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h index 0ba137121ca..45246e4463d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h +++ b/Mesh_3/include/CGAL/Mesh_3/Image_to_labeled_function_wrapper.h @@ -72,9 +72,9 @@ public: ~Image_to_labeled_function_wrapper() {} /** - * Returns an int corresponding to the label at point \c p + * Returns an int corresponding to the label at point `p`. * @param p the input point - * @return the label at point \c p + * @return the label at point `p` */ template return_type operator()(const Point_3& p) const diff --git a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h index d4a638c78c6..f709f4b4f1a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h +++ b/Mesh_3/include/CGAL/Mesh_3/Lloyd_move.h @@ -68,7 +68,7 @@ public: typedef SizingField Sizing_field; /** - * @brief Return the move to apply on \c v according to Lloyd optimization + * @brief Returns the move to apply on `v` according to Lloyd optimization * function. */ Vector_3 operator()(const Vertex_handle& v, @@ -162,7 +162,7 @@ private: /** - * Return the move for the inside vertex \c v. + * Returns the move for the inside vertex `v`. */ Vector_3 lloyd_move_inside_domain(const Vertex_handle& v, const Cell_vector& incident_cells, @@ -210,7 +210,7 @@ private: } /** - * Return the move for the on-boundary vertex \c v. + * Returns the move for the on-boundary vertex `v`. */ Vector_3 lloyd_move_on_boundary(const Vertex_handle& v, const C3T3& c3t3, @@ -254,7 +254,7 @@ private: /** * Returns a vector containing the surface delaunay ball centers of the surface - * facets that are incident to vertex \c v. + * facets that are incident to vertex `v`. */ std::vector extract_lloyd_boundary_points(const Vertex_handle& v, const C3T3& c3t3) const @@ -298,7 +298,7 @@ private: } /** - * Return the move from \c v to the centroid of the segment [a,b]. + * Returns the move from `v` to the centroid of the segment `[a,b]`. */ Vector_3 centroid_segment_move(const Vertex_handle& v, const Bare_point& a, @@ -320,7 +320,7 @@ private: } /** - * Return the move from \c v to the centroid of triangle [a,b,c]. + * Returns the move from `v` to the centroid of triangle `[a,b,c]`. */ Vector_3 centroid_triangle_move(const Vertex_handle& v, const Bare_point& a, @@ -397,7 +397,7 @@ private: } /** - * Return the move from \c v to the centroid of polygon[first,last]. + * Returns the move from `v` to the centroid of polygon `[first,last]`. * The polygon has to be convex. */ template @@ -523,8 +523,8 @@ private: } /** - * Turn around the edge \c edge and add the values computed from tets made by - * `v` and the circumcenters of cells incident to \c edge. + * Turns around the edge `edge` and adds the values computed from tets made by + * `v` and the circumcenters of cells incident to `edge`. * * Note that this function abundantly uses dual() calls and using a cell base * which stores the circumcenter thus improves its efficiency. diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h index adf53d159c5..714430116f6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h @@ -313,19 +313,19 @@ public: private: /** - * Returns moves for vertices of set \c moving_vertices + * Returns moves for vertices of set `moving_vertices`. */ Moves_vector compute_moves(Moving_vertices_set& moving_vertices); /** - * Returns the move for vertex \c v + * Returns the move for vertex `v`. * \warning This function should be called only on moving vertices * even for frozen vertices, it could return a non-zero vector */ Vector_3 compute_move(const Vertex_handle& v); /** - * Updates mesh using moves of \c moves vector. Updates moving_vertices with + * Updates mesh using moves of `moves` vector. Updates moving_vertices with * the new set of moving vertices after the move. */ void update_mesh(const Moves_vector& moves, @@ -343,17 +343,17 @@ private: bool check_convergence() const; /** - * Returns the average circumradius length of cells incident to \c v + * Returns the average circumradius length of cells incident to `v`. */ FT average_circumradius_length(const Vertex_handle& v) const; /** - * Returns the minimum cicumradius length of cells incident to \c v + * Returns the minimum cicumradius length of cells incident to `v`. */ FT min_circumradius_sq_length(const Vertex_handle& v, const Cell_vector& incident_cells) const; /** - * Returns the squared circumradius length of cell \c cell + * Returns the squared circumradius length of cell `cell`. */ FT sq_circumradius_length(const Cell_handle& cell, const Vertex_handle& v) const; diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h index 84c84128618..e1d52d202f2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_sizing_field.h @@ -107,42 +107,42 @@ public: Mesh_sizing_field(Tr& tr); /** - * Fill sizing field, using size associated to point in \c value_map + * Fills sizing field, using size associated to point in `value_map` */ void fill(const std::map& value_map); /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Bare_point& p) const { return this->operator()(p, this->get_last_cell()); } /** - * Returns size at point \c p, using \c v to accelerate \c p location + * Returns size at point `p`, using `v` to accelerate `p` location * in triangulation */ FT operator()(const Bare_point& p, const Vertex_handle& v) const { return this->operator()(p, v->cell()); } /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Bare_point& p, const Cell_handle& c) const; /** - * Returns size at point \c p. Assumes that p is the centroid of c. + * Returns size at point `p`. Assumes that p is the centroid of c. */ FT operator()(const Bare_point& p, const std::pair& c) const; private: /** - * Returns size at point \c p, by interpolation into tetrahedron. + * Returns size at point `p`, by interpolation into tetrahedron. */ FT interpolate_on_cell_vertices(const Bare_point& p, const Cell_handle& cell) const; /** - * Returns size at point \c p, by interpolation into facet (\c cell is assumed + * Returns size at point `p`, by interpolation into facet (`cell` is assumed * to be an infinite cell). */ FT interpolate_on_facet_vertices(const Bare_point& p, diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h index f0db722f898..3483e08ac54 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h @@ -55,21 +55,21 @@ public: Mesh_surface_cell_base_3_base() : bits_(0) {} - /// Marks \c facet as visited + /// Marks `facet` as visited. void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet <4); bits_ |= (1 << facet); } - /// Marks \c facet as not visited + /// Marks `facet` as not visited. void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); bits_ &= (15 & ~(1 << facet)); } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited. bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -92,7 +92,7 @@ public: bits_ = 0; } - /// Marks \c facet as visited + /// Marks `facet` as visited. void set_facet_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -103,7 +103,7 @@ public: } } - /// Marks \c facet as not visited + /// Marks `facet` as not visited. void reset_visited (const int facet) { CGAL_precondition(facet>=0 && facet<4); @@ -114,7 +114,7 @@ public: } } - /// Returns \c true if \c facet is marked as visited + /// Returns `true` if `facet` is marked as visited. bool is_facet_visited (const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -187,42 +187,42 @@ public: // Default copy constructor and assignment operator are ok - /// Set surface index of \c facet to \c index + /// Sets surface index of `facet` to `index` void set_surface_patch_index(const int facet, const Surface_patch_index& index) { CGAL_precondition(facet>=0 && facet<4); surface_index_table_[facet] = index; } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet`. Surface_patch_index surface_patch_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_index_table_[facet]; } - /// Sets surface center of \c facet to \c point + /// Sets surface center of `facet` to `point`. void set_facet_surface_center(const int facet, const Point& point) { CGAL_precondition(facet>=0 && facet<4); surface_center_table_[facet] = point; } - /// Returns surface center of \c facet + /// Returns surface center of `facet`. Point get_facet_surface_center(const int facet) const { CGAL_precondition(facet>=0 && facet<4); return surface_center_table_[facet]; } - /// Sets surface center index of \c facet to \c index + /// Sets surface center index of `facet` to `index`. void set_facet_surface_center_index(const int facet, const Index& index) { CGAL_precondition(facet>=0 && facet<4); surface_center_index_table_[facet] = index; } - /// Returns surface center of \c facet + /// Returns surface center of `facet`. Index get_facet_surface_center_index(const int facet) const { CGAL_precondition(facet>=0 && facet<4); @@ -245,7 +245,7 @@ public: void set_surface_index(const int facet, const Surface_index& index) { set_surface_patch_index(facet,index); } - /// Returns surface index of facet \c facet + /// Returns surface index of facet `facet`. Surface_index surface_index(const int facet) const { return surface_patch_index(facet); } #endif // CGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index 1a13e725a44..e8f105cd241 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -568,7 +568,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix) std::cerr << "Total refining surface time: " << timer.time() << "s" << std::endl; std::cerr << std::endl; - CGAL_triangulation_postcondition(r_tr.is_valid()); + CGAL_postcondition(r_tr.is_valid()); elapsed_time += timer.time(); timer.stop(); timer.reset(); timer.start(); @@ -613,7 +613,7 @@ refine_mesh(std::string dump_after_refine_surface_prefix) std::cerr << "Total refining time: " << timer.time()+elapsed_time << "s" << std::endl; std::cerr << std::endl; - CGAL_triangulation_postcondition(r_tr.is_valid()); + CGAL_postcondition(r_tr.is_valid()); #endif (void)(forced_stop()); // sets *error_code diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index fc2727797d1..752e7630119 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -120,7 +120,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits /** Traits class that defines types for the triangulation. */ > @@ -198,7 +198,7 @@ public: { } - /** \name FUNCTIONS IMPLEMENTED IN THE CLASS \c Derived */ + /** \name FUNCTIONS IMPLEMENTED IN THE CLASS `Derived` */ /** Access to the triangulation */ Triangulation& triangulation() @@ -248,7 +248,7 @@ public: return derived().number_of_bad_elements_impl(); } - /** Tells if, as regards the elements of type \c Element, the refinement is + /** Tells if, as regards the elements of type `Element`, the refinement is done. */ bool no_longer_element_to_refine() { @@ -292,13 +292,13 @@ public: visitor.previous_level()); } - /** Gives the point that should be inserted to refine the element \c e */ + /** Gives the point that should be inserted to refine the element `e` */ Bare_point refinement_point(const Element& e) { return derived().refinement_point_impl(e); } - /** Actions before testing conflicts for point \c p and element \c e */ + /** Actions before testing conflicts for point `p` and element `e` */ template void before_conflicts(const Element& e, const Point& p, Mesh_visitor visitor) @@ -311,7 +311,7 @@ public: point conflicts with something, and do what is needed. The return type is made of two booleans: - the first one tells if the point can be inserted, - - in case of, the first one is \c false, the second one tells if + - in case of, the first one is `false`, the second one tells if the tested element should be reconsidered latter. */ Mesher_level_conflict_status private_test_point_conflict(const Point& p, @@ -321,8 +321,8 @@ public: } /** - * Actions before inserting the point \c p in order to refine the - * element \c e. The zone of conflicts is \c zone. + * Actions before inserting the point `p` in order to refine the + * element `e`. The zone of conflicts is `zone`. */ template void before_insertion(Element& e, const Point& p, Zone& zone, @@ -343,7 +343,7 @@ public: visitor.after_insertion(vh); } - /** Actions after testing conflicts for point \c p and element \c e + /** Actions after testing conflicts for point `p` and element `e` * if no point is inserted. */ template void after_no_insertion(const Element& e, const Point& p, Zone& zone, @@ -361,7 +361,7 @@ public: */ /** - * Tells it the algorithm is done, regarding elements of type \c Element + * Tells it the algorithm is done, regarding elements of type `Element` * or elements of previous levels. */ bool is_algorithm_done() @@ -383,7 +383,7 @@ public: /** * This function takes one element from the queue, and try to refine - * it. It returns \c true if one point has been inserted. + * it. It returns `true` if one point has been inserted. * @todo Merge with try_to_refine_element(). */ template @@ -426,7 +426,7 @@ public: /** \name STEP BY STEP FUNCTIONS */ /** - * Inserts exactly one point, if possible, and returns \c false if no + * Inserts exactly one point, if possible, and returns `false` if no * point has been inserted because the algorithm is done. */ template @@ -457,7 +457,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits, /** Traits class that defines types for the triangulation. */ typename Concurrency_tag> @@ -519,8 +519,8 @@ public: point conflicts with something, and do what is needed. The return type is made of two booleans: - the first one tells if the point can be inserted, - - in case of, the first one is \c false, the second one tells if - the tested element should be reconsidered latter. + - in case of, the first one is `false`, the second one tells if + the tested element should be reconsidered later. This function is called by the superior level, if any. */ Mesher_level_conflict_status @@ -648,7 +648,7 @@ public: /** * Applies one step of the algorithm: tries to refine one element of - * previous level or one element of this level. Return \c false iff + * previous level or one element of this level. Return `false` iff * is_algorithm_done()==true . */ template @@ -681,7 +681,7 @@ template < class Element, /**< Type of elements that this level refines. */ class Previous, /* = Null_mesher_level, */ /**< Previous level type, defaults to - \c Null_mesher_level. */ + `Null_mesher_level`. */ class Triangulation_traits> /** Traits class that defines types for the triangulation. */ class Mesher_level @@ -1109,7 +1109,7 @@ public: /** * Applies one step of the algorithm: tries to refine one element of - * previous level or one element of this level. Return \c false iff + * previous level or one element of this level. Return `false` iff * is_algorithm_done()==true . * Note that when parallelism is activated, this is not "one step" * but the full refinement. diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index e12f3418da5..a32cbaf4709 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -196,8 +196,8 @@ private: Vertex_handle get_vertex_corner_from_point(const Bare_point& p, const Index& p_index) const; - /// Insert point(p,w) into the triangulation and set its dimension to \c dim - /// and its index to \c index. + /// Inserts `point(p,w)` into the triangulation and set its dimension to `dim` + /// and its index to `index`. /// The handle of the newly created vertex is returned. Vertex_handle insert_point(const Bare_point& p, const Weight& w, @@ -206,8 +206,8 @@ private: const bool special_ball = false); /** - * Insert point(p,w) into the triangulation and set its dimension to \c dim and - * its index to \c index. + * Inserts `point(p,w)` into the triangulation and set its dimension to `dim` and + * its index to `index`. * The handle of the newly created vertex is returned. * * This function also ensures that `point(p,w)` will not be inside a @@ -223,12 +223,12 @@ private: const Index& index, ErasedVeOutIt out); - /// Insert balls between the points identified by the handles \c vp and \c vq - /// on the curve identified by \c curve_index. + /// Inserts balls between the points identified by the handles `vp` and `vq` + /// on the curve identified by `curve_index`. /// - /// \param orientation Orientation of the curve segment between \c vp and - /// \c vq, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `vp` and + /// `vq`, given the orientation of the curve of index + /// `curve_index` template ErasedVeOutIt insert_balls(const Vertex_handle& vp, const Vertex_handle& vq, @@ -251,25 +251,25 @@ private: const Curve_index& curve_index, ErasedVeOutIt out); - /// Return `true` if the balls of \c va and \c vb intersect, and (va,vb) is not + /// Returns `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not /// an edge of the complex. bool non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Return `true` if the balls of \c va and \c vb intersect. + /// Returns `true` if the balls of `va` and `vb` intersect. bool do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Change the size of the ball of the vertex \c v. + /// Changes the size of the ball of the vertex `v`. Vertex_handle change_ball_size(const Vertex_handle& v, const FT squared_size, const bool special_ball = false); - /// Return `true` if balls of v1 and v2 intersect "enough". - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// Returns `true` if balls of v1 and v2 intersect "enough". + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index` bool is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, @@ -280,17 +280,17 @@ private: /// of those vertices is ok. If not, fix it. void check_and_repopulate_edges(); - /// Check if the vertex \c v is well sampled, and if its not the case, fix it. - /// Fill `out` with deleted vertices during this process. The value type of `out` + /// Checks if the vertex `v` is well sampled, and if its not the case, fix it. + /// Fills `out` with deleted vertices during this process. The value type of `out` /// is `Vertex_handle`. template ErasedVeOutIt check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out); - /// Given two vertices \c start and \c next inserted on the curve with - /// index \c curve_index, return `CGAL::POSITIVE` if the curve arc from - /// \c start to \c next is oriented in the same orientation as the curve - /// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise. + /// Given two vertices `start` and `next` inserted on the curve with + /// index `curve_index`, returns `CGAL::POSITIVE` if the curve arc from + /// `start` to `next` is oriented in the same orientation as the curve + /// segment with index `curve_index`, or `CGAL::NEGATIVE` otherwise. /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` CGAL::Orientation @@ -298,13 +298,13 @@ private: const Vertex_handle& next, Curve_index curve_index) const; - /// Walk along the edge from \c start, following the direction \c start to - /// \c next, and fills \c out with the vertices which do not fulfill + /// Walks along the edge from `start`, following the direction `start` to + /// `next`, and fills `out` with the vertices which do not fulfill /// the sampling conditions. /// - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` template @@ -315,8 +315,8 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out) const; - /// Return the next vertex along edge, i.e the vertex after \c start, following - /// the direction from \c previous to \c start. + /// Returns the next vertex along edge, i.e the vertex after `start`, following + /// the direction from `previous` to `start`. /// \pre (previous,start) is in c3t3 /// \pre `c3t3.curve_index(start, previous) == curve_index` Vertex_handle @@ -324,13 +324,13 @@ private: const Vertex_handle& previous, const Curve_index& curve_index) const; - /// Replace the vertices between ]begin,last[ with new vertices, along the curve - /// identified by \c curve_index. + /// Replaces the vertices within `]begin,last[` with new vertices, along the curve + /// identified by `curve_index`. /// The value type of `InputIterator` is `Vertex_handle`. /// - /// \param orientation Orientation of the curve segment between \c begin and - /// \c last, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `begin` and + /// `last`, given the orientation of the curve of index + /// `curve_index` /// template ErasedVeOutIt repopulate(InputIterator begin, @@ -346,33 +346,33 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out); - /// Check if the size of \c v2 is compatible (i.e. greater) with the linear - /// interpolation of the sizes of \c v1 and \c v3. + /// Checks if the size of `v2` is compatible (i.e. greater) with the linear + /// interpolation of the sizes of `v1` and `v3`. bool is_sizing_field_correct(const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, const Curve_index& index, const CGAL::Orientation orientation) const; - /// Repopulate all incident curves around the corner \c v. - /// \pre \c v is a corner of c3t3 + /// Repopulates all incident curves around the corner `v`. + /// \pre `v` is a corner of c3t3 template ErasedVeOutIt repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); - /// Return `true` if the edge with index \c curve_index is already treated. + /// Returns `true` if the edge with index `curve_index` is already treated. bool is_treated(const Curve_index& curve_index) const { return ( treated_edges_.find(curve_index) != treated_edges_.end() ); } - /// Set the edge with index \c curve_index as treated. + /// Sets the edge with index `curve_index` as treated. void set_treated(const Curve_index& curve_index) { treated_edges_.insert(curve_index); } - /// Compute the Euclidean distance between the bare points of \c va and \c vb. + /// Computes the Euclidean distance between the bare points of `va` and `vb`. FT compute_distance(const Vertex_handle& va, const Vertex_handle& vb) const { typename C3T3::Triangulation::Geom_traits::Construct_point_3 cp = @@ -384,14 +384,14 @@ private: return compute_distance(cp(wpa), cp(wpb)); } - /// Compute the Euclidean distance between the bare points \c and \c q. + /// Computes the Euclidean distance between the bare points `p` and `q`. FT compute_distance(const Bare_point& p, const Bare_point& q) const { return CGAL::sqrt(c3t3_.triangulation().geom_traits(). compute_squared_distance_3_object()(p,q)); } - /// Return the radius of the ball of vertex \c v. + /// Returns the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { typename Gt::Compute_weight_3 cw = diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h index f3d1e0ba7fa..4ee48c865ea 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -438,7 +438,7 @@ public: // Parallel: it's always lazy, so do nothing void remove_element_from_refinement_queue(Cell_handle, Parallel_tag) {} - /// Handle cells contained in \c zone (before their destruction by insertion) + /// Handles cells contained in `zone` (before their destruction by insertion) void before_insertion_handle_cells_in_conflict_zone(Zone& zone); bool try_lock_element(const Cell_handle &ch, int lock_radius = 0) const @@ -479,7 +479,7 @@ public: return sstr.str(); } - /// Adds \c cell to the refinement queue if needed + /// Adds `cell` to the refinement queue if needed. void treat_new_cell(const Cell_handle& cell); #ifdef CGAL_MESH_3_MESHER_STATUS_ACTIVATED @@ -531,20 +531,20 @@ private: // Updates cells incident to vertex, and add them to queue if needed void update_star_self(const Vertex_handle& vertex); - /// Set \c cell to domain, with subdomain index \c index + /// Sets `cell` to domain, with subdomain index `index`. void set_cell_in_domain(const Cell_handle& cell, const Subdomain_index& index) { r_c3t3_.add_to_complex(cell, index); } - /// Removes \c cell from domain + /// Removes `cell` from domain. void remove_cell_from_domain(const Cell_handle& cell) { r_c3t3_.remove_from_complex(cell); } - /// Sets index and dimension of vertex \c v + /// Sets index and dimension of vertex `v`. void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); @@ -702,15 +702,18 @@ scan_triangulation_impl() { #if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) std::cerr << "Scanning triangulation for bad cells (sequential)... "; + int count = 0; #endif - int count = 0; + for(Finite_cell_iterator cell_it = r_tr_.finite_cells_begin(); cell_it != r_tr_.finite_cells_end(); ++cell_it) { treat_new_cell(cell_it); +#if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) ++count; +#endif } #if defined(CGAL_MESH_3_VERBOSE) || defined(CGAL_MESH_3_PROFILING) std::cerr << count << " cells scanned, "; diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index 2f0db096e09..53461adecf3 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -409,19 +409,19 @@ protected: return ( (facet < mirror)?facet:mirror ); } - /// Returns true if \c f has already been visited + /// Returns true if `f` has already been visited. bool is_facet_visited(const Facet& f) const { return f.first->is_facet_visited(f.second); } - /// Sets facet \c f to visited + /// Sets facet `f` to visited. void set_facet_visited(Facet& f) const { f.first->set_facet_visited(f.second); } - /// Sets the facet \c f and its mirrored facet's surface centers to \c p + /// Sets the facet `f` and its mirrored facet's surface centers to `p`. void set_facet_surface_center(const Facet& f, const Bare_point& p, const Index& index) const @@ -435,32 +435,32 @@ protected: mirror.first->set_facet_surface_center_index(mirror.second,index); } - /// Returns facet surface center of \c f + /// Returns facet surface center of `f`. Bare_point get_facet_surface_center(const Facet& f) const { return f.first->get_facet_surface_center(f.second); } - /// Returns index of surface center of facet \c f + /// Returns index of surface center of facet `f`. Index get_facet_surface_center_index(const Facet& f) const { return f.first->get_facet_surface_center_index(f.second); } - /// Sets \c f to surface facets, with index \c index + /// Sets `f` to surface facets, with index `index`. void set_facet_on_surface(const Facet& f, const Surface_patch_index& index) { r_c3t3_.add_to_complex(f, index); } - /// Returns index of facet \c f + /// Returns index of facet `f`. Surface_patch_index get_facet_surface_index(const Facet& f) const { return r_c3t3_.surface_patch_index(f.first, f.second); } - /// Sets index and dimension of vertex \c v + /// Sets index and dimension of vertex `v`. void set_vertex_properties(Vertex_handle& v, const Index& index) { r_c3t3_.set_index(v, index); @@ -554,13 +554,13 @@ protected: return stream.str(); } - /// Returns to if \c f is on surface + /// Returns to if `f` is on surface bool is_facet_on_surface(const Facet& f) const { return r_c3t3_.is_in_complex(f) ; } - /// Removes \c f from surface facets + /// Removes `f` from surface facets. void remove_facet_from_surface(const Facet& f) { r_c3t3_.remove_from_complex(f); @@ -595,9 +595,9 @@ protected: void treat_new_facet(Facet& facet); /** - * Computes at once is_facet_on_surface and facet_surface_center. + * Computes simultaneously `is_facet_on_surface` and `facet_surface_center`. * @param facet The input facet - * @return \c true if \c facet is on surface, \c false otherwise + * @return `true` if `facet` is on surface, `false` otherwise */ void compute_facet_properties(const Facet& facet, Facet_properties& fp, bool force_exact = false ) const; @@ -835,12 +835,12 @@ public: Container_::get_next_local_element_impl()); } - /// Tests if \c p encroaches facet from zone + /// Tests if `p` encroaches facet from `zone`. // For sequential Mesher_level_conflict_status test_point_conflict_from_superior_impl(const Weighted_point& p, Zone& zone); - /// Tests if \c p encroaches facet from zone + /// Tests if `p` encroaches facet from `zone`. // For parallel template Mesher_level_conflict_status @@ -875,7 +875,7 @@ public: , bool &facet_is_in_its_cz , bool &could_lock_zone); - /// Insert \c p into the triangulation + /// Inserts `p` into the triangulation. Vertex_handle insert_impl(const Weighted_point& p, const Zone& zone); bool try_lock_element(const Facet &f, int lock_radius = 0) const @@ -1836,8 +1836,8 @@ is_encroached_facet_refinable(Facet& facet) const } /** - * \c facet is an internal facet we are going to remove - * \c source_facet is the facet we want to refine by inserting a new point + * `facet` is an internal facet we are going to remove + * `source_facet` is the facet we want to refine by inserting a new point */ template bool diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 483c96be347..222eb87cc76 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -553,7 +553,7 @@ private: int build_priority_queue(const FT& sliver_bound, PQueue& pqueue) const; /** - * Updates priority queue for all vertices of \c vertices + * Updates priority queue for all vertices of `vertices`. */ // Sequential int update_priority_queue(const Vertex_vector& vertices, @@ -568,7 +568,7 @@ private: #endif /** - * Updates \c pv in priority queue + * Updates `pv` in priority queue. */ int update_priority_queue(const PVertex& pv, PQueue& pqueue) const; @@ -582,7 +582,7 @@ private: ) const; /** - * Returns a pvertex from a vertex handle \c vh, using id \c pv_id + * Returns a pvertex from a vertex handle `vh`, using the id `pv_id`. */ PVertex make_pvertex(const Vertex_handle& vh, @@ -595,13 +595,13 @@ private: const typename PVertex::id_type& pv_id) const; /** - * Updates a pvertex \c pv + * Updates a pvertex `pv`. */ void update_pvertex(PVertex& pv, const FT& sliver_bound) const; void update_pvertex__concurrent(PVertex& pv, const FT& sliver_bound) const; /** - * Returns \c vh pvertex id + * Returns `vh` pvertex id. */ typename PVertex::id_type get_pvertex_id(const Vertex_handle& vh) const { @@ -609,7 +609,7 @@ private: } /** - * Update bad vertices vector, wrt \c sliver_bound + * Updates bad vertices vector, wrt. `sliver_bound`. */ // Sequential void update_bad_vertices(std::vector &bad_vertices, diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index aea8be9a40f..0f77cd3e283 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -157,7 +157,7 @@ protected: } /** - * A functor to remove one \c Cell_handle from a priority queue + * A functor to remove one `Cell_handle` from a priority queue */ class Erase_from_queue { @@ -172,7 +172,7 @@ protected: }; /** - * Delete cells of \c cells from \c cells_queue + * Deletes cells of `cells` from `cells_queue`. */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -288,7 +288,7 @@ protected: } /** - * A functor to remove one \c Cell_handle from a priority queue + * A functor to remove one `Cell_handle` from a priority queue */ class Erase_from_queue { @@ -300,7 +300,7 @@ protected: }; /** - * Delete cells of \c cells from \c cells_queue + * Deletes cells of `cells` from `cells_queue`. */ void delete_cells_from_queue(const Cell_vector& cells) { @@ -525,7 +525,7 @@ private: const Vertex_handle& new_vertex); /** - * Orders handles \c h1 & \c h2 + * Orders handles `h1` & `h2` */ template static @@ -594,8 +594,8 @@ private: /** - * Returns the \c Boundary_facets_from_outside object containing mirror facets - * of \c facets + * Returns the `Boundary_facets_from_outside` object containing mirror facets + * of `facets`. */ Boundary_facets_from_outside get_boundary_facets_from_outside(const Facet_vector& facets) const @@ -616,7 +616,7 @@ private: } /** - * Add a cell \c ch to \c cells_queue + * Adds a cell `ch` to `cells_queue`. */ template void add_cell_to_queue(Cell_handle ch, FT criterion_value) @@ -651,7 +651,7 @@ private: }; /** - * Removes objects of [begin,end[ range from \c c3t3_ + * Removes objects of [begin,end[ range from `c3t3_`. */ template void remove_from_c3t3(ForwardIterator begin, ForwardIterator end) @@ -852,8 +852,8 @@ private: const Vertex_handle& vh) const; /** - * Checks if the sliver criterion values from \c criterion_values are the same as - * those that will be found if wp is inserted in the triangulation + * Checks if the sliver criterion values from `criterion_values` are the same as + * those that will be found if wp is inserted in the triangulation. */ bool check_ratios(const Sliver_values& criterion_values, const Weighted_point& wp, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h index 4fe3b7e8f34..7de442b25fb 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h @@ -109,8 +109,8 @@ public: ~Triangulation_helpers() {} /** - * Returns true if moving \c v to \c p makes no topological - * change in \c tr + * Returns `true` if moving `v` to `p` makes no topological + * change in `tr`. */ bool no_topological_change(Tr& tr, const Vertex_handle v, @@ -137,7 +137,7 @@ public: const Bare_point& p) const; /** - * Returns the squared distance from \c vh to its closest vertex + * Returns the squared distance from `vh` to its closest vertex. * * \pre `vh` is not the infinite vertex */ @@ -156,7 +156,7 @@ public: private: /** - * Returns true if \c v is well_oriented on each cell of \c cell_tos + * Returns `true` if `v` is well_oriented on each cell of `cell_tos`. */ // For sequential version bool well_oriented(const Tr& tr, diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h index 11cf08c0e61..547365f9a1e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_sizing_field.h @@ -73,17 +73,17 @@ public: Triangulation_sizing_field(const Tr& tr); /** - * Fill sizing field, using size associated to point in \c value_map. + * Fills the sizing field, using size associated to point in `value_map`. */ void fill(const std::map& value_map); /** - * Returns size at point \c p. + * Returns size at point `p`. */ FT operator()(const Weighted_point& p) const; /** - * Returns size at point \c p. (needed for compatibility) + * Returns size at point `p`. (needed for compatibility) */ template FT operator()(const Weighted_point& p, const Handle&) const @@ -91,20 +91,20 @@ public: private: /** - * Returns size at point \c p, by interpolation into tetrahedron. + * Returns size at point `p`, by interpolation into tetrahedron. */ FT interpolate_on_cell_vertices(const Weighted_point& p, const CCell_handle& cell) const; /** - * Returns size at point \c p, by interpolation into facet (\c cell is assumed + * Returns size at point `p`, by interpolation into facet (`cell` is assumed * to be an infinite cell). */ FT interpolate_on_facet_vertices(const Weighted_point& p, const CCell_handle& cell) const; /** - * Returns a hint for \c p location. + * Returns a hint for `p` location. */ CCell_handle get_hint(const Weighted_point& p) const { return last_cell_; } diff --git a/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h b/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h index 827ded14bdc..a1b3ee34192 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h +++ b/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h @@ -739,7 +739,8 @@ public: { int num_flushed_items = 0; - std::vector tasks; + std::vector tasks; + tasks.reserve(m_tls_work_buffers.size()); for (TLS_WorkBuffer::iterator it_buffer = m_tls_work_buffers.begin() ; it_buffer != m_tls_work_buffers.end() ; @@ -753,7 +754,7 @@ public: } } - for (std::vector::const_iterator it = tasks.begin() ; + for (auto it = tasks.begin() ; it != tasks.end() ; ++it) { enqueue_task(*it, task_group); @@ -772,16 +773,15 @@ protected: typedef WorkBatch WorkBuffer; typedef tbb::enumerable_thread_specific TLS_WorkBuffer; - WorkBatchTask *create_task(const WorkBuffer &wb) const + WorkBatchTask create_task(const WorkBuffer &wb) const { - auto ptr = tbb::scalable_allocator().allocate(1); - return new(ptr) WorkBatchTask(wb); + return { wb }; } - void enqueue_task(WorkBatchTask *task, + void enqueue_task(const WorkBatchTask& task, tbb::task_group &task_group) const { - task_group.run(*task); + task_group.run(task); } void add_batch_and_enqueue_task(const WorkBuffer &wb, diff --git a/Mesh_3/include/CGAL/Mesh_3/generate_label_weights.h b/Mesh_3/include/CGAL/Mesh_3/generate_label_weights.h index 1f1a8014a13..6d89ef94dba 100644 --- a/Mesh_3/include/CGAL/Mesh_3/generate_label_weights.h +++ b/Mesh_3/include/CGAL/Mesh_3/generate_label_weights.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -108,6 +108,40 @@ SIGN get_sign() // SGN_UNKNOWN } +#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG +template +void convert_itk_to_image_3(itk::Image* const itk_img, + const char* filename) +{ + auto t = itk_img->GetOrigin(); + auto v = itk_img->GetSpacing(); + auto region = itk_img->GetRequestedRegion(); + + _image* img + = _createImage(region.GetSize(0), region.GetSize(1), region.GetSize(2), + 1, //vectorial dimension + v[0], v[1], v[2], + sizeof(Image_word_type), //image word size in bytes + internal::get_wordkind(), //image word kind WK_FIXED, WK_FLOAT, WK_UNKNOWN + internal::get_sign()); //image word sign + Image_word_type* img_ptr = (Image_word_type*)(img->data); + + const int size = region.GetSize(0) * region.GetSize(1) * region.GetSize(2); + std::fill(img_ptr, + img_ptr + size, + Image_word_type(0)); + img->tx = t[0]; + img->ty = t[1]; + img->tz = t[2]; + + std::copy(itk_img->GetBufferPointer(), + itk_img->GetBufferPointer() + size, + img_ptr); + + _writeImage(img, filename); +} +#endif + }//namespace internal /// @cond INTERNAL @@ -141,9 +175,14 @@ CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& i std::set labels; internal::convert_image_3_to_itk(image, itk_img.GetPointer(), labels); +#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG + CGAL_assertion(internal::count_non_white_pixels(image) + == internal::count_non_white_pixels(itk_img.GetPointer())); +#endif + using DuplicatorType = itk::ImageDuplicator; using IndicatorFilter = itk::BinaryThresholdImageFilter; - using GaussianFilterType = itk::RecursiveGaussianImageFilter; + using GaussianFilterType = itk::DiscreteGaussianImageFilter; using MaximumImageFilterType = itk::MaximumImageFilter; std::vector indicators(labels.size()); @@ -178,12 +217,27 @@ CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& i indicator->SetUpperThreshold(label); indicator->Update(); +#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG + std::ostringstream oss; + oss << "indicator_" << id << ".inr.gz"; + std::cout << "filename = " << oss.str().c_str() << std::endl; + internal::convert_itk_to_image_3(indicator->GetOutput(), oss.str().c_str()); +#endif + //perform gaussian smoothing typename GaussianFilterType::Pointer smoother = GaussianFilterType::New(); + smoother->SetUseImageSpacing(true);//variance/std deviation is counted real world distances smoother->SetInput(indicator->GetOutput()); - smoother->SetSigma(sigma); + smoother->SetVariance(sigma*sigma); smoother->Update(); +#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG + std::ostringstream oss1; + oss1 << "smooth_" << id << ".inr.gz"; + std::cout << "filename = " << oss1.str().c_str() << std::endl; + internal::convert_itk_to_image_3(smoother->GetOutput(), oss1.str().c_str()); +#endif + //take the max of smoothed indicator functions if (id == 0) blured_max = smoother->GetOutput(); @@ -197,13 +251,21 @@ CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& i } id++; + } + #ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG - std::cout << "AFTER MAX (label = " << label << ") : " << std::endl; - std::cout << "\tnon zero in max (" - << label << ")\t= " << internal::count_non_white_pixels(blured_max.GetPointer()) << std::endl; + std::ostringstream oss2; + oss2 << "max_" << "all" << ".inr.gz"; + std::cout << "filename = " << oss2.str().c_str() << std::endl; + internal::convert_itk_to_image_3(blured_max.GetPointer(), oss2.str().c_str()); +#endif + +#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG +// std::cout << "AFTER MAX (label = " << label << ") : " << std::endl; + std::cout << "\tnon zero in max (" + << id << ")\t= " << internal::count_non_white_pixels(blured_max.GetPointer()) << std::endl; #endif - } //copy pixels to weights std::copy(blured_max->GetBufferPointer(), @@ -236,7 +298,13 @@ CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& i * * @param image the input labeled image from which the weights image is computed. * Both will then be used to construct a `Labeled_mesh_domain_3`. -* @param sigma the standard deviation parameter of the internal Gaussian filter +* @param sigma the standard deviation parameter of the internal Gaussian filter, +* measured in real-world distances. The size of a voxel (e.g. shortest length +* or longest length) usually is a good value for this parameter. +* Note that if `sigma` is too small, the "stair-effect" of meshing from +* a voxel image can appear. On the other side, if `sigma` is too large, +* thin volumes (basically one voxel thick) may be lost in the meshing process +* because the computed weights are too blurry. * * @returns a `CGAL::Image_3` of weights used to build a quality `Labeled_mesh_domain_3`, * with the same dimensions as `image` diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 74bb943f76e..d8a8804edb5 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -33,6 +33,7 @@ struct Get_point { const double vx, vy, vz; const double tx, ty, tz; + const std::size_t xdim, ydim, zdim; Get_point(const CGAL::Image_3* image) : vx(image->vx()) , vy(image->vy()) @@ -40,15 +41,27 @@ struct Get_point , tx(image->tx()) , ty(image->ty()) , tz(image->tz()) + , xdim(image->xdim()) + , ydim(image->ydim()) + , zdim(image->zdim()) {} Point operator()(const std::size_t i, const std::size_t j, const std::size_t k) const { - return Point(double(i) * vx + tx, - double(j) * vy + ty, - double(k) * vz + tz); + double x = double(i) * vx + tx; + double y = double(j) * vy + ty; + double z = double(k) * vz + tz; + + if (i == 0) x += 1. / 6. * vx; + else if (i == xdim - 1) x -= 1. / 6. * vx; + if (j == 0) y += 1. / 6. * vy; + else if (j == ydim - 1) y -= 1. / 6. * vy; + if (k == 0) z += 1. / 6. * vz; + else if (k == zdim - 1) z -= 1. / 6. * vz; + + return Point(x, y, z); } }; template @@ -107,14 +120,20 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, if(protect_features) { init_tr_from_labeled_image_call_init_features (c3t3, domain, criteria, - CGAL::Mesh_3::internal::Has_features()); + CGAL::internal::Has_features()); } const double max_v = (std::max)((std::max)(image.vx(), image.vy()), image.vz()); - typedef std::vector > Seeds; + struct Seed { + std::size_t i, j, k; + std::size_t radius; + }; + using Seeds = std::vector; + using Subdomain = typename Mesh_domain::Subdomain; + Seeds seeds; Get_point get_point(&image); std::cout << "Searching for connected components..." << std::endl; @@ -122,20 +141,34 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, std::back_inserter(seeds), CGAL::Emptyset_iterator(), transform, - get_point, Image_word_type()); std::cout << " " << seeds.size() << " components were found." << std::endl; std::cout << "Construct initial points..." << std::endl; - for(typename Seeds::const_iterator it = seeds.begin(), end = seeds.end(); - it != end; ++it) + for(const Seed seed : seeds) { - const double radius = double(it->second + 1)* max_v; + const Bare_point seed_point = get_point(seed.i, seed.j, seed.k); + Cell_handle seed_cell = tr.locate(cwp(seed_point)); + + const Subdomain seed_label + = domain.is_in_domain_object()(seed_point); + const Subdomain seed_cell_label + = (seed_cell == Cell_handle() || tr.is_infinite(seed_cell)) + ? Subdomain() //seed_point is OUTSIDE_AFFINE_HULL + : domain.is_in_domain_object()( + seed_cell->weighted_circumcenter(tr.geom_traits())); + + if ( seed_label != boost::none + && seed_cell_label != boost::none + && *seed_label == *seed_cell_label) + continue; //this means the connected component has already been initialized + + const double radius = double(seed.radius + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); typename Mesh_domain::Construct_intersection construct_intersection = domain.construct_intersection_object(); std::vector directions; - if(it->second < 2) { + if(seed.radius < 2) { // shoot in six directions directions.push_back(Vector_3(-radius, 0, 0)); directions.push_back(Vector_3(+radius, 0, 0)); @@ -153,9 +186,10 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, for(const Vector_3& v : directions) { - const Bare_point test = it->first + v; + const Bare_point test = seed_point + v; + const typename Mesh_domain::Intersection intersect = - construct_intersection(Segment_3(it->first, test)); + construct_intersection(Segment_3(seed_point, test)); if (std::get<2>(intersect) != 0) { const Bare_point& bpi = std::get<0>(intersect); diff --git a/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h b/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h index 4d228953ad5..b1c6080f30c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h +++ b/Mesh_3/include/CGAL/Mesh_3/internal/check_weights.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -33,7 +33,7 @@ template bool has_non_protecting_weights(const Triangulation& tr, const MeshDomain&) { - const bool with_features = Has_features::value; + const bool with_features = ::CGAL::internal::Has_features::value; typedef typename Triangulation::FT FT; typedef typename Triangulation::Weighted_point Weighted_point; diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters.h b/Mesh_3/include/CGAL/Mesh_3/parameters.h new file mode 100644 index 00000000000..b38d501b29f --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/parameters.h @@ -0,0 +1,34 @@ +// Copyright (c) 2009 INRIA Sophia-Antipolis (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 +// + +#ifndef CGAL_MESH_3_PARAMETERS_H +#define CGAL_MESH_3_PARAMETERS_H + +#include +#include +#include +#include +#include + +namespace CGAL { +namespace parameters { + +#define CGAL_NP_BASE internal_np::No_property +#define CGAL_NP_BUILD(P, V) P(V) + +#include + +#undef CGAL_NP_BASE +#undef CGAL_NP_BUILD + +} } // end of CGAL::parameters namespace + + +#endif //CGAL_MESH_3_PARAMETERS_H diff --git a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h index e9f06c9c590..12ec9eca38d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h +++ b/Mesh_3/include/CGAL/Mesh_3/parameters_defaults.h @@ -23,14 +23,14 @@ #include +// see also default_values_for_mesh_3 namespace +// in CGAL/STL_Extension/internal/mesh_option_classes.h + namespace CGAL { namespace parameters { namespace default_values_for_mesh_3 { -// exude_mesh_3 -const double exude_sliver_bound = 0.; // perturb_mesh_3 -const double perturb_sliver_bound = 0.; template CGAL::Mesh_3::Min_dihedral_angle_criterion @@ -40,17 +40,6 @@ CGAL::Mesh_3::Min_dihedral_angle_criterion return CGAL::Mesh_3::Min_dihedral_angle_criterion(bound, c3t3.triangulation()); } -// global optimizers -const bool do_freeze = true; - -// lloyd_optimize_mesh_3 -const double lloyd_freeze_ratio = 0.01; -const double lloyd_convergence_ratio = 0.02; - -// odt_optimize_mesh_3 -const double odt_freeze_ratio = 0.01; -const double odt_convergence_ratio = 0.02; - } } // end namespace parameters::default_values_for_mesh_3 } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 56c5d7bc6d5..343b16ebdc2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -34,14 +34,12 @@ template void search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, PointsOutputIterator it, DomainsOutputIterator dom_it, TransformOperator transform, - Construct_point point, Image_word_type) { const std::size_t nx = image.xdim(); @@ -97,9 +95,9 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, % (long)static_evaluate(image.image(), i, j, k) % number_of_connected_components % (int)current_label; -#endif // CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE int nb_voxels = 0; +#endif // CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE Indices_queue queue; Indices indices(i, j ,k, 0); @@ -137,7 +135,9 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { visited[offset] = true; second_pass[offset] = false; +#ifdef CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE ++nb_voxels; +#endif boost::get<0>(bbox_min) = (std::min)(i, boost::get<0>(bbox_min)); boost::get<0>(bbox_max) = (std::max)(i, boost::get<0>(bbox_max)); boost::get<1>(bbox_min) = (std::min)(j, boost::get<1>(bbox_min)); @@ -210,8 +210,7 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, { // if(nb_voxels >= 100) { - *it++ = std::make_pair(point(i, j, k), - depth+1); + *it++ = { i, j, k, std::size_t(depth + 1) }; #if CGAL_MESH_3_SEARCH_FOR_CONNECTED_COMPONENTS_IN_LABELED_IMAGE_VERBOSE > 1 std::cerr << boost::format("Found seed %5%, which is voxel " "(%1%, %2%, %3%), value=%4%\n") diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 1b5e004548a..93b4119a1b1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -49,7 +49,7 @@ namespace Mesh_3 { namespace details { /** - * @brief Returns the angle in radian of vectors \c u and \c v + * @brief Returns the angle in radian of vectors `u` and `v` */ template typename K::FT @@ -98,7 +98,7 @@ angle_in_radian(const typename K::Vector_3& u, } /** - * @brief Returns the angle in radian of vectors \c u and \c v + * @brief Returns the angle in radian of vectors `u` and `v` */ template typename Kernel_traits::Kernel::FT @@ -108,7 +108,7 @@ angle_in_radian(const Vector_3& u, const Vector_3& v) } /** - * @brief Returns the squared length of edge \c e + * @brief Returns the squared length of edge `e`. */ template typename Tr::Geom_traits::FT @@ -133,8 +133,8 @@ edge_sq_length(const typename Tr::Edge& e, } /** - * @brief Returns the minimal incident edge length of \c v - * in triangulation \c tr + * @brief Returns the minimal incident edge length of `v` + * in triangulation `tr`. */ template typename Tr::Geom_traits::FT @@ -210,7 +210,7 @@ public: /** * @brief This operator try to move vertex \v using the perturbation. * @param v the vertex to move - * @param slivers a vector which contains incident slivers of \c v + * @param slivers a vector which contains incident slivers of `v` * @param c3t3 the c3t3 * @param domain the domain * @param criterion the criterion which is used to evaluate if a cell is @@ -219,12 +219,12 @@ public: * @param modified_vertices an output vector which contains vertices of c3t3 * which may have been impacted by v relocation. * @return a pair containing: - * - a bool which is \c true if a move has been done. + * - a bool which is `true` if a move has been done. * - a Vertex_handle which is always filled and may be the new vertex (if - * the move is a success), or the vertex which lies at \c v's position in + * the move is a success), or the vertex which lies at `v`'s position in * the new c3t3. * - * Note that this function is hill_climbing only. The min \c criterion value + * Note that this function is hill_climbing only. The min `criterion` value * of c3t3 could not decrease. */ std::pair @@ -432,7 +432,7 @@ protected: /** * Tries to apply a gradient perturbation using direction of - * \c gradient_vector + * `gradient_vector` */ std::pair apply_perturbation(const Vertex_handle& v, @@ -1054,7 +1054,7 @@ private: } /** - * @brief returns the cotangent of \c value + * @brief returns the cotangent of `value`. */ FT cotangent(const FT& value) const { @@ -1062,8 +1062,8 @@ private: } /** - * @brief returns the normal of facet (ch,i), oriented from inside to outside - * of \c ch + * @brief returns the normal of facet `(ch,i)`, oriented from inside to outside + * of `ch`. */ Vector_3 normal_estimate(const C3T3& c3t3, const Cell_handle& ch, const int i) const { @@ -1157,7 +1157,7 @@ protected: FT sphere_sq_radius() const { return sphere_sq_radius_; } /** - * @brief returns a FT between \c min and \c max + * @brief returns a FT between `min` and `max`. */ FT random_ft(const FT& min = FT(0.), const FT& max = FT(1.)) const { @@ -1166,7 +1166,7 @@ protected: } /** - * @brief returns a random vector with size \c vector_size + * @brief returns a random vector with size `vector_size`. */ Vector_3 random_vector_fixed_size(const C3T3& c3t3, const FT& vector_sq_size) const @@ -1184,7 +1184,7 @@ protected: } /** - * @brief returns a random vector with size between 0 and \c vector_size + * @brief returns a random vector with size between 0 and `vector_size`. */ Vector_3 random_vector_max_size(const C3T3& c3t3, const FT& vector_max_sq_size) const @@ -1299,7 +1299,7 @@ private: // ----------------------------------- /** - * @brief try to improve mesh using random moves of \c v + * @brief tries to improve mesh using random moves of `v`. */ std::pair apply_perturbation(const Vertex_handle& v, @@ -1410,7 +1410,7 @@ private: } private: - // If set to \c true, then random point will be generated on sphere surface. + // If set to `true`, then random points will be generated on sphere surface. bool on_sphere_; }; diff --git a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h index 53e0c20ea4f..06193693760 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_criteria_3.h @@ -82,8 +82,8 @@ public: ~Mesh_cell_criteria_3() { } /** - * @brief returns whether the cell \c cell is bad or not. - * @param tr the triangulation within which \c cell lives + * @brief returns whether the cell `cell` is bad or not. + * @param tr the triangulation within which `cell` lives * @param cell the cell */ Is_cell_bad operator()(const Tr& tr, const Cell_handle& cell) const diff --git a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h index ded5f26da80..002117b14ae 100644 --- a/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h +++ b/Mesh_3/include/CGAL/Mesh_constant_domain_field_3.h @@ -57,7 +57,7 @@ public: return d_; } - /// Sets size at any point of dimension \c dim and index \c index + /// Sets size at any point of dimension `dim` and index `index`. void set_size(const FT& size, const int dim, const Index& index) { values_.insert(std::make_pair(std::make_pair(dim,index),size)); diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 5c88815ec9d..c7dcfeb33ab 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -22,10 +22,8 @@ #include #include - +#include #include -#include -#include #include #include #include @@ -33,29 +31,6 @@ #include namespace CGAL { -namespace parameters { - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - BOOST_PARAMETER_NAME( (edge_size, tag) edge_size_ ) - BOOST_PARAMETER_NAME( (edge_sizing_field, tag) edge_sizing_field_ ) - BOOST_PARAMETER_NAME( (facet_angle, tag) facet_angle_ ) - BOOST_PARAMETER_NAME( (facet_size, tag) facet_size_ ) - BOOST_PARAMETER_NAME( (facet_sizing_field, tag) facet_sizing_field_ ) - BOOST_PARAMETER_NAME( (facet_distance, tag) facet_distance_ ) - BOOST_PARAMETER_NAME( (facet_topology, tag) facet_topology_ ) - BOOST_PARAMETER_NAME( (cell_radius_edge, tag) cell_radius_edge_ ) - BOOST_PARAMETER_NAME( (cell_radius_edge_ratio, tag) cell_radius_edge_ratio_ ) - BOOST_PARAMETER_NAME( (cell_size, tag) cell_size_ ) - BOOST_PARAMETER_NAME( (cell_sizing_field, tag) cell_sizing_field_ ) - BOOST_PARAMETER_NAME( (sizing_field, tag) sizing_field_ ) - -CGAL_PRAGMA_DIAG_POP - -} // end namespace parameters namespace internal { @@ -93,22 +68,22 @@ public: // This template constructor is not instantiated when named parameters // are not used, so Facet_criteria and Cell_criteria construction from FT // is not a problem - template - Mesh_criteria_3_impl(const ArgumentPack& args) - : edge_criteria_(args[parameters::edge_size - | args[parameters::edge_sizing_field - | args[parameters::sizing_field | FT(DBL_MAX)] ] ]) - , facet_criteria_(args[parameters::facet_angle | FT(0)], - args[parameters::facet_size - | args[parameters::facet_sizing_field - | args[parameters::sizing_field | FT(0)] ] ], - args[parameters::facet_distance | FT(0)], - args[parameters::facet_topology | CGAL::FACET_VERTICES_ON_SURFACE]) - , cell_criteria_(args[parameters::cell_radius_edge_ratio - | args[parameters::cell_radius_edge | FT(0)] ], - args[parameters::cell_size - | args[parameters::cell_sizing_field - | args[parameters::sizing_field | FT(0)] ] ]) + template + Mesh_criteria_3_impl(const CGAL_NP_CLASS& np) + :edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX))))), + facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_distance_param), FT(0)), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_topology_param), CGAL::FACET_VERTICES_ON_SURFACE)), + cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_param), FT(0))), + parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_size_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::cell_sizing_field_param), + parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::sizing_field_param), FT(0))))) { } #ifndef CGAL_NO_DEPRECATED_CODE @@ -150,17 +125,67 @@ private: -// Class Mesh_criteria_3 -// Provides default mesh criteria to drive Mesh_3 process + +/*! +\ingroup PkgMesh3MeshClasses + +The class gathers the refinement criteria for mesh tetrahedra and +surface facets where +surface facets are facets in the mesh approximating the domain surface patches. +In addition, for domains with exposed 1-dimensional features, +the class `Mesh_criteria_3` +handles the definition of a sizing field to guide the discretization of +1-dimensional features. + +\tparam Tr has to be instantiated with the type used for +`C3T3::Triangulation`, +where `C3T3` is the model of `MeshComplex_3InTriangulation_3` +used in the mesh generation process, +and `C3T3::Triangulation` its nested triangulation type. + +\cgalModels `MeshCriteria_3` and `MeshCriteriaWithFeatures_3` + +\cgalHeading{Example} + +\code{.cpp} + +// Create a Mesh_criteria_3 object with all cell and facet parameters set +Mesh_criteria_3 criteria (parameters::facet_angle(30). + parameters::facet_size(1). + parameters::facet_distance(0.1). + parameters::cell_radius_edge_ratio(2). + parameters::cell_size(1.5)); + +// Create a Mesh_criteria_3 object with size ignored (note that the order changed) +Mesh_criteria_3 criteria (parameters::cell_radius_edge_ratio(2). + parameters::facet_angle(30). + parameters::facet_distance(0.1)); + +\endcode + +\sa `MeshCriteria_3` +\sa `MeshCriteriaWithFeatures_3` +\sa `MeshCellCriteria_3` +\sa `MeshEdgeCriteria_3` +\sa `MeshFacetCriteria_3` +\sa `MeshDomainField_3` +\sa `CGAL::Mesh_cell_criteria_3` +\sa `CGAL::Mesh_edge_criteria_3` +\sa `CGAL::Mesh_facet_criteria_3` +\sa `CGAL::Mesh_facet_topology` + +*/ template , typename FacetCriteria = Mesh_facet_criteria_3, typename CellCriteria = Mesh_cell_criteria_3 > class Mesh_criteria_3 +#ifndef DOXYGEN_RUNNING : public internal::Mesh_criteria_3_impl< Tr, EdgeCriteria, FacetCriteria, CellCriteria > +#endif { typedef internal::Mesh_criteria_3_impl< Tr, EdgeCriteria, @@ -168,38 +193,109 @@ class Mesh_criteria_3 CellCriteria> Base; public: +#ifdef DOXYGEN_RUNNING +/// \name Types +/// @{ + +/*! +The criteria for edges. +*/ +typedef Mesh_edge_criteria_3 Edge_criteria; + +/*! +The criteria for facets. +*/ +typedef Mesh_facet_criteria_3 Facet_criteria; + +/*! +The +criteria for cells. +*/ +typedef Mesh_cell_criteria_3 Cell_criteria; + +/// @} +#else typedef typename Base::Edge_criteria Edge_criteria; typedef typename Base::Facet_criteria Facet_criteria; typedef typename Base::Cell_criteria Cell_criteria; +#endif - // Constructor + /// Construction from facet and cell criteria, the edge criteria are ignored in this case. Mesh_criteria_3(Facet_criteria facet_criteria, Cell_criteria cell_criteria) : Base(facet_criteria, cell_criteria) {} - // Constructor + /// Constructor from edge, face, and cell criteria. Mesh_criteria_3(Edge_criteria edge_criteria, Facet_criteria facet_criteria, Cell_criteria cell_criteria) : Base(edge_criteria, facet_criteria, cell_criteria) {} +/*! + * \brief Construction from criteria parameters. + * + * Note that each size or distance parameter can be specified using two ways: either as a scalar field or + * as a numerical value when the field is uniform. + * + * If not specified, each parameter has a default value such that the corresponding criterion will be ignored. + * Numerical sizing or distance values, as well as scalar fields should be given in the unit used for coordinates + * of points in the mesh domain class of the mesh generation process. + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{edge_size} + * \cgalParamDescription{a scalar field (resp. a constant) providing a space varying + * (resp. a uniform) + * upper bound for the lengths of curve edges. This parameter has to be set to a positive + * value when 1-dimensional features protection is used.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_angle} + * \cgalParamDescription{a lower bound for the angles (in degrees) of the + * surface mesh facets.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_size} + * \cgalParamDescription{a scalar field (resp. a constant) describing + * a space varying (resp. a uniform) upper-bound or for the radii of the surface Delaunay balls.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_distance} + * \cgalParamDescription{a scalar field (resp. a constant) describing a space varying (resp. a uniform) + * upper bound for the distance between the facet circumcenter and the center of its surface + * Delaunay ball.} + * \cgalParamNEnd + * \cgalParamNBegin{facet_topology} + * \cgalParamDescription{the set of topological constraints + * which have to be verified by each surface facet. See `Mesh_facet_topology` manual page to + * get all possible values.} + * \cgalParamDefault{CGAL::FACET_VERTICES_ON_SURFACE} + * \cgalParamNEnd + * \cgalParamNBegin{cell_radius_edge_ratio} + * \cgalParamDescription{ an upper bound for the radius-edge ratio of the mesh tetrahedra.} + * \cgalParamNEnd + * \cgalParamNBegin{cell_size} + * \cgalParamDescription{ a scalar field (resp. a constant) describing + * a space varying (resp. a uniform) upper-bound for the circumradii of the mesh tetrahedra.} + * \cgalParamNEnd + * \cgalNamedParamsEnd + */ +template +Mesh_criteria_3(const CGAL_NP_CLASS& np = parameters::default_values()): Base(np) +{ +} - // For convenient constructor call (see examples) - BOOST_PARAMETER_CONSTRUCTOR(Mesh_criteria_3, (Base), parameters::tag, - (optional (edge_size_,*) - (edge_sizing_field_,*) - (facet_angle_,*) - (facet_size_,*) - (facet_sizing_field_,*) - (facet_distance_,*) - (facet_topology_,*) - (cell_radius_edge_,*) - (cell_size_,*) - (cell_sizing_field_,*) - (sizing_field_,*) - )) +// Overload handling parameters passed with operator= +template +Mesh_criteria_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) + : Mesh_criteria_3(internal_np::combine_named_parameters(np1, np2, nps...)) +{ +} }; // end class Mesh_criteria_3 diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index 6eea4ed9ebb..cb683ae7850 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -227,7 +227,7 @@ public: return result; } - /// Returns signed geodesic distance between \c p and \c q + /// Returns signed geodesic distance between `p` and `q`. FT signed_geodesic_distance(const Point_3& p, const Point_3& q) const { // Locate p & q on polyline @@ -259,7 +259,7 @@ public: } - /// Returns a point at geodesic distance \c distance from p along the + /// Returns a point at geodesic distance `distance` from p along the /// polyline. The polyline is oriented from starting point to end point. /// The distance could be negative. Point_3 point_at(const Point_3& p, FT distance) const @@ -372,16 +372,23 @@ private: if(nearest_is_a_segment) { - if(compare_distance(p, seg, nearest_segment) == CGAL::SMALLER) - { - nearest_segment = seg; - result = previous; - } if(compare_distance(p, *it, nearest_segment) == CGAL::SMALLER) { nearest_vertex = it; nearest_is_a_segment = false; result = it; + if (possibly(angle(*previous, *it, p) == CGAL::ACUTE) && + compare_distance(p, seg, *nearest_vertex) == CGAL::SMALLER) + { + nearest_segment = seg; + nearest_is_a_segment = true; + result = previous; + } + } + else if(compare_distance(p, seg, nearest_segment) == CGAL::SMALLER) + { + nearest_segment = seg; + result = previous; } } else { @@ -390,7 +397,9 @@ private: nearest_vertex = it; result = it; } - if(compare_distance(p, seg, *nearest_vertex) == CGAL::SMALLER) + if ((nearest_vertex != it || + possibly(angle(*previous, *it, p) == CGAL::ACUTE)) && + compare_distance(p, seg, *nearest_vertex) == CGAL::SMALLER) { nearest_segment = seg; nearest_is_a_segment = true; @@ -586,7 +595,7 @@ public: /// Add a 0-dimensional feature in the domain. Corner_index add_corner(const Point_3& p); - /// Overloads where the last parameter \c out is not `CGAL::Emptyset_iterator()`. + /// Overload where the last parameter `out` is not `CGAL::Emptyset_iterator()`. template IndicesOutputIterator add_corners(InputIterator first, InputIterator end, @@ -604,7 +613,7 @@ public: Corner_index register_corner(const Point_3& p, const Curve_index& index); Corner_index add_corner_with_context(const Point_3& p, const Surface_patch_index& index); - /// Overloads where the last parameter \c out is not + /// Overload where the last parameter `out` is not /// `CGAL::Emptyset_iterator()`. template IndicesOutputIterator @@ -734,14 +743,14 @@ public: /** * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } /** * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } @@ -755,15 +764,15 @@ public: { return Index(index); } /** - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } /** * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } diff --git a/Mesh_3/include/CGAL/Mesh_error_code.h b/Mesh_3/include/CGAL/Mesh_error_code.h index 2bbf47a451a..6c8f417e68a 100644 --- a/Mesh_3/include/CGAL/Mesh_error_code.h +++ b/Mesh_3/include/CGAL/Mesh_error_code.h @@ -14,17 +14,13 @@ #include +#include + #include #include namespace CGAL { -enum Mesh_error_code { - CGAL_MESH_3_NO_ERROR = 0, - CGAL_MESH_3_MAXIMAL_NUMBER_OF_VERTICES_REACHED, - CGAL_MESH_3_STOPPED -}; - inline std::string mesh_error_string(const Mesh_error_code& error_code) { switch(error_code) { diff --git a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h index 4e41d82ef1c..86972063b11 100644 --- a/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_facet_criteria_3.h @@ -74,8 +74,8 @@ public: ~Mesh_facet_criteria_3() { } /** - * @brief returns whether the facet \c facet is bad or not. - * @param tr the triangulation within which \c facet lives + * @brief returns whether the facet `facet` is bad or not. + * @param tr the triangulation within which `facet` lives * @param facet the facet */ Is_facet_bad operator()(const Tr& tr, const Facet& facet) const diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 818128229e1..4b69af4550d 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -516,28 +516,28 @@ public: /** * Returns the index to be stored in a vertex lying on the surface identified - * by \c index. + * by `index`. */ Index index_from_surface_patch_index(const Surface_patch_index& index) const { return Index(index); } /** * Returns the index to be stored in a vertex lying in the subdomain - * identified by \c index. + * identified by `index`. */ Index index_from_subdomain_index(const Subdomain_index& index) const { return Index(index); } /** - * Returns the \c Surface_patch_index of the surface patch - * where lies a vertex with dimension 2 and index \c index. + * Returns the `Surface_patch_index` of the surface patch + * where lies a vertex with dimension 2 and index `index`. */ Surface_patch_index surface_patch_index(const Index& index) const { return boost::get(index); } /** * Returns the index of the subdomain containing a vertex - * with dimension 3 and index \c index. + * with dimension 3 and index `index`. */ Subdomain_index subdomain_index(const Index& index) const { return boost::get(index); } diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index 3d9cb841b7c..e5480aa1dee 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -19,48 +19,108 @@ #include -#include - #include #include #include #include -#include - -#include +#include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - exude_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) ) - (optional - (time_limit_, *, 0 ) - (sliver_bound_, *, parameters::default_values_for_mesh_3::exude_sliver_bound ) - ) -) +/*! + * @ingroup PkgMesh3Functions + * + * The function `exude_mesh_3()` performs a sliver exudation process on a Delaunay mesh. + * + * The sliver exudation process consists in optimizing the weights of vertices + * of the weighted Delaunay triangulation in such a way that slivers disappear and + * the quality of the mesh improves. + * + * @warning This optimizer modifies the weight of vertices of the triangulation and, + * if called, must be the last optimizer to be called. If the mesh is refined after + * this optimization has been performed, all improvements will be lost. + * + * @tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3`. + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than `sliver_bound` and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0<= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
      + *
    • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. + *
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
    • `CGAL::CANT_IMPROVE_ANYMORE` when exudation process stops because it can no longer improve + * the smallest dihedral angle of the set of cells incident to some vertex in the mesh. + *
    + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Exude without sliver_bound, using at most 10s CPU time + * exude_mesh_3(c3t3, + * parameters::time_limit(10)); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + */ +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { - return exude_mesh_3_impl(c3t3, time_limit_, sliver_bound_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); + double sliver_bound= choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),parameters::default_values_for_mesh_3::exude_sliver_bound); + return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) +#ifndef CGAL_NO_DEPRECATED_CODE +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, double time_limit = 0, double sliver_bound = 0) +{ + return exude_mesh_3(c3t3, CGAL::parameters::time_limit(time_limit).sliver_bound(sliver_bound)); +} #endif - - +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_mesh_3(C3T3& c3t3, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return exude_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); +} template Mesh_optimization_return_code @@ -83,10 +143,8 @@ exude_mesh_3_impl(C3T3& c3t3, // Launch exudation return exuder(); } - +#endif //DOXYGEN_RUNNING } //namespace CGAL -#include - #endif // CGAL_EXUDE_MESH_3_H diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 8b3ec746e76..54c239802e8 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -19,9 +19,7 @@ #include -#include - -#include +#include #include #include #include @@ -29,44 +27,136 @@ #include #include -#include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, parameters::default_values_for_mesh_3::lloyd_convergence_ratio ) - (freeze_bound_, *, parameters::default_values_for_mesh_3::lloyd_freeze_ratio ) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze )) -) +/*! + * \ingroup PkgMesh3Functions + * + * The function `lloyd_optimize_mesh_3()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `lloyd_optimize_mesh_3()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear + * in each cell of the Voronoi diagram of the mesh vertices. + * + * The optimizer `lloyd_optimize_mesh_3()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are handled + * in a special way so as to preserve an accurate + * representation of the domain boundaries. + * + * \tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3`. + * \tparam MD a model of the concept `MeshDomain_3`. + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh that will be modified by the algorithm to represent the final optimized mesh. + * @param domain the domain used to create the `c3t3` parameter + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{to set up, in seconds, a CPU time limit after which the optimization process is stopped. + * This time is measured using `CGAL::Real_timer`. 0 means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{limit on the number of performed iterations. 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamPrecondition{`max_iteration_number >=0`} + * \cgalParamType{`int`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{designed to reduce running time of each optimization iteration. + * Any vertex that has a displacement less than a given fraction of the length + * of its shortest incident edge, is frozen (i.e.\ is not relocated). + * The parameter `freeze_bound` gives the threshold ratio. + * If it is set to 0, freezing of vertices is disabled.} + * \cgalParamPrecondition{`0<= freeze_bound <=1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{threshold ratio of stopping criterion based on convergence: the optimization process is stopped + * when at the last iteration the displacement of any vertex is less than + * a given fraction of the length of the shortest edge incident to that vertex.} + * \cgalParamPrecondition{`0 <=convergence <= 1`} + * \cgalParamType{`double`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true` (default value), + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
      + *
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
    • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `lloyd_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. + *
    • `CGAL::CONVERGENCE_REACHED` when `lloyd_optimize_mesh_3()` stops because the convergence criterion + * is achieved. + *
    • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the + * `do_freeze` parameter is set to true. + *
    • `CGAL::CANT_IMPROVE_ANYMORE` when `lloyd_optimize_mesh_3()` stops because + * most vertices have been frozen, and no better convergence can be reached. + *
    + * + * \cgalHeading{Example} + * + * + * \code{.cpp} + * // Lloyd-smoothing until convergence reaches 0.01, freezing vertices which + * // move less than 0.001*shortest_incident_edge_length + * lloyd_optimize_mesh_3(c3t3, + * domain, + * parameters::convergence(0.01). + * parameters::freeze_bound(0.001). + * parameters::do_freeze(true)); + * + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + * \note This function requires the \ref thirdpartyEigen library. + */ +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { - return lloyd_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_ - , do_freeze_); + using parameters::choose_parameter; + using parameters::get_parameter; + std::size_t max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), parameters::default_values_for_mesh_3::lloyd_convergence_ratio); + const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), parameters::default_values_for_mesh_3::lloyd_freeze_ratio); + const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), parameters::default_values_for_mesh_3::time_limit); + bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code lloyd_optimize_mesh_3(C3T3& c3t3,MeshDomain& domain, const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return lloyd_optimize_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} template Mesh_optimization_return_code @@ -106,10 +196,8 @@ lloyd_optimize_mesh_3_impl(C3T3& c3t3, // Launch optimization return opt(static_cast(max_iteration_number)); } - +#endif //DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_LLOYD_OPTIMIZE_MESH_3_H diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 39acb952459..64105159344 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -19,113 +19,19 @@ #include -#include - #include -#include #include #include #include -#include +#include #include #include -#include #include namespace CGAL { -namespace parameters { - namespace internal { - // Features - struct Features_options - { - Features_options(bool b) : b_(b) {} - bool features() const { return b_; } - private: - bool b_; - }; - - // ----------------------------------- - // Features generator - // ----------------------------------- - // struct Features_option_generator - template - struct Features_options_generator {}; - - template<> - struct Features_options_generator - { - Features_options operator()() { return Features_options(true); } - }; - - template<> - struct Features_options_generator - { - Features_options operator()() { return Features_options(false); } - }; - - // struct Domain_features_generator is designed to handle cases where - // MeshDomain::Has_features is not a valid type - template< typename MeshDomain, bool MeshDomainHasHasFeatures > - struct Domain_features_generator {}; - - template< typename MeshDomain > - struct Domain_features_generator< MeshDomain, false > - { - Features_options operator()() - { - return Features_options_generator()(); - } - }; - - template< typename MeshDomain > - struct Domain_features_generator< MeshDomain, true > - { - Features_options operator()() - { - return Features_options_generator()(); - } - }; - - } // end namespace internal - - // ----------------------------------- - // Features_options - // ----------------------------------- - inline internal::Features_options - features() { return internal::Features_options(true); } - - inline internal::Features_options - no_features() { return internal::Features_options(false); } - - template < typename MeshDomain > - inline internal::Features_options - features(const MeshDomain& /*domain*/) - { - typedef typename internal::Domain_features_generator< - MeshDomain, - CGAL::Mesh_3::internal::has_Has_features::value > Generator; - - return Generator()(); - } - - // ----------------------------------- - // Parameters - // ----------------------------------- - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - BOOST_PARAMETER_NAME( features_param ) - -CGAL_PRAGMA_DIAG_POP - -} // end namespace parameters::internal - // ----------------------------------- // Initialize c3t3 stuff // ----------------------------------- @@ -369,65 +275,189 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false > // make_mesh_3 stuff // ----------------------------------- -// Manual redirections -// boost::parameter can't handle make_mesh_3 return_type alone... -template -C3T3 make_mesh_3(const MD& md, const MC& mc, const T& ...t) +/*! + * \ingroup PkgMesh3Functions + * + * The function `make_mesh_3()` is a 3D + * mesh generator. It produces simplicial meshes which discretize + * 3D domains. + * + * The mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd-smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process + * can be activated or not, + * according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, + * and sliver perturber should never be called after the sliver exuder. + * In the case of further refinement, only the sliver exuder can be used. + * + * The function outputs the mesh to an object which provides iterators to + * traverse the resulting mesh data structure or can be written to a file + * (see \ref Mesh_3_section_examples ). + * + * \tparam C3T3 either a model of the concept `MeshComplex_3InTriangulation_3` or + * of `MeshComplexWithFeatures_3InTriangulation_3` if `MD` + * is a model of `MeshDomainWithFeatures_3`. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively. + * + * \tparam MD either a model of the concept `MeshDomain_3` or of + * `MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * + * \tparam MC either a model of the concept `MeshCriteria_3` or a model + * of `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * \param domain the domain used to create the `c3t3` parameter. It is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * \param criteria specifies the size and shape requirements for mesh tetrahedra + * and surface facets. These criteria form the rules which drive + * the refinement process. All mesh elements satisfy those criteria + * at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Feature preservation options} + * \cgalParamDescription{If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be + * taken into account while generating the mesh. The following two named parameters control + * this option: + *
      + *
    • \link parameters::features() `parameters::features(domain)` \endlink + *
    • `parameters::no_features()` + *
    } + * \cgalParamDefault{`parameters::features(domain)`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_exude()` + *
    • `parameters::exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * Note that regardless of which optimization processes are activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `refine_mesh_3()` + * \sa `exude_mesh_3()` + * \sa `perturb_mesh_3()` + * \sa `lloyd_optimize_mesh_3()` + * \sa `odt_optimize_mesh_3()` + */ +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - C3T3 c3t3; - make_mesh_3_bp(c3t3,md,mc,t...); - return c3t3; + using parameters::choose_parameter; + using parameters::get_parameter; + C3T3 c3t3; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd().v); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + make_mesh_3_impl(c3t3, domain, criteria, + exude_param, perturb_param, odt_param, lloyd_param, + features_param.features(), mesh_options_param, + manifold_options_param); + return c3t3; } -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - make_mesh_3_bp, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (features_param, (parameters::internal::Features_options), parameters::features(domain)) - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { - make_mesh_3_impl(c3t3, domain, criteria, - exude_param, perturb_param, odt_param, lloyd_param, - features_param.features(), mesh_options_param, - manifold_options_param); + return make_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - /** * @brief This function meshes the domain defined by mesh_traits * (respecting criteria), and outputs the mesh to c3t3 * * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if it is set to \c true, an exudation step will be done at + * @param exude if it is set to `true`, an exudation step will be done at * the end of the Delaunay refinement process * * @return The mesh as a C3T3 object @@ -455,7 +485,7 @@ void make_mesh_3_impl(C3T3& c3t3, C3T3, MeshDomain, MeshCriteria, - Mesh_3::internal::has_Has_features::value > () (c3t3, + ::CGAL::internal::has_Has_features::value > () (c3t3, domain, criteria, with_features, @@ -466,12 +496,12 @@ void make_mesh_3_impl(C3T3& c3t3, // Build mesher and launch refinement process // Don't reset c3t3 as we just created it refine_mesh_3(c3t3, domain, criteria, - exude, perturb, odt, lloyd, parameters::no_reset_c3t3(), mesh_options, - manifold_options); + parameters::exude_options=exude, parameters::perturb_options=perturb, parameters::odt_options=odt, parameters::lloyd_options= lloyd, + parameters::no_reset_c3t3(), parameters::mesh_options= mesh_options, + parameters::manifold_option= manifold_options); } +#endif //DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_MAKE_MESH_3_H diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index a08d1154717..5c1d39e36f0 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -19,9 +19,7 @@ #include -#include - -#include +#include #include #include #include @@ -29,43 +27,134 @@ #include #include -#include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - odt_optimize_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, parameters::default_values_for_mesh_3::odt_convergence_ratio ) - (freeze_bound_, *, parameters::default_values_for_mesh_3::odt_freeze_ratio ) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze )) -) +/*! + * @ingroup PkgMesh3Functions + * + * The function `odt_optimize_mesh_3()` is a mesh optimization process + * based on the minimization of a global energy function. + * + * In `odt_optimize_mesh_3()`, the minimized global energy may be interpreted + * as the \f$ L^1\f$-norm of the error achieved + * when the function \f$ x^2\f$ is interpolated on the mesh domain + * using a piecewise linear function which is linear in each mesh cell. + * + * The optimizer `odt_optimize_mesh_3()` works in iterative steps. + * At each iteration, mesh vertices are moved into + * positions that bring to zero the energy gradient + * and the Delaunay triangulation is updated. + * Vertices on the mesh boundaries are handled + * in a special way so as to preserve an accurate + * representation of the domain boundaries. + * + * @tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` + * @tparam MeshDomain a model of the concept `MeshDomain_3` + * @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh. + * @param domain the domain used to create the `c3t3` parameter + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, + * a CPU time limit after which the optimization process is stopped. This time is + * measured using `Real_timer`. + * The default value is 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{max_iteration_number} + * \cgalParamDescription{sets a limit on the number of performed iterations. + * The default value of 0 means that there is + * no limit on the number of performed iterations.} + * \cgalParamType{`std::size_t`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{convergence} + * \cgalParamDescription{is a stopping criterion based on convergence: + * the optimization process is stopped, when at the last iteration, + * the displacement of any vertex is less than a given percentage of the length + * the shortest edge incident to that vertex. + * The parameter `convergence` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= convergence <= 1`} + * \cgalParamDefault{0.02} + * \cgalParamNEnd + * \cgalParamNBegin{freeze_bound} + * \cgalParamDescription{is designed to reduce running time of each optimization iteration. Any vertex + * that has a displacement less than a given percentage of the length of its shortest incident edge, is frozen (i.e.\ is + * not relocated). The parameter `freeze_bound` gives the threshold ratio.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= freeze_bound <= 1`} + * \cgalParamDefault{0.01} + * \cgalParamNEnd + * \cgalParamNBegin{do_freeze} + * \cgalParamDescription{completes the `freeze_bound` parameter. If it is set to `true`, + * frozen vertices will not move anymore in next iterations. Otherwise, at each iteration, any vertex that + * moves, unfreezes all its incident vertices.} + * \cgalParamType{`bool`} + * \cgalParamDefault{true} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
      + *
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
    • `CGAL::MAX_ITERATION_NUMBER_REACHED` when `odt_optimize_mesh_3()` stops because it has performed `max_iteration_number` iterations. + *
    • `CGAL::CONVERGENCE_REACHED` when `odt_optimize_mesh_3()` stops because the convergence criterion + * is achieved. + *
    • `CGAL::ALL_VERTICES_FROZEN` when all vertices have been frozen, when the + * `do_freeze` parameter is set to true. + *
    • `CGAL::CANT_IMPROVE_ANYMORE` when `odt_optimize_mesh_3()` stops because + * most vertices have been frozen, and no better convergence can be reached. + *
    + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // 100 iterations of ODT-smoothing + * odt_optimize_mesh_3(c3t3, + * domain, + * parameters::max_iteration_number = 100, + * parameters::convergence = 0); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + */ +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - return odt_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_ - , do_freeze_ ); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),parameters::default_values_for_mesh_3::odt_convergence_ratio); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),parameters::default_values_for_mesh_3::odt_freeze_ratio); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return odt_optimize_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} template Mesh_optimization_return_code @@ -106,8 +195,8 @@ odt_optimize_mesh_3_impl(C3T3& c3t3, return opt(static_cast(max_iteration_number)); } +#endif //DOXYGEN_RUNNING + } // end namespace CGAL -#include - #endif // CGAL_ODT_OPTIMIZE_MESH_3_H diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 669fad1dfb0..e5be05310df 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -21,54 +21,112 @@ #include -#include #include #include #include #include #include #include - -#include +#include #include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - perturb_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) ) - (optional - (time_limit_, *, 0 ) - (sliver_bound_, *, parameters::default_values_for_mesh_3::perturb_sliver_bound ) - (sliver_criterion_, *, - parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound_)) - (perturbation_vector_, *, - default_perturbation_vector(c3t3,domain,sliver_criterion_)) - ) -) +/*! + * \ingroup PkgMesh3Functions + * + * The function `perturb_mesh_3()` is a mesh optimizer that + * improves the quality of a Delaunay mesh + * by changing the positions of some vertices of the mesh. + * + * The perturber tries to improve the dihedral angles of the worst cells in the mesh + * degree by degree: the + * step number `n` is considered as successful + * if after this step the worst tetrahedron of the mesh has a minimal dihedral + * angle larger than `n` degrees. + * The perturber exits if this is not the case. + * + * \tparam C3T3 a model of the concept `MeshComplex_3InTriangulation_3` + * \tparam MD a model of the concept `MeshDomain_3` + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * @param c3t3 the initial mesh and is modified by the algorithm to represent the final optimized mesh + * @param domain the domain used to create the `c3t3` parameter + * @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamNBegin{time_limit} + * \cgalParamDescription{is used to set up, in seconds, a CPU time limit after which the optimization process + * is stopped. This time is measured using the `Real_timer` class. The default value is + * 0 and means that there is no time limit.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`0 <= sliver_bound <= 180`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalParamNBegin{sliver_bound} + * \cgalParamDescription{is designed to give, in degrees, a targeted lower bound on dihedral angles of mesh cells. + * The exudation process considers in turn all the mesh cells that have a smallest dihedral + * angle less than sliver_bound and tries to make them disappear by weighting their vertices. + * The optimization process stops when every cell in the mesh achieves this quality. The + * default value is 0 and means that there is no targeted bound: the exuder then runs as long + * as it can improve the smallest dihedral angles of the set of cells incident to some vertices.} + * \cgalParamType{`double`} + * \cgalParamPrecondition{`time_limit >= 0`} + * \cgalParamDefault{0} + * \cgalParamNEnd + * \cgalNamedParamsEnd + * + * \return a value of type `CGAL::Mesh_optimization_return_code` which is: + *
      + *
    • `CGAL::BOUND_REACHED` when the targeted bound for the smallest dihedral angle in the mesh is reached. + *
    • `CGAL::TIME_LIMIT_REACHED` when the time limit is reached. + *
    • `CGAL::CANT_IMPROVE_ANYMORE` when the perturbation process stops because the last step is unsuccessful. + *
    + * + * \cgalHeading{Example} + * + * \code{.cpp} + * // Perturb until every dihedral angle of the mesh is >= 10 degrees + * // No time bound is set + * perturb_mesh_3(c3t3, + * domain, + * parameters::sliver_bound = 10); + * \endcode + * + * \sa `CGAL::Mesh_optimization_return_code` + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::refine_mesh_3()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * + */ +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_USE(sliver_bound_); - return perturb_mesh_3_impl(c3t3, domain, time_limit_, sliver_criterion_, - perturbation_vector_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif + +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return perturb_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} template -#include - #include -#include #include #include #include #include #include - -#include +#include +#include #include @@ -37,7 +34,7 @@ namespace CGAL { namespace details { -/** +/* * @class Insert_vertex_in_c3t3 * * A functor designed to insert unweighted points into the triangulation @@ -101,416 +98,217 @@ private: } // namespace details -namespace parameters { - -namespace internal { - -const int undef_parameter = -1; - -// Helpers -struct Optimization_options_base +/*! + * \ingroup PkgMesh3Functions + * + * The function `refine_mesh_3()` is a 3D + * mesh generator. It produces simplicial meshes which discretize + * 3D domains. + * + * The mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process + * can be activated or not, + * according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward. + * + * \attention The function template `refine_mesh_3()` may be used to refine a previously + * computed mesh, e.g.: + * \code{.cpp} + * C3T3 c3t3 = CGAL::make_mesh_3(domain,criteria); + * + * CGAL::refine_mesh_3(c3t3, domain, new_criteria); + * \endcode + * + * Please note that we guarantee the result if and only if the domain does + * not change from one refinement to the next one. + * + * + * \tparam C3T3 either a model of the concept `MeshComplex_3InTriangulation_3` or + * of `MeshComplexWithFeatures_3InTriangulation_3` if `MD` + * is a model of `MeshDomainWithFeatures_3`. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively. + * + * \tparam MD either a model of the concept `MeshDomain_3` or of + * `MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * + * \tparam MC either a model of the concept `MeshCriteria_3` or a model + * of `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters + * + * \param c3t3 the mesh to be refined that is modified by the refinement process. + * As the refinement process only adds points to the triangulation, all + * vertices of the triangulation of `c3t3` remain in the + * mesh during the refinement process. `c3t3` can be used to insert + * specific points in the domain to ensure that they will be contained in the + * final triangulation. + * \param domain the domain used to create the `c3t3` parameter. It is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * \param criteria specifies the size and shape requirements for mesh tetrahedra + * and surface facets. These criteria form the rules which drive + * the refinement process. All mesh elements satisfy those criteria + * at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. + * They control which optimization processes are performed + * and allow the user to tune the parameters of the optimization processes. + * Individual optimization parameters are not described here as they are + * internal types (see instead the documentation page of each optimizer). + * For each optimization algorithm, there exist two global functions + * that allow to enable or disable the optimizer. + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * Note that regardless of which optimization processes are activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `CGAL::make_mesh_3()` + * \sa `CGAL::parameters::manifold()` + * \sa `CGAL::parameters::manifold_with_boundary()` + * \sa `CGAL::parameters::non_manifold()` + * \sa `CGAL::exude_mesh_3()` + * \sa `CGAL::perturb_mesh_3()` + * \sa `CGAL::lloyd_optimize_mesh_3()` + * \sa `CGAL::odt_optimize_mesh_3()` + * \sa `CGAL::parameters::exude()` + * \sa `CGAL::parameters::no_exude()` + * \sa `CGAL::parameters::perturb()` + * \sa `CGAL::parameters::no_perturb()` + * \sa `CGAL::parameters::lloyd()` + * \sa `CGAL::parameters::no_lloyd()` + * \sa `CGAL::parameters::odt()` + * \sa `CGAL::parameters::no_odt()` + */ +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - Optimization_options_base(bool b) - : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} + using parameters::choose_parameter; + using parameters::get_parameter; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd().v); + bool reset = choose_parameter(get_parameter(np, internal_np::do_reset_c3t3), false); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); - operator bool() const { return b_; } - - bool is_time_limit_set() const { return time_limit_ != undef_parameter; } - void set_time_limit(double d) { time_limit_ = d; } - double time_limit() const { return time_limit_; } - - bool is_bound_set() const { return bound_ != undef_parameter; } - void set_bound(double d) { bound_ = d; } - double bound() const { return bound_; } - -private: - bool b_; - double time_limit_; - double bound_; -}; - -struct Global_optimization_options_base -{ - Global_optimization_options_base() - : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} - - bool is_convergence_set() const { return convergence_ != undef_parameter; } - void set_convergence(double d) { convergence_ = d; } - double convergence() const { return convergence_; } - - bool is_max_iteration_number_set() const { return max_it_nb_ != undef_parameter; } - void set_max_iteration_number(int i) { max_it_nb_ = i; } - int max_iteration_number() const { return max_it_nb_; } - -private: - double convergence_; - int max_it_nb_; -}; - -// Perturb -struct Perturb_options : public Optimization_options_base -{ - Perturb_options(bool b) : Optimization_options_base(b) {} -}; - -// Exude -struct Exude_options : public Optimization_options_base -{ - Exude_options(bool b) : Optimization_options_base(b) {} -}; - -// Odt -struct Odt_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Odt_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Lloyd -struct Lloyd_options : public Optimization_options_base -, public Global_optimization_options_base -{ - Lloyd_options(bool b) : Optimization_options_base(b) - , Global_optimization_options_base() {} -}; - -// Manifold -struct Manifold_options { - enum { - NON_MANIFOLD = 0, - MANIFOLD_WITH_BOUNDARY = 8, - NO_BOUNDARY = 16, - MANIFOLD = 24 - }; - - Manifold_options(const int topology) - : mesh_topology(topology) - {} - Manifold_options() - : mesh_topology(NON_MANIFOLD) - {} - - int mesh_topology; -}; - -// Various Mesh_3 option -struct Mesh_3_options { -#ifndef CGAL_NO_ATOMIC - typedef std::atomic* Pointer_to_stop_atomic_boolean_t; -#else - typedef bool* Pointer_to_stop_atomic_boolean_t; -#endif - Mesh_3_options(bool nonlinear = false) - // This parameter `nonlinear` adds a compatibility with previous - // API of the constructor of `C3t3_initializer`. - // -- Laurent Rineau, 2019/05/03 - : dump_after_init_prefix() - , dump_after_refine_surface_prefix() - , dump_after_refine_prefix() - , dump_after_glob_opt_prefix() - , dump_after_perturb_prefix() - , dump_after_exude_prefix() - , number_of_initial_points(-1) - , nonlinear_growth_of_balls(nonlinear) - , maximal_number_of_vertices(0) - , pointer_to_error_code(0) -#ifndef CGAL_NO_ATOMIC - , pointer_to_stop_atomic_boolean(0) -#endif - {} - - std::string dump_after_init_prefix; - std::string dump_after_refine_surface_prefix; - std::string dump_after_refine_prefix; - std::string dump_after_glob_opt_prefix; - std::string dump_after_perturb_prefix; - std::string dump_after_exude_prefix; - int number_of_initial_points; - bool nonlinear_growth_of_balls; - std::size_t maximal_number_of_vertices; - Mesh_error_code* pointer_to_error_code; -#ifndef CGAL_NO_ATOMIC - Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; -#endif - -}; // end struct Mesh_3_options - -} // end namespace internal - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - - -// ----------------------------------- -// Perturb -// ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Perturb_options), perturb, tag, - (optional (time_limit_, *, internal::undef_parameter ) - (sliver_bound_, *, default_values_for_mesh_3::perturb_sliver_bound ))) -{ - internal::Perturb_options options(true); - - if ( internal::undef_parameter != time_limit_ ) - options.set_time_limit(time_limit_); - - options.set_bound(sliver_bound_); - - return options; + return refine_mesh_3_impl(c3t3, + domain, + criteria, + exude_param, + perturb_param, + odt_param, + lloyd_param, + reset, + mesh_options_param, + manifold_options_param); } -inline internal::Perturb_options no_perturb() { return internal::Perturb_options(false); } - -// ----------------------------------- -// Exude -// ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Exude_options), exude, tag, - (optional (time_limit_, *, internal::undef_parameter ) - (sliver_bound_, *, default_values_for_mesh_3::exude_sliver_bound ))) +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +void refine_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { - internal::Exude_options options(true); - - if ( internal::undef_parameter != time_limit_ ) - options.set_time_limit(time_limit_); - - options.set_bound(sliver_bound_); - - return options; + return refine_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } - -inline internal::Exude_options no_exude() { return internal::Exude_options(false); } - -// ----------------------------------- -// Odt -// ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Odt_options), odt, tag, - (optional (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, default_values_for_mesh_3::odt_convergence_ratio ) - (freeze_bound_, *, default_values_for_mesh_3::odt_freeze_ratio ))) -{ - internal::Odt_options options(true); - - options.set_time_limit(time_limit_); - options.set_bound(freeze_bound_); - options.set_convergence(convergence_); - options.set_max_iteration_number(max_iteration_number_); - - return options; -} - -inline internal::Odt_options no_odt() { return internal::Odt_options(false); } - -// ----------------------------------- -// Lloyd -// ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Lloyd_options), lloyd, tag, - (optional (time_limit_, *, 0 ) - (max_iteration_number_, *, 0 ) - (convergence_, *, default_values_for_mesh_3::lloyd_convergence_ratio ) - (freeze_bound_, *, default_values_for_mesh_3::lloyd_freeze_ratio ))) -{ - internal::Lloyd_options options(true); - - options.set_time_limit(time_limit_); - options.set_bound(freeze_bound_); - options.set_convergence(convergence_); - options.set_max_iteration_number(max_iteration_number_); - - return options; -} - -inline internal::Lloyd_options no_lloyd() { return internal::Lloyd_options(false); } - -// ----------------------------------- -// Manifold options ------------------ -// ----------------------------------- -BOOST_PARAMETER_FUNCTION((internal::Manifold_options), manifold_options, tag, - (optional - (mesh_topology_, (int), -1) - ) - ) -{ - internal::Manifold_options options; - options.mesh_topology = mesh_topology_; - return options; -} - -inline internal::Manifold_options manifold() -{ - return internal::Manifold_options( - internal::Manifold_options::MANIFOLD); -} -inline internal::Manifold_options manifold_with_boundary() -{ - return internal::Manifold_options( - internal::Manifold_options::MANIFOLD_WITH_BOUNDARY); -} -inline internal::Manifold_options non_manifold() -{ - return internal::Manifold_options( - internal::Manifold_options::NON_MANIFOLD); -} - -// ----------------------------------- -// Mesh options -// ----------------------------------- - -// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. -// Allows to dump the mesh at given stage of the mesh generation -// algorithm. -BOOST_PARAMETER_FUNCTION((internal::Mesh_3_options), mesh_3_options, tag, - (optional - (dump_after_init_prefix_, (std::string), "" ) - (dump_after_refine_surface_prefix_, (std::string), "" ) - (dump_after_refine_prefix_, (std::string), "" ) - (dump_after_glob_opt_prefix_, (std::string), "" ) - (dump_after_perturb_prefix_, (std::string), "" ) - (dump_after_exude_prefix_, (std::string), "" ) - (number_of_initial_points_, (int), -1) - (maximal_number_of_vertices_, (std::size_t), 0) - (nonlinear_growth_of_balls_, (bool), false) - (pointer_to_error_code_, (Mesh_error_code*), ((Mesh_error_code*)0)) - (pointer_to_stop_atomic_boolean_, (internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t), ((internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)) - ) - ) -{ - internal::Mesh_3_options options; - - options.dump_after_init_prefix=dump_after_init_prefix_; - options.dump_after_refine_surface_prefix=dump_after_refine_surface_prefix_; - options.dump_after_refine_prefix=dump_after_refine_prefix_; - options.dump_after_glob_opt_prefix=dump_after_glob_opt_prefix_; - options.dump_after_perturb_prefix=dump_after_perturb_prefix_; - options.dump_after_exude_prefix=dump_after_exude_prefix_; - options.number_of_initial_points=number_of_initial_points_; - options.nonlinear_growth_of_balls = nonlinear_growth_of_balls_; - options.maximal_number_of_vertices=maximal_number_of_vertices_; - options.pointer_to_error_code=pointer_to_error_code_; -#ifndef CGAL_NO_ATOMIC - options.pointer_to_stop_atomic_boolean=pointer_to_stop_atomic_boolean_; -#endif - - return options; -} - -// Undocumented Boost parameter for refine_mesh_3 and make_mesh_3. -// Default Mesh_3_options: dump at every stage of the mesh generation. -inline internal::Mesh_3_options mesh_3_dump() -{ - internal::Mesh_3_options options; - - options.dump_after_init_prefix = "mesh_dump_after_init"; - options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; - options.dump_after_refine_prefix = "mesh_dump_after_refine"; - options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; - options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; - options.dump_after_exude_prefix = "mesh_dump_after_exude"; - - return options; -} - -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - -// ----------------------------------- -// Reset_c3t3 (undocumented) -// ----------------------------------- - CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) - // CGAL_BOOLEAN_PARAMETER defined in - - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -// ----------------------------------- -// Parameters -// ----------------------------------- -BOOST_PARAMETER_NAME( exude_param ) -BOOST_PARAMETER_NAME( perturb_param ) -BOOST_PARAMETER_NAME( odt_param ) -BOOST_PARAMETER_NAME( lloyd_param ) -BOOST_PARAMETER_NAME( reset_param ) -BOOST_PARAMETER_NAME( mesh_options_param ) -BOOST_PARAMETER_NAME( manifold_options_param ) - -CGAL_PRAGMA_DIAG_POP - -} // end namespace parameters - - - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - refine_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (reset_param, (parameters::Reset), parameters::reset_c3t3()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) -{ - return refine_mesh_3_impl(c3t3, - domain, - criteria, - exude_param, - perturb_param, - odt_param, - lloyd_param, - reset_param(), - mesh_options_param, - manifold_options_param); -} - -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif - /** * @brief This function refines the mesh c3t3 wrt domain & criteria * * @param c3t3 the mesh to be refined. - * @param domain the domain to be discretized + * @param domain the domain used to be discretized * @param criteria the criteria - * @param exude if \c true, an exudation step will be done at + * @param exude if `true`, an exudation step will be done at * the end of the Delaunay refinement process - * @param perturb if \c true, an explicit vertex perturbation step will be + * @param perturb if `true`, an explicit vertex perturbation step will be * done at the end of refinement process - * @param reset_c3t3 if \c true, a new C3T3 will be construct from param c3t3. + * @param reset_c3t3 if `true`, a new C3T3 will be construct from param c3t3. * The new c3t3 keeps only the vertices (as NON-weighted points with their * dimension and Index) of the triangulation. That allows to refine a mesh * which has been exuded. @@ -619,9 +417,7 @@ void refine_mesh_3_impl(C3T3& c3t3, dump_c3t3(c3t3, mesh_options.dump_after_exude_prefix); } } - +#endif // DOXYGEN_RUNNING } // end namespace CGAL -#include - #endif // CGAL_REFINE_MESH_3_H diff --git a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp index 0c3a1b8c7bb..25a468bbf6f 100644 --- a/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp +++ b/Mesh_3/test/Mesh_3/test_labeled_mesh_domain_3.cpp @@ -42,8 +42,8 @@ struct LM3_tester static FT shape_function (const Point_3& p) { - if (p.x() < 0) - return -1; + if (p.x() < 0) + return -1; const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z(); return x2 + y2 + z2 - 1; } @@ -56,12 +56,12 @@ struct LM3_tester void operator() () const { - typedef typename K::Sphere_3 Sphere_3; - typedef typename K::Iso_cuboid_3 Iso_cuboid_3; + typedef typename K::Sphere_3 Sphere_3; + typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - test_domain(Sphere_3(CGAL::ORIGIN, 4.)); - test_domain(CGAL::Bbox_3(-2.,-2.,-2., 2.,2.,2.)); - test_domain(Iso_cuboid_3(Point_3(-2.,-2.,-2.), Point_3(2.,2.,2.))); + test_domain(Sphere_3(CGAL::ORIGIN, 4.)); + test_domain(CGAL::Bbox_3(-2.,-2.,-2., 2.,2.,2.)); + test_domain(Iso_cuboid_3(Point_3(-2.,-2.,-2.), Point_3(2.,2.,2.))); } private: @@ -72,12 +72,12 @@ private: Function f_sphere(&sphere_function); Function_wrapper wrapper_1(f_sphere); - Mesh_domain domain(wrapper_1, bounding_shape, error_bound); + Mesh_domain domain(wrapper_1, bounding_shape, CGAL::parameters::relative_error_bound(error_bound)); test_construct_initial_points(domain, error_bound); Function f_shape(&shape_function); Function_wrapper wrapper_2(f_shape); - Mesh_domain domain_2(wrapper_2, bounding_shape, error_bound); + Mesh_domain domain_2(wrapper_2, bounding_shape, CGAL::parameters::relative_error_bound(error_bound)); test_is_in_domain(domain_2); test_do_intersect_surface(domain_2); test_construct_intersection(domain_2); @@ -85,171 +85,171 @@ private: void test_construct_initial_points (const Mesh_domain& domain, FT error_bound) const { - typedef typename Mesh_domain::Construct_initial_points Construct_initial_points; - typedef typename Mesh_domain::Index Index; - typedef typename std::vector >::const_iterator Points_const_iterator; - typedef typename K::Compute_squared_distance_3 Compute_squared_distance_3; + typedef typename Mesh_domain::Construct_initial_points Construct_initial_points; + typedef typename Mesh_domain::Index Index; + typedef typename std::vector >::const_iterator Points_const_iterator; + typedef typename K::Compute_squared_distance_3 Compute_squared_distance_3; - Compute_squared_distance_3 squared_distance = K().compute_squared_distance_3_object(); + Compute_squared_distance_3 squared_distance = K().compute_squared_distance_3_object(); - Construct_initial_points construct_initial_points = domain.construct_initial_points_object(); - std::vector > points; - int point_count = 12; - construct_initial_points(std::back_inserter(points), point_count); + Construct_initial_points construct_initial_points = domain.construct_initial_points_object(); + std::vector > points; + int point_count = 12; + construct_initial_points(std::back_inserter(points), point_count); - for (Points_const_iterator iter = points.begin(), end_iter = points.end(); iter != end_iter; ++iter) - { - const Point_3& p = iter->first; + for (Points_const_iterator iter = points.begin(), end_iter = points.end(); iter != end_iter; ++iter) + { + const Point_3& p = iter->first; - FT sd = squared_distance(CGAL::ORIGIN, p); - FT diff = sd - 1; - if (diff < FT(0.)) - diff = -diff; - assert(diff <= error_bound); - } + FT sd = squared_distance(CGAL::ORIGIN, p); + FT diff = sd - 1; + if (diff < FT(0.)) + diff = -diff; + assert(diff <= error_bound); + } } void test_is_in_domain (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Is_in_domain Is_in_domain; - typedef typename Mesh_domain::Subdomain Subdomain; - typedef typename Mesh_domain::Subdomain_index Subdomain_index; + typedef typename Mesh_domain::Is_in_domain Is_in_domain; + typedef typename Mesh_domain::Subdomain Subdomain; + typedef typename Mesh_domain::Subdomain_index Subdomain_index; - Is_in_domain is_in_domain = domain.is_in_domain_object(); + Is_in_domain is_in_domain = domain.is_in_domain_object(); - { - Subdomain subdomain = is_in_domain(Point_3(CGAL::ORIGIN)); - assert(subdomain); - Subdomain_index subdomain_index = *subdomain; - assert(subdomain_index == 1); - } + { + Subdomain subdomain = is_in_domain(Point_3(CGAL::ORIGIN)); + assert(subdomain); + Subdomain_index subdomain_index = *subdomain; + assert(subdomain_index == 1); + } - { - Subdomain subdomain = is_in_domain(Point_3(1.5, 0., 0.)); - assert(!subdomain); - } + { + Subdomain subdomain = is_in_domain(Point_3(1.5, 0., 0.)); + assert(!subdomain); + } } void test_do_intersect_surface (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Do_intersect_surface Do_intersect_surface; - typedef typename Mesh_domain::Surface_patch Surface_patch; - typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; - typedef typename Mesh_domain::Segment_3 Segment_3; - typedef typename Mesh_domain::Ray_3 Ray_3; - typedef typename Mesh_domain::Line_3 Line_3; - typedef typename Mesh_domain::Vector_3 Vector_3; + typedef typename Mesh_domain::Do_intersect_surface Do_intersect_surface; + typedef typename Mesh_domain::Surface_patch Surface_patch; + typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; + typedef typename Mesh_domain::Segment_3 Segment_3; + typedef typename Mesh_domain::Ray_3 Ray_3; + typedef typename Mesh_domain::Line_3 Line_3; + typedef typename Mesh_domain::Vector_3 Vector_3; - Do_intersect_surface do_intersect_surface = domain.do_intersect_surface_object(); + Do_intersect_surface do_intersect_surface = domain.do_intersect_surface_object(); - { - Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(s); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(s); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(s); - assert(!p); - } + { + Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(s); + assert(!p); + } - { - Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); - Surface_patch p = do_intersect_surface(r); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); + Surface_patch p = do_intersect_surface(r); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); - Surface_patch p = do_intersect_surface(r); - assert(!p); - } + { + Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); + Surface_patch p = do_intersect_surface(r); + assert(!p); + } - { - Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Surface_patch p = do_intersect_surface(l); - assert(p); - Surface_patch_index pi = *p; - assert(pi.first == 0 && pi.second == 1); - } + { + Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Surface_patch p = do_intersect_surface(l); + assert(p); + Surface_patch_index pi = *p; + assert(pi.first == 0 && pi.second == 1); + } - { - Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); - Surface_patch p = do_intersect_surface(l); - assert(!p); - } + { + Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); + Surface_patch p = do_intersect_surface(l); + assert(!p); + } } void test_construct_intersection (const Mesh_domain& domain) const { - typedef typename Mesh_domain::Construct_intersection Construct_intersection; - typedef typename Mesh_domain::Intersection Intersection; - typedef typename Mesh_domain::Subdomain_index Subdomain_index; - typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; - typedef typename Mesh_domain::Index Index; - typedef typename Mesh_domain::Segment_3 Segment_3; - typedef typename Mesh_domain::Ray_3 Ray_3; - typedef typename Mesh_domain::Line_3 Line_3; - typedef typename Mesh_domain::Vector_3 Vector_3; + typedef typename Mesh_domain::Construct_intersection Construct_intersection; + typedef typename Mesh_domain::Intersection Intersection; + typedef typename Mesh_domain::Subdomain_index Subdomain_index; + typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; + typedef typename Mesh_domain::Index Index; + typedef typename Mesh_domain::Segment_3 Segment_3; + typedef typename Mesh_domain::Ray_3 Ray_3; + typedef typename Mesh_domain::Line_3 Line_3; + typedef typename Mesh_domain::Vector_3 Vector_3; - Construct_intersection construct_intersection = domain.construct_intersection_object(); + Construct_intersection construct_intersection = domain.construct_intersection_object(); - { - Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(s); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Segment_3 s(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(s); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(s); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Segment_3 s(Point_3(1.5, 1.5, 0.), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(s); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } - { - Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); - Intersection i = construct_intersection(r); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Ray_3 r(Point_3(CGAL::ORIGIN), Vector_3(1., 0., 0.)); + Intersection i = construct_intersection(r); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); - Intersection i = construct_intersection(r); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Ray_3 r(Point_3(1.5, 0., 0.), Vector_3(0., 1., 0.)); + Intersection i = construct_intersection(r); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } - { - Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); - Intersection i = construct_intersection(l); - assert(std::get<0>(i) != Point_3(1., 0., 0.)); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 2); - } + { + Line_3 l(Point_3(CGAL::ORIGIN), Point_3(1.5, 0., 0.)); + Intersection i = construct_intersection(l); + assert(std::get<0>(i) != Point_3(1., 0., 0.)); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 2); + } - { - Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); - Intersection i = construct_intersection(l); - Index ii = std::get<1>(i); - assert(boost::get(&ii)); - assert(std::get<2>(i) == 0); - } + { + Line_3 l(Point_3(1.5, 0., 0.), Point_3(1.5, 0.5, 0.)); + Intersection i = construct_intersection(l); + Index ii = std::get<1>(i); + assert(boost::get(&ii)); + assert(std::get<2>(i) == 0); + } } }; diff --git a/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp b/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp index 03b91d15d8c..14390abda0d 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp @@ -50,8 +50,8 @@ auto field = [](const Point& p, const int, const Mesh_domain::Index) int main() { Mesh_domain domain = - Mesh_domain::create_implicit_mesh_domain(capsule_function, - K::Sphere_3(CGAL::ORIGIN, 49.)); + Mesh_domain::create_implicit_mesh_domain(function = capsule_function, + bounding_object = K::Sphere_3(CGAL::ORIGIN, 49.)); // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_size=0.5, diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 0d151fc1b9b..9885213a25c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -48,7 +48,7 @@ public: << CGAL::get_default_random().get_seed() << std::endl; Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain (image, - 1e-9, + CGAL::parameters::relative_error_bound = 1e-9, CGAL::parameters::p_rng = &CGAL::get_default_random()); // Set mesh criteria diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 3270d321e9b..a16c177a937 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -153,7 +153,7 @@ struct Tester // Quality should increase C3t3 exude_c3t3(c3t3); std::cerr << "Exude...\n"; - CGAL::exude_mesh_3(exude_c3t3); + CGAL::exude_mesh_3(exude_c3t3, CGAL::parameters::time_limit = 0); verify_c3t3(exude_c3t3,domain,domain_type,v,v,f,f); verify_c3t3_quality(c3t3,exude_c3t3); verify_c3t3_volume(exude_c3t3, volume*0.95, volume*1.05); @@ -164,7 +164,7 @@ struct Tester // Quality should increase C3t3 perturb_c3t3(c3t3); std::cerr << "Perturb...\n"; - CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit=5); + CGAL::perturb_mesh_3(perturb_c3t3, domain, CGAL::parameters::time_limit =5); verify_c3t3(perturb_c3t3,domain,domain_type,v,v); verify_c3t3_quality(c3t3,perturb_c3t3); verify_c3t3_volume(perturb_c3t3, volume*0.95, volume*1.05); diff --git a/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/approximated_offset_2.h b/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/approximated_offset_2.h index 4b98132bb68..8ccc2643a0e 100644 --- a/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/approximated_offset_2.h +++ b/Minkowski_sum_2/doc/Minkowski_sum_2/CGAL/approximated_offset_2.h @@ -14,7 +14,7 @@ several disconnected components. The result is therefore represented as a sequence of generalized polygons, whose edges are either line segments or circular arcs. The output sequence is returned via the output iterator `oi`, whose -value-type must be `Gps_circle_segment_traits_2::Polygon_2`. +value-type must be `Gps_circle_segment_traits_2::%Polygon_2`. \pre `P` is a simple polygon. */ template diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_segment_2_primitive.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_segment_2_primitive.h index b4b057ef2d0..59b5f208021 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_segment_2_primitive.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_segment_2_primitive.h @@ -35,10 +35,8 @@ public: { } - AABB_segment_2_primitive(const AABB_segment_2_primitive &primitive) - { - m_it = primitive.id(); - } + AABB_segment_2_primitive(const AABB_segment_2_primitive& primitive) = default; + AABB_segment_2_primitive& operator=(const AABB_segment_2_primitive& primitive) = default; const Id &id() const { diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h index 10ab7f494f9..5793cc99e49 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h @@ -266,7 +266,6 @@ public: // Construct the segments of the convolution cycles. unsigned int curr_id = 0; - unsigned int cycles = 0; Segments_list conv_segments; Segments_list cycle; Labels_set used_labels; @@ -340,7 +339,6 @@ public: CGAL_assertion(cycle.empty()); } } - ++cycles; } curr1 = next1; diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index 8ccfb77c1b6..f95e1daefbd 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -485,6 +485,8 @@ check_integrity_and_topological_planarity(bool faces) const std::size_t e_num = number_of_edges(); std::size_t c_num = number_of_connected_components() - iso_vert_num; std::size_t f_num = number_of_face_cycles() - c_num + 1; + CGAL_USE(fc_num); + CGAL_USE(iv_num); CGAL_USE(v_num); CGAL_USE(e_num); CGAL_USE(f_num); diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 0f1443d4e55..ede8d2b033a 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -665,6 +666,7 @@ protected: } + CGAL_USE(flip_count); CGAL_NEF_TRACEN(" flipped "<circle().oriented_side(sv[0]->point()) == os1) { - // sedges are only on one side " + // sedges are only on one side sce[i] = scb[1-i] = sce[1-i]; empty_c[1-i] = true; done = true; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_explorer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_explorer.h index 4a38ac41754..cef97636549 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_explorer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_explorer.h @@ -30,10 +30,8 @@ class SNC_SM_explorer : public SMCDEC { public: SNC_SM_explorer(const Base& E) : Base(E) {} - Self& operator=(const Self& E) { - Base::operator=(E); - return *this; - } + SNC_SM_explorer(const Self& E) = default; + Self& operator=(const Self& E) = default; }; } //namespace CGAL diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h index fe38af9ab44..336dac05c93 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h @@ -358,6 +358,8 @@ check_integrity_and_topological_planarity(bool faces) const iso_vert_num + number_of_sloops()); CGAL_assertion_code(std::size_t f_num = number_of_sface_cycles() - c_num + 1); + CGAL_USE(fc_num); + CGAL_USE(iv_num); CGAL_assertion_code(CGAL_NEF_TRACEV(fc_num)); CGAL_assertion_code(CGAL_NEF_TRACEV(iv_num)); CGAL_assertion_code(CGAL_NEF_TRACEV(iso_vert_num)); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/utils.h b/NewKernel_d/include/CGAL/NewKernel_d/utils.h index 03f9b35ff94..ddfdbab3ac2 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/utils.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/utils.h @@ -138,7 +138,7 @@ struct Has_type_different_from } // TODO: make a Cartesian-only variant -// WARNING: do not use the Req* parameters too much, they can cause circular instanciations and are only useful for dispatching. +// WARNING: do not use the Req* parameters too much, they can cause circular instantiations and are only useful for dispatching. #define CGAL_STRIP_PAREN_(...) __VA_ARGS__ #define CGAL_STRIP_PAREN(...) CGAL_STRIP_PAREN_ __VA_ARGS__ // What to do with O? pass it down to other functors or drop it? diff --git a/Number_types/doc/Number_types/CGAL/CORE_BigInt.h b/Number_types/doc/Number_types/CGAL/CORE_BigInt.h index c5fd69d35a9..6e3f81effc1 100644 --- a/Number_types/doc/Number_types/CGAL/CORE_BigInt.h +++ b/Number_types/doc/Number_types/CGAL/CORE_BigInt.h @@ -4,7 +4,7 @@ namespace CORE { /*! \ingroup nt_core -The class `CORE::BigInt` provides exact computation in \f$ \Z\f$. +The class `CORE::BigInt` provides exact computation in \f$ \mathbb{Z}\f$. Operations and comparisons between objects of this type are guaranteed to be exact. This number type is provided by the \core library \cgalCite{klpy-clp-99}. diff --git a/Number_types/doc/Number_types/CGAL/CORE_BigRat.h b/Number_types/doc/Number_types/CGAL/CORE_BigRat.h index ac2fae1b1d8..672adee91df 100644 --- a/Number_types/doc/Number_types/CGAL/CORE_BigRat.h +++ b/Number_types/doc/Number_types/CGAL/CORE_BigRat.h @@ -3,7 +3,7 @@ namespace CORE { /*! \ingroup nt_core -The class `CORE::BigRat` provides exact computation in \f$ \Q\f$. +The class `CORE::BigRat` provides exact computation in \f$ \mathbb{Q}\f$. Operations and comparisons between objects of this type are guaranteed to be exact. This number type is provided by the \core library \cgalCite{klpy-clp-99}. diff --git a/Number_types/doc/Number_types/CGAL/Quotient.h b/Number_types/doc/Number_types/CGAL/Quotient.h index 390efe03ecb..f24d5b3b7d5 100644 --- a/Number_types/doc/Number_types/CGAL/Quotient.h +++ b/Number_types/doc/Number_types/CGAL/Quotient.h @@ -8,8 +8,7 @@ An object of the class `Quotient` is an element of the field of quotients of the integral domain type `NT`. If `NT` behaves like an integer, `Quotient` behaves like a rational number. -\leda's class `rational` (see Section \ref ledant) -has been the basis for `Quotient`. + A `Quotient` `q` is represented as a pair of `NT`s, representing numerator and denominator. diff --git a/Number_types/doc/Number_types/CGAL/Root_of_traits.h b/Number_types/doc/Number_types/CGAL/Root_of_traits.h index ebb6e31f1ea..dd7ea45c2e2 100644 --- a/Number_types/doc/Number_types/CGAL/Root_of_traits.h +++ b/Number_types/doc/Number_types/CGAL/Root_of_traits.h @@ -6,7 +6,7 @@ namespace CGAL { The function `compute_roots_of_2()` solves a univariate polynomial as it is defined by the coefficients given to the function. The solutions are written into the given `OutputIterator`. -Writes the real roots of the polynomial \f$ aX^2+bX+c\f$ into \f$ oit\f$ in ascending order. +Writes the real roots of the polynomial \f$ aX^2+bX+c\f$ into `oit` in ascending order. `OutputIterator` is required to accept \link Root_of_traits::Root_of_2 `Root_of_traits::Root_of_2`\endlink. @@ -37,7 +37,7 @@ The function `make_root_of_2()` constructs an algebraic number of degree 2 over ring number type. Returns the smallest real root of the polynomial \f$ aX^2+bX+c\f$ if -\f$ s\f$ is true, and the largest root is \f$ s\f$ is false. +\f$ s\f$ is `true`, and the largest root is \f$ s\f$ is `false`. \pre `RT` is an `IntegralDomainWithoutDivision`. \pre The polynomial has at least one real root. @@ -81,8 +81,8 @@ namespace CGAL { /*! \ingroup nt_ralgebraic -The function `make_sqrt()` constructs a square root of a given value of type \f$ RT\f$. -Depending on the type \f$ RT\f$ the square root may be returned in a new type that +The function `make_sqrt()` constructs a square root of a given value of type `RT`. +Depending on the type `RT` the square root may be returned in a new type that can represent algebraic extensions of degree \f$ 2\f$. \returns \f$ \sqrt{x}.\f$ diff --git a/Number_types/doc/Number_types/CGAL/Sqrt_extension.h b/Number_types/doc/Number_types/CGAL/Sqrt_extension.h index dcde8e1163c..a52f55780dc 100644 --- a/Number_types/doc/Number_types/CGAL/Sqrt_extension.h +++ b/Number_types/doc/Number_types/CGAL/Sqrt_extension.h @@ -3,29 +3,29 @@ namespace CGAL { /*! \ingroup nt_ralgebraic -An instance of this class represents an extension of the type `NT` by *one* square root of the type `ROOT`. +An instance of this class represents an extension of the type `NT` by *one* square root of the type `Root`. -`NT` is required to be constructible from `ROOT`. +`NT` is required to be constructible from `Root`. `NT` is required to be an `IntegralDomainWithoutDivision`. `Sqrt_extension` is `RealEmbeddable` if NT is `RealEmbeddable`. -For example, let `Integer` be some type representing \f$ \Z\f$, then -`Sqrt_extension` is able to represent \f$ \Z[\sqrt{\mathrm{root}}]\f$ -for some arbitrary Integer \f$\mathrm{root}\f$. \cgalFootnote{\f$ R[a]\f$ denotes the extension of a ring \f$ R\f$ by an element \f$ a\f$. See also: \cgalFootnoteCode{http://mathworld.wolfram.com/ExtensionRing.html}} +For example, let `Integer` be some type representing \f$ \mathbb{Z}\f$, then +`Sqrt_extension` is able to represent \f$ \mathbb{Z}[\sqrt{\mathrm{root}}]\f$ +for some arbitrary Integer \f$\mathrm{root}\f$. \cgalFootnote{\f$ R[a]\f$ denotes the extension of a ring \f$ R\f$ by an element \f$ a\f$. See also: \cgalFootnoteCode{https://mathworld.wolfram.com/ExtensionRing.html}} The value of \f$\mathrm{root}\f$ is set at construction time, or set to zero if it is not specified. -Arithmetic operations among different extensions, say \f$ \Z[\sqrt{a}]\f$ -and \f$ \Z[\sqrt{b}]\f$, are not supported. -The result would be in \f$ \Z[\sqrt{a},\sqrt{b}]\f$, which is not +Arithmetic operations among different extensions, say \f$ \mathbb{Z}[\sqrt{a}]\f$ +and \f$ \mathbb{Z}[\sqrt{b}]\f$, are not supported. +The result would be in \f$ \mathbb{Z}[\sqrt{a},\sqrt{b}]\f$, which is not representable by `Sqrt_extension`. \attention The user is responsible to check that arithmetic operations are carried out for elements from the same extensions only. - This is not tested by `Sqrt_extension` for efficiency reasons. A violation of the precondition leads to undefined behavior. + Be aware that for efficiency reasons the given \f$\mathrm{root}\f$ is stored as it is given to the constructor. In particular, an extension by a square root of a square is considered as an extension. @@ -78,7 +78,7 @@ NT The extension of a `UniqueFactorizationDomain` or -`EuclideanRing` is just an `IntegralDomain`, since the extension in general destroys the unique factorization property. For instance consider \f$ \Z[\sqrt{10}]\f$, the extension of \f$ \Z\f$ by \f$ \sqrt{10}\f$: in \f$ \Z[\sqrt{10}]\f$ the element 10 has two different factorizations \f$ \sqrt{10} \cdot \sqrt{10}\f$ and \f$ 2 \cdot 5\f$. In particular, the factorization is not unique. +`EuclideanRing` is just an `IntegralDomain`, since the extension in general destroys the unique factorization property. For instance consider \f$ \mathbb{Z}[\sqrt{10}]\f$, the extension of \f$ \mathbb{Z}\f$ by \f$ \sqrt{10}\f$: in \f$ \mathbb{Z}[\sqrt{10}]\f$ the element 10 has two different factorizations \f$ \sqrt{10} \cdot \sqrt{10}\f$ and \f$ 2 \cdot 5\f$. In particular, the factorization is not unique. If `NT` is a model of `RealEmbeddable` the type `Sqrt_extension` is also considered as `RealEmbeddable`. However, by default it is not allowed to compare values from different extensions for efficiency reasons. In case such a comparison becomes necessary, use the member function compare with the according Boolean flag. If such a comparison is a very frequent case, override the default of `DifferentExtensionComparable` by giving \cgalTagTrue as third template parameter. This effects the behavior of compare functions as well as the compare operators. @@ -91,8 +91,8 @@ In case `NT` is not `RealEmbeddable`, `DifferentExtensionComparable` as well as \cgalModels `CopyConstructible` \cgalModels `DefaultConstructible` \cgalModels `EqualityComparable` -\cgalModels `ImplicitInteroperable` with int -\cgalModels `ImplicitInteroperable` with NT +\cgalModels `ImplicitInteroperable` with `int` +\cgalModels `ImplicitInteroperable` with `NT` \cgalModels `Fraction` if NT is a `Fraction` \cgalModels `RootOf_2` @@ -104,7 +104,7 @@ In case `NT` is not `RealEmbeddable`, `DifferentExtensionComparable` as well as \sa \cgalTagFalse */ -template< typename NT, typename ROOT, +template< typename NT, typename Root, typename DifferentExtensionComparable = Tag_false, typename FilterPredicates = Tag_false> class Sqrt_extension { @@ -148,7 +148,7 @@ Sqrt_extension (int a0, int a1, int r); /*! General constructor: `ext`\f$ = a0 + a1 \cdot sqrt(r)\f$. \pre \f$ r \neq0\f$ */ -Sqrt_extension (NT a0, NT a1, ROOT r); +Sqrt_extension (NT a0, NT a1, Root r); /// @} @@ -172,10 +172,10 @@ const NT & a1 () const ; /*! Const access operator for root */ -const ROOT & root () const; +const Root & root () const; /*! -Returns true in case root of `ext` is not zero. +Returns `true` in case root of `ext` is not zero. Note that \f$ a1 == 0 \f$ does not imply \f$ \mathrm{root} == 0\f$. */ @@ -192,7 +192,7 @@ of `ext`. see also: `AlgebraicStructureTraits::Simplify`. void simplify (); /*! -returns true if `ext` represents the value zero. +returns `true` if `ext` represents the value zero. */ bool is_zero () const; @@ -326,19 +326,19 @@ In case the mode is `CGAL::IO::ASCII` the format is `EXT[a0,a1,root]`. In case the mode is `CGAL::IO::PRETTY` the format is human readable. -\attention `operator>>` must be defined for `ROOT` and `NT`. +\attention `operator>>` must be defined for `Root` and `NT`. \relates Sqrt_extension */ -std::ostream& operator<<(std::ostream& os, const Sqrt_extension &ext); +std::ostream& operator<<(std::ostream& os, const Sqrt_extension &ext); /*! reads `ext` from istream `is` in format `EXT[a0,a1,root]`, the output format in mode `CGAL::IO::ASCII` -\attention `operator<<` must be defined exist for `ROOT` and `NT`. +\attention `operator<<` must be defined exist for `Root` and `NT`. \relates Sqrt_extension */ -std::istream& operator>>(std::istream& is, const Sqrt_extension &ext); +std::istream& operator>>(std::istream& is, const Sqrt_extension &ext); } /* end namespace CGAL */ diff --git a/Number_types/doc/Number_types/CGAL/leda_integer.h b/Number_types/doc/Number_types/CGAL/leda_integer.h index 1f8871f67ba..f0f5de4602c 100644 --- a/Number_types/doc/Number_types/CGAL/leda_integer.h +++ b/Number_types/doc/Number_types/CGAL/leda_integer.h @@ -3,7 +3,7 @@ /*! \ingroup nt_leda -The class `leda_integer` provides exact computation in \f$ \Z\f$. +The class `leda_integer` provides exact computation in \f$ \mathbb{Z}\f$. The class `leda_integer` is a wrapper class that provides the functions needed to use the number type `leda::integer`, representing exact multiprecision integers provided by \leda. diff --git a/Number_types/doc/Number_types/Concepts/RootOf_2.h b/Number_types/doc/Number_types/Concepts/RootOf_2.h index 8617222cb5f..9c10536f514 100644 --- a/Number_types/doc/Number_types/Concepts/RootOf_2.h +++ b/Number_types/doc/Number_types/Concepts/RootOf_2.h @@ -30,8 +30,8 @@ special construction for extensions of degree 2: \cgalRefines `DefaultConstructible` \cgalRefines `CopyConstructible` \cgalRefines `FromIntConstructible` -\cgalRefines `ImplicitInteroperable` with RT -\cgalRefines `ImplicitInteroperable` with FT +\cgalRefines `ImplicitInteroperable` with `RT` +\cgalRefines `ImplicitInteroperable` with `FT` \cgalHasModel `double` (not exact) \cgalHasModel `CGAL::Sqrt_extension` @@ -76,4 +76,3 @@ bool operator< (const RootOf_2&a,const RootOf_2& b); /// @} }; /* end RootOf_2 */ - diff --git a/Number_types/doc/Number_types/NumberTypeSupport.txt b/Number_types/doc/Number_types/NumberTypeSupport.txt index 2a2e35866ae..705e1fe6d27 100644 --- a/Number_types/doc/Number_types/NumberTypeSupport.txt +++ b/Number_types/doc/Number_types/NumberTypeSupport.txt @@ -210,6 +210,7 @@ This package was naturally one of the first packages implemented in \cgal. It initially contained the `Quotient`, `Gmpz` and `Gmpq` classes, together with the interfaces to the number types provided by \leda, which were implemented by Stefan Schirra and Andreas Fabri. +\leda's class `rational` has been the basis for `Quotient`. Later, around 1998-2002, Sylvain Pion implemented `Interval_nt`, `MP_Float` and `Lazy_exact_nt`, together with the interfaces to @@ -231,4 +232,3 @@ Luis Peñaranda and Sylvain Lazard contributed the `Gmpfi` and */ } /* namespace CGAL */ - diff --git a/Number_types/include/CGAL/Exact_integer.h b/Number_types/include/CGAL/Exact_integer.h index 5e9c1910ca3..6e02ffc9ada 100644 --- a/Number_types/include/CGAL/Exact_integer.h +++ b/Number_types/include/CGAL/Exact_integer.h @@ -50,11 +50,10 @@ typedef unspecified_type Exact_integer; #else // not DOXYGEN_RUNNING -#if ( (defined(CGAL_TEST_SUITE) && CGAL_VERSION_NR == 1050500900) || defined(CGAL_FORCE_USE_BOOST_MP))\ - && BOOST_VERSION > 107800 && defined(CGAL_USE_BOOST_MP) -// use boost-mp by default in the testsuite until 5.5-beta is out +#if BOOST_VERSION > 107900 && defined(CGAL_USE_BOOST_MP) +// use boost-mp by default typedef BOOST_cpp_arithmetic_kernel::Integer Exact_integer; -#else // BOOST_VERSION > 107800 +#else // BOOST_VERSION > 107900 #ifdef CGAL_USE_GMPXX typedef mpz_class Exact_integer; #elif defined(CGAL_USE_GMP) diff --git a/Number_types/include/CGAL/Exact_rational.h b/Number_types/include/CGAL/Exact_rational.h index 613fa0cd0f0..f07c61d42a9 100644 --- a/Number_types/include/CGAL/Exact_rational.h +++ b/Number_types/include/CGAL/Exact_rational.h @@ -14,6 +14,9 @@ // // Author(s) : Laurent Rineau +#ifndef CGAL_EXACT_RATIONAL_H +#define CGAL_EXACT_RATIONAL_H + #include namespace CGAL { @@ -44,3 +47,5 @@ typedef internal::Exact_field_selector::Type Exact_rational; #endif } /* end namespace CGAL */ + +#endif // CGAL_EXACT_RATIONAL_H diff --git a/Number_types/include/CGAL/FPU.h b/Number_types/include/CGAL/FPU.h index 429941be991..7b926a5d251 100644 --- a/Number_types/include/CGAL/FPU.h +++ b/Number_types/include/CGAL/FPU.h @@ -143,8 +143,8 @@ inline double IA_opacify(double x) { #ifdef __llvm__ // LLVM's support for inline asm is completely messed up: - // http://llvm.org/bugs/show_bug.cgi?id=17958 - // http://llvm.org/bugs/show_bug.cgi?id=17959 + // https://bugs.llvm.org/show_bug.cgi?id=17958 + // https://bugs.llvm.org/show_bug.cgi?id=17959 // etc. // This seems to produce code that is ok (not optimal but better than // volatile). In case of trouble, use volatile instead. @@ -166,7 +166,7 @@ inline double IA_opacify(double x) // Intel used not to emulate this perfectly, we'll see. // If we create a version of IA_opacify for vectors, note that gcc < 4.8 // fails with "+g" and we need to use "+mx" instead. - // "+X" ICEs ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59155 ) and + // "+X" ICEs ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59155 ) and // may not be safe? // The constraint 'g' doesn't include floating point registers ??? // Intel has a bug where -mno-sse still defines __SSE__ and __SSE2__ @@ -180,10 +180,10 @@ inline double IA_opacify(double x) # endif # elif (defined __i386__ || defined __x86_64__) // "+f" doesn't compile on x86(_64) - // ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59157 ) - // Don't mix "t" with "g": http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59180 + // ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59157 ) + // Don't mix "t" with "g": https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59180 // We can't put "t" with "x" either, prefer "x" for -mfpmath=sse,387. - // ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59181 ) + // ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59181 ) asm volatile ("" : "+mt"(x) ); # elif (defined __VFP_FP__ && !defined __SOFTFP__) || defined __aarch64__ // ARM @@ -217,7 +217,7 @@ inline double IA_force_to_double(double x) #if defined __GNUG__ # ifdef CGAL_HAS_SSE2 // For an explanation of volatile: - // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56027 + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56027 asm volatile ("" : "+mx"(x) ); # else // Similar to writing to a volatile and reading back, except that calling @@ -500,6 +500,7 @@ void FPU_set_cw (FPU_CW_t cw) { #ifdef CGAL_ALWAYS_ROUND_TO_NEAREST + CGAL_USE(cw); CGAL_assertion(cw == CGAL_FE_TONEAREST); #else CGAL_IA_SETFPCW(cw); @@ -511,6 +512,7 @@ FPU_CW_t FPU_get_and_set_cw (FPU_CW_t cw) { #ifdef CGAL_ALWAYS_ROUND_TO_NEAREST + CGAL_USE(cw); CGAL_assertion(cw == CGAL_FE_TONEAREST); return CGAL_FE_TONEAREST; #else diff --git a/Number_types/include/CGAL/GMP/Gmpz_type.h b/Number_types/include/CGAL/GMP/Gmpz_type.h index b6ace5743a0..bf91ddb5d91 100644 --- a/Number_types/include/CGAL/GMP/Gmpz_type.h +++ b/Number_types/include/CGAL/GMP/Gmpz_type.h @@ -324,9 +324,9 @@ gmpz_new_read(std::istream &is, Gmpz &z) // peek() sets also the failbit, one has to check for EOL twice. // // See the LWG C++ Issue 2036, classified as Not-A-Defect: - // http://lwg.github.com/issues/lwg-closed.html#2036 + // https://lwg.github.io/issues/lwg-closed.html#2036 // and a StackOverflow related question: - // http://stackoverflow.com/a/9020292/1728537 + // https://stackoverflow.com/a/9020292/1728537 // -- // Laurent Rineau, 2013/10/10 while (!is.eof()) { diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index b1b023a1058..c2689f3ee45 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -10,12 +10,13 @@ // // Author(s) : Marc Glisse +#ifndef CGAL_MPZF_H +#define CGAL_MPZF_H + #ifndef CGAL_NO_MPZF_DIVISION_OPERATOR #define CGAL_MPZF_DIVISION_OPERATOR 1 #endif -#ifndef CGAL_MPZF_H -#define CGAL_MPZF_H #include #include #include diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index 6972c6f29d1..b8263c891f6 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -55,12 +55,11 @@ namespace CGAL { namespace internal { template < typename > struct Exact_field_selector -#if ( (defined(CGAL_TEST_SUITE) && CGAL_VERSION_NR == 1050500900) || defined(CGAL_FORCE_USE_BOOST_MP))\ - && BOOST_VERSION > 107800 && defined(CGAL_USE_BOOST_MP) -// use boost-mp by default in the testsuite until 5.5-beta is out +#if BOOST_VERSION > 107900 && defined(CGAL_USE_BOOST_MP) +// use boost-mp by default // Boost { typedef BOOST_cpp_arithmetic_kernel::Rational Type; }; -#else // BOOST_VERSION > 107800 +#else // BOOST_VERSION > 107900 #ifdef CGAL_USE_GMPXX { typedef mpq_class Type; }; #elif defined(CGAL_USE_GMP) @@ -86,7 +85,7 @@ struct Exact_field_selector #else { typedef Quotient Type; }; #endif -#endif // BOOST_VERSION > 107800 +#endif // BOOST_VERSION > 107900 // By default, a field is a safe choice of ring. template < typename T > diff --git a/Number_types/test/Number_types/to_interval_test_boost.cpp b/Number_types/test/Number_types/to_interval_test_boost.cpp index 3c8355b6868..3db8882a54d 100644 --- a/Number_types/test/Number_types/to_interval_test_boost.cpp +++ b/Number_types/test/Number_types/to_interval_test_boost.cpp @@ -213,7 +213,7 @@ void test_to_interval_tight_rational_1() { std::cout << "ref: inf" << std::endl; std::cout << std::endl; - assert(i == std::numeric_limits::max()); + assert(i == (std::numeric_limits::max)()); assert(s == std::numeric_limits::infinity()); #endif @@ -236,8 +236,8 @@ void test_to_interval_tight_rational_1() { std::cout << "ref: 0.0 or higher" << std::endl; std::cout << std::endl; - assert(i >= 0.0 && i <= std::numeric_limits::min() * 2.0); - assert(s >= 0.0 && s <= std::numeric_limits::min() * 2.0); + assert(i >= 0.0 && i <= (std::numeric_limits::min)() * 2.0); + assert(s >= 0.0 && s <= (std::numeric_limits::min)() * 2.0); assert(i <= s); #endif @@ -518,7 +518,7 @@ void test_to_interval_tight_rational_2() { std::cout << "ref: inf" << std::endl; std::cout << std::endl; - assert(i == std::numeric_limits::max()); + assert(i == (std::numeric_limits::max)()); assert(s == std::numeric_limits::infinity()); #endif @@ -540,8 +540,8 @@ void test_to_interval_tight_rational_2() { std::cout << "ref: 0.0 or higher" << std::endl; std::cout << std::endl; - assert(i >= 0.0 && i <= std::numeric_limits::min() * 2.0); - assert(s >= 0.0 && s <= std::numeric_limits::min() * 2.0); + assert(i >= 0.0 && i <= (std::numeric_limits::min)() * 2.0); + assert(s >= 0.0 && s <= (std::numeric_limits::min)() * 2.0); assert(i <= s); #endif @@ -785,7 +785,7 @@ void test_to_interval_tight_integer() { std::cout << "ref: inf" << std::endl; std::cout << std::endl; - assert(i == std::numeric_limits::max()); + assert(i == (std::numeric_limits::max)()); assert(s == std::numeric_limits::infinity()); #endif diff --git a/OpenNL/include/CGAL/OpenNL/bicgstab.h b/OpenNL/include/CGAL/OpenNL/bicgstab.h index dd8ea48a3ca..a9cef2c92e8 100644 --- a/OpenNL/include/CGAL/OpenNL/bicgstab.h +++ b/OpenNL/include/CGAL/OpenNL/bicgstab.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 2005-2008: Changes for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/blas.h b/OpenNL/include/CGAL/OpenNL/blas.h index 52c4810e2c8..8cea9da67ad 100644 --- a/OpenNL/include/CGAL/OpenNL/blas.h +++ b/OpenNL/include/CGAL/OpenNL/blas.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 01/2005: Change for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h b/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h index c575aa6f0c8..6f2e6f5b2e8 100644 --- a/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h +++ b/OpenNL/include/CGAL/OpenNL/conjugate_gradient.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 2005-2006: Changes for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/full_vector.h b/OpenNL/include/CGAL/OpenNL/full_vector.h index b0857dfa851..0459808b638 100644 --- a/OpenNL/include/CGAL/OpenNL/full_vector.h +++ b/OpenNL/include/CGAL/OpenNL/full_vector.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 01/2005: Change for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/linear_solver.h b/OpenNL/include/CGAL/OpenNL/linear_solver.h index 33dccdcc6cb..d4e928eec9a 100644 --- a/OpenNL/include/CGAL/OpenNL/linear_solver.h +++ b/OpenNL/include/CGAL/OpenNL/linear_solver.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 2005-2006: Changes for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/preconditioner.h b/OpenNL/include/CGAL/OpenNL/preconditioner.h index 2d7728a94ca..808b6f39eb1 100644 --- a/OpenNL/include/CGAL/OpenNL/preconditioner.h +++ b/OpenNL/include/CGAL/OpenNL/preconditioner.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 2006: Changes for CGAL: diff --git a/OpenNL/include/CGAL/OpenNL/sparse_matrix.h b/OpenNL/include/CGAL/OpenNL/sparse_matrix.h index 2d5b3812e30..4e4c01f46d4 100644 --- a/OpenNL/include/CGAL/OpenNL/sparse_matrix.h +++ b/OpenNL/include/CGAL/OpenNL/sparse_matrix.h @@ -1,7 +1,7 @@ // Copyright (c) 2005-2008 Inria Loria (France). /* * author: Bruno Levy, INRIA, project ALICE - * website: http://www.loria.fr/~levy/software + * website: https://www.loria.fr/~levy/software * * This file is part of CGAL (www.cgal.org) * @@ -13,7 +13,7 @@ * TITLE = Numerical Methods for Digital Geometry Processing, * BOOKTITLE =Israel Korea Bi-National Conference, * YEAR=November 2005, - * URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics + * URL=https://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics * } * * Laurent Saboret 01/2005: Change for CGAL: diff --git a/OpenNL/package_info/OpenNL/long_description.txt b/OpenNL/package_info/OpenNL/long_description.txt index 8c0cd24b1f9..645de7254ee 100644 --- a/OpenNL/package_info/OpenNL/long_description.txt +++ b/OpenNL/package_info/OpenNL/long_description.txt @@ -15,7 +15,7 @@ Contact ======= The author is Bruno Levy . -OpenNL main page is http://www.loria.fr/~levy/software/. +OpenNL main page is https://www.loria.fr/~levy/software/. Caution ======= diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h index 649dd8e3020..037df452478 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/oriented_bounding_box.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -333,14 +334,14 @@ void oriented_bounding_box(const PointRange& points, typedef typename CGAL::Kernel_traits::type K; typedef Oriented_bounding_box_traits_3 Default_traits; #else - typedef void Default_traits; + typedef CGAL::Default Default_traits; #endif typedef typename internal_np::Lookup_named_param_def::type Geom_traits; - CGAL_static_assertion_msg(!(std::is_same::value), + CGAL_static_assertion_msg(!(std::is_same::value), "You must provide a traits class or have Eigen enabled!"); Geom_traits traits = choose_parameter(get_parameter(np, internal_np::geom_traits)); diff --git a/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies b/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies index 34ad48e6a80..249760e2928 100644 --- a/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies +++ b/Optimal_bounding_box/package_info/Optimal_bounding_box/dependencies @@ -18,7 +18,6 @@ Kernel_23 Modular_arithmetic Number_types Optimal_bounding_box -Optimisation_basic Polygon Profiling_tools Property_map diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp index 46837ca5b03..54065018429 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/render.cpp @@ -335,14 +335,13 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb) MultiIndex mindex; FT min_value = (std::numeric_limits::max)(); FT max_value = -(std::numeric_limits::max)(); - unsigned int nb_initial = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_edge_relevance(edge); // >= 0 - nb_initial++; min_value = (std::min)(min_value, value); max_value = (std::max)(max_value, value); mindex.insert(PEdge(edge, value)); diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h index e590f0f0489..c7f14a626da 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h @@ -440,11 +440,9 @@ public: } CGAL_assertion(vertex_count == 18); - int edge_count = 0; for (std::vector::iterator it = edges.begin(); it != edges.end(); it++) { std::cout << *it << std::endl; - edge_count++; } } diff --git a/Optimisation_basic/include/CGAL/Optimisation/assertions.h b/Optimisation_basic/include/CGAL/Optimisation/assertions.h deleted file mode 100644 index 7186d883d15..00000000000 --- a/Optimisation_basic/include/CGAL/Optimisation/assertions.h +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) 1997-2001 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr - -#ifndef CGAL_OPTIMISATION_ASSERTIONS_H -#define CGAL_OPTIMISATION_ASSERTIONS_H - -#include - -// macro definitions -// ================= - -// assertions -// ---------- -#if ( defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_assertion(EX) ((void)0) -# define CGAL_optimisation_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_assertion_code(CODE) -# undef CGAL_OPTIMISATION_ASSERTION_TAG -#else -# define CGAL_optimisation_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_ASSERTION_TAG 1 -#endif // optimisation assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_assertion(EX) ((void)0) -# define CGAL_optimisation_exactness_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG -#else -# define CGAL_optimisation_exactness_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG 1 -#endif // optimisation exactness assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_assertion(EX) ((void)0) -# define CGAL_optimisation_expensive_assertion_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG -#else -# define CGAL_optimisation_expensive_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG 1 -#endif // optimisation expensive assertions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ - || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_assertion(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_assertion_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG -#else -# define CGAL_optimisation_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG 1 -#endif // optimisation expensive exactness assertions - - - -// preconditions -// ------------- -#if ( defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_precondition(EX) ((void)0) -# define CGAL_optimisation_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_precondition_code(CODE) -# undef CGAL_OPTIMISATION_PRECONDITION_TAG -#else -# define CGAL_optimisation_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_PRECONDITION_TAG 1 -#endif // optimisation preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_precondition(EX) ((void)0) -# define CGAL_optimisation_exactness_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG -#else -# define CGAL_optimisation_exactness_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG 1 -#endif // optimisation exactness preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_precondition(EX) ((void)0) -# define CGAL_optimisation_expensive_precondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG -#else -# define CGAL_optimisation_expensive_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG 1 -#endif // optimisation expensive preconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ - || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_precondition(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_precondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG -#else -# define CGAL_optimisation_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG 1 -#endif // optimisation expensive exactness preconditions - - - -// postconditions -// -------------- -#if ( defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_postcondition(EX) ((void)0) -# define CGAL_optimisation_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_POSTCONDITION_TAG -#else -# define CGAL_optimisation_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_POSTCONDITION_TAG 1 -#endif // optimisation postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_postcondition(EX) ((void)0) -# define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG -#else -# define CGAL_optimisation_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG 1 -#endif // optimisation exactness postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_postcondition(EX) ((void)0) -# define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG -#else -# define CGAL_optimisation_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG 1 -#endif // optimisation expensive postconditions - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ - || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_postcondition(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG -#else -# define CGAL_optimisation_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG 1 -#endif // optimisation expensive exactness postconditions - - - -// warnings -// -------- -#if ( defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_warning(EX) ((void)0) -# define CGAL_optimisation_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_warning_code(CODE) -# undef CGAL_OPTIMISATION_WARNING_TAG -#else -# define CGAL_optimisation_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_WARNING_TAG 1 -#endif // optimisation warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXACTNESS) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_exactness_warning(EX) ((void)0) -# define CGAL_optimisation_exactness_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_exactness_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG -#else -# define CGAL_optimisation_exactness_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_exactness_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG 1 -#endif // optimisation exactness warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_warning(EX) ((void)0) -# define CGAL_optimisation_expensive_warning_msg(EX,MSG) ((void)0) -# define CGAL_optimisation_expensive_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG -#else -# define CGAL_optimisation_expensive_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG 1 -#endif // optimisation expensive warnings - -#if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ - || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ - || defined( CGAL_CHECK_EXACTNESS) \ - || defined( CGAL_CHECK_EXPENSIVE) ) \ - || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ - || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) -# define CGAL_optimisation_expensive_exactness_warning(EX) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ - ((void)0) -# define CGAL_optimisation_expensive_exactness_warning_code(CODE) -# undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG -#else -# define CGAL_optimisation_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) -# define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) -# define CGAL_optimisation_expensive_exactness_warning_code(CODE) CODE -# define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG 1 -#endif // optimisation expensive exactness warnings - - - -#endif // CGAL_OPTIMISATION_ASSERTIONS_H - -// ===== EOF ================================================================== diff --git a/Optimisation_basic/include/CGAL/Optimisation/basic.h b/Optimisation_basic/include/CGAL/Optimisation/basic.h index 6e8dd5f511c..900b0cac964 100644 --- a/Optimisation_basic/include/CGAL/Optimisation/basic.h +++ b/Optimisation_basic/include/CGAL/Optimisation/basic.h @@ -19,7 +19,6 @@ // includes #include -#include #include #include diff --git a/Optimisation_basic/package_info/Optimisation_basic/dependencies b/Optimisation_basic/package_info/Optimisation_basic/dependencies index 4b1b3cb93f3..e69de29bb2d 100644 --- a/Optimisation_basic/package_info/Optimisation_basic/dependencies +++ b/Optimisation_basic/package_info/Optimisation_basic/dependencies @@ -1,4 +0,0 @@ -Installation -Kernel_23 -Profiling_tools -STL_Extension diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index b2931f84429..bb1dd8a2354 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -320,8 +320,21 @@ public: void refine(const Split_predicate& split_predicate) { // If the tree has already been refined, reset it - if (!m_root.is_leaf()) + if (!m_root.is_leaf()){ + std::queue nodes; + for (std::size_t i = 0; i < Degree::value; ++ i) + nodes.push (m_root[i]); + while (!nodes.empty()) + { + Node node = nodes.front(); + nodes.pop(); + if (!node.is_leaf()) + for (std::size_t i = 0; i < Degree::value; ++ i) + nodes.push (node[i]); + node.free(); + } m_root.unsplit(); + } // Reset the side length map, too m_side_per_depth.resize(1); diff --git a/Orthtree/include/CGAL/Orthtree/Node.h b/Orthtree/include/CGAL/Orthtree/Node.h index cfa49fb5366..a16d2fff192 100644 --- a/Orthtree/include/CGAL/Orthtree/Node.h +++ b/Orthtree/include/CGAL/Orthtree/Node.h @@ -365,7 +365,7 @@ public: } /*! - \brief returns the nth child fo this node. + \brief returns the nth child of this node. \pre `!is_null()` \pre `!is_leaf()` diff --git a/Partition_2/doc/Partition_2/PackageDescription.txt b/Partition_2/doc/Partition_2/PackageDescription.txt index ee33bf48c0a..4d5b6ba9c91 100644 --- a/Partition_2/doc/Partition_2/PackageDescription.txt +++ b/Partition_2/doc/Partition_2/PackageDescription.txt @@ -53,8 +53,6 @@ primitive types and predicates used by the algorithms. \cgalCRPSection{Assertions} -The assertion flags for this package use `PARTITION` in their names -(e.g., `CGAL_PARTITION_NO_POSTCONDITIONS`). The precondition checks for the planar polygon partitioning functions are: counterclockwise ordering of the input vertices and simplicity of the polygon these vertices represent. @@ -99,4 +97,3 @@ original polygon). - `CGAL::y_monotone_partition_is_valid_2()` */ - diff --git a/Partition_2/include/CGAL/Partition_2/Rotation_tree_2.h b/Partition_2/include/CGAL/Partition_2/Rotation_tree_2.h index fa78978a4dd..8887bc4164b 100644 --- a/Partition_2/include/CGAL/Partition_2/Rotation_tree_2.h +++ b/Partition_2/include/CGAL/Partition_2/Rotation_tree_2.h @@ -47,7 +47,8 @@ public: typedef typename Traits::Point_2 Point_2; using internal::vector< Rotation_tree_node_2 >::push_back; - using internal::vector< Rotation_tree_node_2 >::back; + using internal::vector< Rotation_tree_node_2 >::back; + using internal::vector< Rotation_tree_node_2 >::erase; class Greater { typename Traits::Less_xy_2 less; @@ -78,7 +79,7 @@ public: Greater greater (traits.less_xy_2_object()); Equal equal; std::sort(this->begin(), this->end(), greater); - std::unique(this->begin(), this->end(),equal); + this->erase(std::unique(this->begin(), this->end(),equal), this->end()); // front() is the point with the largest x coordinate diff --git a/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h index 076e78cee57..88d756d243a 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_approx_convex_2.h @@ -29,7 +29,7 @@ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") #include #include #include -#include +#include #include #include #include @@ -138,7 +138,7 @@ OutputIterator partition_approx_convex_2(InputIterator first, P_Polygon_2 polygon(first, beyond,traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); Circulator first_c(polygon.begin(), polygon.end(), polygon.begin()); @@ -238,7 +238,7 @@ OutputIterator partition_approx_convex_2(InputIterator first, #endif // no postconditions polygon.partition(res, 0); - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits)); diff --git a/Partition_2/include/CGAL/Partition_2/partition_assertions.h b/Partition_2/include/CGAL/Partition_2/partition_assertions.h deleted file mode 100644 index 6d0f0288b3e..00000000000 --- a/Partition_2/include/CGAL/Partition_2/partition_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1997 Max-Planck-Institute Saarbruecken (Germany). -// 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) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_partition_assertion -#undef CGAL_partition_assertion_msg -#undef CGAL_partition_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_partition_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_partition_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_assertion_code(CODE) -#else -# define CGAL_partition_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_assertion_code(CODE) CODE -# define CGAL_partition_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_exactness_assertion -#undef CGAL_partition_exactness_assertion_msg -#undef CGAL_partition_exactness_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_assertion(EX) (static_cast(0)) -# define CGAL_partition_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_assertion_code(CODE) -#else -# define CGAL_partition_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_assertion_code(CODE) CODE -# define CGAL_partition_exactness_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_expensive_assertion -#undef CGAL_partition_expensive_assertion_msg -#undef CGAL_partition_expensive_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_assertion(EX) (static_cast(0)) -# define CGAL_partition_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_assertion_code(CODE) -#else -# define CGAL_partition_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_assertion_code(CODE) CODE -# define CGAL_partition_expensive_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -#undef CGAL_partition_expensive_exactness_assertion -#undef CGAL_partition_expensive_exactness_assertion_msg -#undef CGAL_partition_expensive_exactness_assertion_code - -#if defined(CGAL_PARTITION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_partition_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_partition_expensive_exactness_assertions 1 -#endif // CGAL_PARTITION_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_partition_precondition -#undef CGAL_partition_precondition_msg -#undef CGAL_partition_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_partition_precondition(EX) (static_cast(0)) -# define CGAL_partition_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_precondition_code(CODE) -#else -# define CGAL_partition_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_precondition_code(CODE) CODE -# define CGAL_partition_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_exactness_precondition -#undef CGAL_partition_exactness_precondition_msg -#undef CGAL_partition_exactness_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_precondition(EX) (static_cast(0)) -# define CGAL_partition_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_precondition_code(CODE) -#else -# define CGAL_partition_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_precondition_code(CODE) CODE -# define CGAL_partition_exactness_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_expensive_precondition -#undef CGAL_partition_expensive_precondition_msg -#undef CGAL_partition_expensive_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_precondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_precondition_code(CODE) -#else -# define CGAL_partition_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_precondition_code(CODE) CODE -# define CGAL_partition_expensive_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -#undef CGAL_partition_expensive_exactness_precondition -#undef CGAL_partition_expensive_exactness_precondition_msg -#undef CGAL_partition_expensive_exactness_precondition_code - -#if defined(CGAL_PARTITION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_partition_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_partition_expensive_exactness_preconditions 1 -#endif // CGAL_PARTITION_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_partition_postcondition -#undef CGAL_partition_postcondition_msg -#undef CGAL_partition_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_partition_postcondition(EX) (static_cast(0)) -# define CGAL_partition_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_postcondition_code(CODE) -#else -# define CGAL_partition_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_postcondition_code(CODE) CODE -# define CGAL_partition_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_exactness_postcondition -#undef CGAL_partition_exactness_postcondition_msg -#undef CGAL_partition_exactness_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_partition_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_postcondition_code(CODE) -#else -# define CGAL_partition_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_postcondition_code(CODE) CODE -# define CGAL_partition_exactness_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_expensive_postcondition -#undef CGAL_partition_expensive_postcondition_msg -#undef CGAL_partition_expensive_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_postcondition_code(CODE) -#else -# define CGAL_partition_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_postcondition_code(CODE) CODE -# define CGAL_partition_expensive_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -#undef CGAL_partition_expensive_exactness_postcondition -#undef CGAL_partition_expensive_exactness_postcondition_msg -#undef CGAL_partition_expensive_exactness_postcondition_code - -#if defined(CGAL_PARTITION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_partition_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_partition_expensive_exactness_postconditions 1 -#endif // CGAL_PARTITION_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_partition_warning -#undef CGAL_partition_warning_msg -#undef CGAL_partition_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_partition_warning(EX) (static_cast(0)) -# define CGAL_partition_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_warning_code(CODE) -#else -# define CGAL_partition_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_warning_code(CODE) CODE -# define CGAL_partition_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_exactness_warning -#undef CGAL_partition_exactness_warning_msg -#undef CGAL_partition_exactness_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_partition_exactness_warning(EX) (static_cast(0)) -# define CGAL_partition_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_exactness_warning_code(CODE) -#else -# define CGAL_partition_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_exactness_warning_code(CODE) CODE -# define CGAL_partition_exactness_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_expensive_warning -#undef CGAL_partition_expensive_warning_msg -#undef CGAL_partition_expensive_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_warning(EX) (static_cast(0)) -# define CGAL_partition_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_warning_code(CODE) -#else -# define CGAL_partition_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_warning_code(CODE) CODE -# define CGAL_partition_expensive_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS - - -#undef CGAL_partition_expensive_exactness_warning -#undef CGAL_partition_expensive_exactness_warning_msg -#undef CGAL_partition_expensive_exactness_warning_code - -#if defined(CGAL_PARTITION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_PARTITION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_PARTITION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_partition_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_partition_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_partition_expensive_exactness_warning_code(CODE) -#else -# define CGAL_partition_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_partition_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_partition_expensive_exactness_warning_code(CODE) CODE -# define CGAL_partition_expensive_exactness_warnings 1 -#endif // CGAL_PARTITION_NO_WARNINGS diff --git a/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h index 8f3d54ce5dd..194e777a188 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_greene_approx_convex_2.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,7 +90,7 @@ void erase_vertices(BidirectionalCirculator first, #endif it = first.current_iterator(); - CGAL_partition_assertion (it != polygon.end()); + CGAL_assertion (it != polygon.end()); while ( (it != polygon.end()) && (*it != *last) ) { @@ -692,9 +692,9 @@ void ga_convex_decomposition(ForwardIterator first, ForwardIterator beyond, Vertex_list polygon(first, beyond); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); - CGAL_partition_precondition( + CGAL_precondition( is_y_monotone_2(polygon.begin(), polygon.end(), traits)); Vertex_circulator point_ref(&polygon); @@ -806,7 +806,7 @@ OutputIterator partition_greene_approx_convex_2(InputIterator first, #endif // no postconditions Polygon_2 polygon(first, beyond); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.vertices_begin(), polygon.vertices_end(), traits) == COUNTERCLOCKWISE); @@ -822,7 +822,7 @@ OutputIterator partition_greene_approx_convex_2(InputIterator first, (*MP_it).vertices_end(), res, traits); } - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.vertices_begin(), polygon.vertices_end(), res.output_so_far_begin(), diff --git a/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h b/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h index 0b87e73eb84..f5f500720a4 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_optimal_convex_2.h @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include #include @@ -520,7 +520,7 @@ OutputIterator partition_optimal_convex_2(InputIterator first, #endif // no postconditions P_Polygon_2 polygon(first, beyond,traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); #ifdef CGAL_PARTITION_OPTIMAL_CONVEX_DEBUG @@ -559,7 +559,7 @@ OutputIterator partition_optimal_convex_2(InputIterator first, // be pruned away. These crop up when there are collinear vertices. // See explanation at top of file. polygon.partition(res, 1); - CGAL_partition_postcondition( + CGAL_postcondition( convex_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits) diff --git a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h index a4918e5548f..d74bc9b9db8 100644 --- a/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h +++ b/Partition_2/include/CGAL/Partition_2/partition_y_monotone_2.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -426,7 +426,7 @@ OutputIterator partition_y_monotone_2(InputIterator first, #endif // no postcondition P_Polygon_2 polygon(first, beyond, traits); - CGAL_partition_precondition( + CGAL_precondition( orientation_2(polygon.begin(), polygon.end(), traits) == COUNTERCLOCKWISE); Circulator circ(polygon.begin(), polygon.end()), done = circ; @@ -484,7 +484,7 @@ OutputIterator partition_y_monotone_2(InputIterator first, #endif polygon.partition(res, 0); - CGAL_partition_postcondition( + CGAL_postcondition( y_monotone_partition_is_valid_2(polygon.begin(), polygon.end(), res.output_so_far_begin(), res.output_so_far_end(), traits)); diff --git a/Partition_2/include/CGAL/partition_is_valid_2.h b/Partition_2/include/CGAL/partition_is_valid_2.h index 71ddd0d66e3..f6a5f2bbd7f 100644 --- a/Partition_2/include/CGAL/partition_is_valid_2.h +++ b/Partition_2/include/CGAL/partition_is_valid_2.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -147,8 +147,8 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, for (;point_first != point_last; point_first++) orig_poly.push_back(*point_first); - CGAL_partition_precondition(orientation_2(orig_poly.begin(),orig_poly.end(), - traits) == COUNTERCLOCKWISE); + CGAL_precondition(orientation_2(orig_poly.begin(),orig_poly.end(), + traits) == COUNTERCLOCKWISE); P_Vertex_map output_vertex_set(poly_first, poly_last, traits); @@ -163,7 +163,7 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, std::cout << "Polygon " << poly_num << " is " << std::endl; std::cout << *poly_first << std::endl; #endif - CGAL_partition_assertion ( + CGAL_assertion ( orientation_2(vtx_begin, vtx_end, traits) == COUNTERCLOCKWISE); if (!is_valid(vtx_begin, vtx_end)) { diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h index 96f3a02a816..af9757a095f 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/CGAL/Periodic_2_triangulation_2.h @@ -100,7 +100,7 @@ public: UNIQUE_COVER_DOMAIN }; -/// The enum `@` is defined by `Periodic_2_triangulation_2` to +/// The enum `Locate_type` is defined by `Periodic_2_triangulation_2` to /// specify which case occurs when locating a point in the /// triangulation. If the triangulation does not contain any points /// `EMPTY` is returned. diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h index 71c327057ae..03537714d2a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h @@ -131,7 +131,7 @@ public: Periodic_2_Delaunay_triangulation_2(const Periodic_2_Delaunay_triangulation_2 &tr) : Base(tr) { - CGAL_triangulation_postcondition( is_valid(true) ); + CGAL_postcondition( is_valid(true) ); } /// Constructor with insertion of points @@ -467,7 +467,7 @@ public: OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition( dimension() == 2); + CGAL_precondition( dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p, lt, li, start); @@ -487,7 +487,7 @@ public: pit = propagate_conflicts(p, fh, 2, pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit, eit); } @@ -836,7 +836,7 @@ is_valid(bool verbose, int level) const side_of_oriented_circle(*p[0], *p[1], *p[2], *p[3], off[0], off[1], off[2], off[3], false); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } } @@ -866,7 +866,7 @@ typename Periodic_2_Delaunay_triangulation_2::Vertex_handle Periodic_2_Delaunay_triangulation_2:: nearest_vertex_2D(const Point& p, Face_handle f) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); f = locate(p, f); typename Geom_traits::Compare_distance_2 compare_distance = @@ -914,7 +914,7 @@ typename Periodic_2_Delaunay_triangulation_2::Point Periodic_2_Delaunay_triangulation_2:: dual (Face_handle f) const { - CGAL_triangulation_precondition (dimension() == 2); + CGAL_precondition (dimension() == 2); return circumcenter(f); } @@ -958,9 +958,9 @@ typename Periodic_2_Delaunay_triangulation_2::Vertex_handle Periodic_2_Delaunay_triangulation_2:: insert(const Point &p, Face_handle start) { - CGAL_triangulation_assertion((domain().xmin() <= p.x()) && + CGAL_assertion((domain().xmin() <= p.x()) && (p.x() < domain().xmax())); - CGAL_triangulation_assertion((domain().ymin() <= p.y()) && + CGAL_assertion((domain().ymin() <= p.y()) && (p.y() < domain().ymax())); if (empty()) @@ -1006,7 +1006,7 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) { typename Base::Virtual_vertex_reverse_map_it vertices_it = this->virtual_vertices_reverse().find(vh); - CGAL_triangulation_assertion(vertices_it != this->virtual_vertices_reverse().end()); + CGAL_assertion(vertices_it != this->virtual_vertices_reverse().end()); const std::vector &virtual_vertices = vertices_it->second; for (size_t i = 0; i < virtual_vertices.size(); ++i) { @@ -1016,7 +1016,7 @@ insert(const Point &p, Locate_type lt, Face_handle loc, int li) this->try_to_convert_to_one_cover(); if (is_1_cover()) { - CGAL_triangulation_assertion(is_valid()); + CGAL_assertion(is_valid()); } } } @@ -1167,8 +1167,8 @@ remove(Vertex_handle v) // Make sure we have the original vertex CGAL_assertion(v == this->get_original_vertex(v)); - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(dimension() == 2); if ( this->number_of_vertices() == 1) { @@ -5070,7 +5070,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, if (points[i] == &p0 && (o = orientation(p, p1, p2)) != COLLINEAR) return Oriented_side(o); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -5114,7 +5114,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, != COLLINEAR)) return Oriented_side(orient); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h index 574fd1d31ec..1692ae346ec 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include namespace CGAL @@ -71,14 +71,14 @@ public: int &operator[](int i) { if (i == 0) return _offx; - CGAL_triangulation_assertion(i == 1); + CGAL_assertion(i == 1); return _offy; } /// Return the i-th entry of o. int operator[](int i) const { if (i == 0) return _offx; - CGAL_triangulation_assertion(i == 1); + CGAL_assertion(i == 1); return _offy; } /// Add o' to o using vector addition. diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h index 4104f5d9923..a4ca4e36a30 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -418,8 +418,8 @@ public: /// \pre i == {0,1,2} Periodic_segment periodic_segment(Face_handle f, int i) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 2); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 2); return make_array(periodic_point(f, ccw(i)), periodic_point(f, cw(i))); } @@ -941,9 +941,9 @@ public: Offset get_neighbor_offset(Face_handle fh, int i, Face_handle nb, int j) const { // Redundance in the signature - CGAL_triangulation_precondition(fh->neighbor(i) == nb); - CGAL_triangulation_precondition(nb->neighbor(j) == fh); - CGAL_triangulation_precondition(fh->vertex(cw(i)) == nb->vertex(ccw(j))); + CGAL_precondition(fh->neighbor(i) == nb); + CGAL_precondition(nb->neighbor(j) == fh); + CGAL_precondition(fh->vertex(cw(i)) == nb->vertex(ccw(j))); return int_to_off(nb->offset(ccw(j))) - int_to_off(fh->offset(cw(i))); } @@ -975,8 +975,8 @@ public: /// Converts an offset to a bit pattern where bit1==offx and bit0==offy. int off_to_int(const Offset & off) const { - CGAL_triangulation_assertion( off.x() == 0 || off.x() == 1 ); - CGAL_triangulation_assertion( off.y() == 0 || off.y() == 1 ); + CGAL_assertion( off.x() == 0 || off.x() == 1 ); + CGAL_assertion( off.y() == 0 || off.y() == 1 ); int i = ((off.x() & 1) << 1) + (off.y() & 1); return i; } @@ -1018,9 +1018,9 @@ public: const std::vector& periodic_copies(const Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_sheets() != make_array(1, 1) ); - CGAL_triangulation_precondition(_virtual_vertices.find(v) == _virtual_vertices.end()); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(v) != _virtual_vertices_reverse.end()); + CGAL_precondition(number_of_sheets() != make_array(1, 1) ); + CGAL_precondition(_virtual_vertices.find(v) == _virtual_vertices.end()); + CGAL_assertion(_virtual_vertices_reverse.find(v) != _virtual_vertices_reverse.end()); return _virtual_vertices_reverse.find(v)->second; } @@ -1044,9 +1044,9 @@ protected: // than sqrt(0.166) is fulfilled. if (_too_long_edge_counter == 0 && !is_1_cover()) { - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); this->convert_to_1_sheeted_covering(); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); } } @@ -1218,7 +1218,7 @@ protected: /// Returns the offset such that (p, o) lies on the bounded side of the face f. Offset get_location_offset(Face_handle f, const Point &p, const Offset &o) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); if (is_1_cover() && f->has_zero_offsets()) { @@ -1296,14 +1296,14 @@ protected: } } - CGAL_triangulation_assertion((std::min)((std::min)(off0[0], off1[0]), off2[0]) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[1], off1[1]), off2[1]) == 0); - CGAL_triangulation_assertion((0 <= off0[0]) && (off0[0] < 2)); - CGAL_triangulation_assertion((0 <= off1[0]) && (off1[0] < 2)); - CGAL_triangulation_assertion((0 <= off2[0]) && (off2[0] < 2)); - CGAL_triangulation_assertion((0 <= off0[1]) && (off0[1] < 2)); - CGAL_triangulation_assertion((0 <= off1[1]) && (off1[1] < 2)); - CGAL_triangulation_assertion((0 <= off2[1]) && (off2[1] < 2)); + CGAL_assertion((std::min)((std::min)(off0[0], off1[0]), off2[0]) == 0); + CGAL_assertion((std::min)((std::min)(off0[1], off1[1]), off2[1]) == 0); + CGAL_assertion((0 <= off0[0]) && (off0[0] < 2)); + CGAL_assertion((0 <= off1[0]) && (off1[0] < 2)); + CGAL_assertion((0 <= off2[0]) && (off2[0] < 2)); + CGAL_assertion((0 <= off0[1]) && (off0[1] < 2)); + CGAL_assertion((0 <= off1[1]) && (off1[1] < 2)); + CGAL_assertion((0 <= off2[1]) && (off2[1] < 2)); int o0i = ((off0[0] & 1) << 1) + (off0[1] & 1); int o1i = ((off1[0] & 1) << 1) + (off1[1] & 1); @@ -1326,11 +1326,11 @@ protected: } bool has_self_edges(Face_handle fh) const { - CGAL_triangulation_assertion((fh->vertex(0) != fh->vertex(1)) || - (fh->offset(0) != fh->offset(1))); - CGAL_triangulation_assertion((fh->vertex(0) != fh->vertex(2)) || - (fh->offset(0) != fh->offset(2))); - CGAL_triangulation_assertion((fh->vertex(1) != fh->vertex(2)) || + CGAL_assertion((fh->vertex(0) != fh->vertex(1)) || + (fh->offset(0) != fh->offset(1))); + CGAL_assertion((fh->vertex(0) != fh->vertex(2)) || + (fh->offset(0) != fh->offset(2))); + CGAL_assertion((fh->vertex(1) != fh->vertex(2)) || (fh->offset(1) != fh->offset(2))); return ((fh->vertex(0) == fh->vertex(1)) || (fh->vertex(0) == fh->vertex(2)) || @@ -1408,7 +1408,7 @@ Periodic_2_triangulation_2::Periodic_2_triangulation_2( , _domain(domain) , _too_long_edge_counter(0) { - CGAL_triangulation_precondition(_domain.xmax() - _domain.xmin() == + CGAL_precondition(_domain.xmax() - _domain.xmin() == _domain.ymax() - _domain.ymin()); set_domain(_domain); } @@ -1470,7 +1470,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) vlist.push_back(vit); _virtual_vertices_reverse.insert( std::make_pair(vit, std::vector(8))); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(vit) + CGAL_assertion(_virtual_vertices_reverse.find(vit) ->second.size() == 8); } } @@ -1491,7 +1491,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) std::make_pair(*vlist_it, off))); _virtual_vertices_reverse.find(*vlist_it) ->second[3 * off[0] + off[1] - 1] = vit2; - CGAL_triangulation_assertion(get_offset(vit2) == off); + CGAL_assertion(get_offset(vit2) == off); } } // Cleanup vertex offsets @@ -1533,7 +1533,7 @@ copy_multiple_covering(const Periodic_2_triangulation_2 & tr) Vertex_handle v_no = eit->first->vertex(i); if (squared_distance(p1, p2) > _edge_length_threshold) { - CGAL_triangulation_assertion( + CGAL_assertion( find(_too_long_edges[v_no].begin(), _too_long_edges[v_no].end(), edge_to_add.second) == _too_long_edges[v_no].end()); @@ -1562,7 +1562,7 @@ void Periodic_2_triangulation_2::copy_triangulation( copy_multiple_covering(tr); } CGAL_assertion(_too_long_edge_counter == tr._too_long_edge_counter); - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } template @@ -1628,7 +1628,7 @@ bool Periodic_2_triangulation_2::is_valid(Face_handle fh, bool /*verbos std::cerr << "Offset: " << o << std::endl; } std::cerr << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } return result; @@ -1638,7 +1638,7 @@ template bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) const { bool result = _tds.is_valid(verbose, level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (dimension() == 2) { @@ -1667,36 +1667,36 @@ bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) cons } } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // Check for the right number of simplices int copies = number_of_sheets()[0] * number_of_sheets()[1]; result &= (number_of_stored_vertices() == copies * number_of_vertices()); result &= (number_of_stored_edges() == copies * number_of_edges()); result &= (number_of_stored_faces() == copies * number_of_faces()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // check number of euler characteristic. This cannot be done by the Tds // which does not know the genus result &= (number_of_stored_vertices() - number_of_stored_edges() + number_of_stored_faces() == 0); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result &= !has_self_edges(); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); // Edges should not be longer than 1 periodicity for (Face_iterator fit = faces_begin(); fit != faces_end(); ++fit) { result &= is_valid(fit, verbose, level); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result &= is_1_cover() == _virtual_vertices.empty(); result &= is_1_cover() == _virtual_vertices_reverse.empty(); result &= (_virtual_vertices.size() == (number_of_sheets()[0] * number_of_sheets()[1] - 1) * _virtual_vertices_reverse.size()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); for (Virtual_vertex_map_it it = _virtual_vertices.begin(); it != _virtual_vertices.end(); ++it) @@ -1722,7 +1722,7 @@ bool Periodic_2_triangulation_2::is_valid(bool verbose, int level) cons result &= false; } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); for (Virtual_vertex_reverse_map_it it = _virtual_vertices_reverse.begin(); it != _virtual_vertices_reverse.end(); ++it) @@ -1755,20 +1755,20 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, bool result = true; result &= is_1_cover() == _too_long_edges.empty(); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); size_t too_long_edges = 0; for (Too_long_edges_map_it it = _too_long_edges.begin(); it != _too_long_edges.end(); ++it) { too_long_edges += it->second.size(); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (_too_long_edge_counter != too_long_edges) { if (verbose) std::cout << "Too long edge counter is incorrect: " << _too_long_edge_counter << " != " << too_long_edges << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); /// Expensive check whether the right too long edges are in the list if (is_1_cover()) @@ -1781,7 +1781,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, Point p2 = construct_point(vh2->point(), get_offset(eit->first, cw(eit->second))); result &= (!edge_is_too_long(p1, p2)); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1797,7 +1797,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (&*vh2 < &*vh1) std::swap(vh1, vh2); - CGAL_triangulation_assertion(&*vh1 < &*vh2); + CGAL_assertion(&*vh1 < &*vh2); bool too_long = edge_is_too_long(p1, p2); if (too_long != edge_is_too_long(p2, p1)) @@ -1805,7 +1805,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "Long edge criterion not symmetric c(v1,v2) != c(v2,v1)" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); Too_long_edges_map_it it = _too_long_edges.find(vh1); if (it == _too_long_edges.end()) @@ -1816,7 +1816,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, result = false; } result &= !too_long; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1829,7 +1829,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "2. Too long edge not in the data structure" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } else { @@ -1838,7 +1838,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, if (verbose) std::cout << "Edge is not too long, but contained in the data structure" << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } } @@ -1849,7 +1849,7 @@ bool Periodic_2_triangulation_2::is_valid_too_long_edges(bool verbose, std::cout << "Counts do not match: " << _too_long_edge_counter << " != " << too_long_edges << std::endl; result = false; } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; @@ -1926,9 +1926,9 @@ void Periodic_2_triangulation_2::flip(Face_handle f, int i) vh2_offset = it_vh2->second.second; } - CGAL_triangulation_assertion( + CGAL_assertion( virtual_vertices_reverse().find(vh1) != virtual_vertices_reverse().end()); - CGAL_triangulation_assertion( + CGAL_assertion( virtual_vertices_reverse().find(vh2) != virtual_vertices_reverse().end()); const std::vector &v1s = virtual_vertices_reverse().find(vh1)->second; @@ -1972,11 +1972,11 @@ void Periodic_2_triangulation_2::flip(Face_handle f, int i) template void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) { - CGAL_triangulation_precondition(f != Face_handle()); - CGAL_triangulation_precondition(i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(f != Face_handle()); + CGAL_precondition(i == 0 || i == 1 || i == 2); + CGAL_precondition(dimension() == 2); - CGAL_triangulation_precondition(flippable(f, i)); + CGAL_precondition(flippable(f, i)); if (!is_1_cover()) remove_too_long_edge(f, i); @@ -2012,7 +2012,7 @@ void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) } else { - CGAL_triangulation_assertion(nb_offset.x() == -1); + CGAL_assertion(nb_offset.x() == -1); CGAL_assertion((offsets[3] & 2) == 0); offsets[3] |= 2; } @@ -2028,20 +2028,20 @@ void Periodic_2_triangulation_2::flip_single_edge(Face_handle f, int i) } else { - CGAL_triangulation_assertion(nb_offset.y() == -1); + CGAL_assertion(nb_offset.y() == -1); CGAL_assertion((offsets[3] & 1) == 0); offsets[3] |= 1; } } CGAL_assertion((offsets[0] & offsets[1] & offsets[2] & offsets[3]) == 0); - CGAL_triangulation_assertion_code(Vertex_handle vh = f->vertex(i)); - CGAL_triangulation_assertion_code(Vertex_handle vh_ccw = f->vertex(ccw(i))); + CGAL_assertion_code(Vertex_handle vh = f->vertex(i)); + CGAL_assertion_code(Vertex_handle vh_ccw = f->vertex(ccw(i))); _tds.flip(f, i); // Combinatorial checks - CGAL_triangulation_assertion(vh == f->vertex(i)); - CGAL_triangulation_assertion(vh_ccw == f->vertex(ccw(i))); - CGAL_triangulation_assertion(f->vertex(i) == nb->vertex(cw(nb_index))); - CGAL_triangulation_assertion(f->vertex(cw(i)) == nb->vertex(nb_index)); + CGAL_assertion(vh == f->vertex(i)); + CGAL_assertion(vh_ccw == f->vertex(ccw(i))); + CGAL_assertion(f->vertex(i) == nb->vertex(cw(nb_index))); + CGAL_assertion(f->vertex(cw(i)) == nb->vertex(nb_index)); // Restore the offsets int new_off[3]; @@ -2065,7 +2065,7 @@ void Periodic_2_triangulation_2::remove_from_virtual_copies(Vertex_handle v) { typename Virtual_vertex_reverse_map::iterator rev_it = _virtual_vertices_reverse.find(v); - CGAL_triangulation_assertion(rev_it != _virtual_vertices_reverse.end()); + CGAL_assertion(rev_it != _virtual_vertices_reverse.end()); const std::vector &virtual_copies = rev_it->second; for (size_t i = 0; i < virtual_copies.size(); ++i) @@ -2176,16 +2176,14 @@ Gt, Tds >::insert_first(const Point& p) _tds.set_dimension(2); // create the base for too_long_edges; - CGAL_triangulation_assertion(_too_long_edges.empty() ); - CGAL_triangulation_assertion(_too_long_edge_counter == 0); + CGAL_assertion(_too_long_edges.empty() ); + CGAL_assertion(_too_long_edge_counter == 0); // Insert all vertices as the first vertex in the _too_long_edges list - int k = 0; std::list empty_list; for (Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { _too_long_edges[vit] = empty_list; - k++; } // Insert all edges as all edges are too long @@ -2224,14 +2222,14 @@ Periodic_2_triangulation_2::insert_in_edge(const Point& p, const Offset // Insert in edge calls an insert_in_face and a flip. // Therefore there is no need to update the too_long_edges bookkeeping directly. - CGAL_triangulation_assertion(number_of_vertices() != 0); - CGAL_triangulation_assertion((!is_1_cover()) || (o == Offset())); + CGAL_assertion(number_of_vertices() != 0); + CGAL_assertion((!is_1_cover()) || (o == Offset())); // Backup of the neighbor and its relative offset Face_handle nb = f->neighbor(i); int j = nb->index(f); - CGAL_triangulation_assertion_code(Offset current_offset = get_location_offset(f, p, o)); - CGAL_triangulation_assertion + CGAL_assertion_code(Offset current_offset = get_location_offset(f, p, o)); + CGAL_assertion (orientation(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point(), get_offset(f, cw(i)), combine_offsets(o, current_offset), get_offset(f, ccw(i))) == COLLINEAR && collinear_between(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point(), @@ -2256,9 +2254,9 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle f, Vertex_handle vh) { - CGAL_triangulation_assertion(f != Face_handle()); - CGAL_triangulation_assertion(number_of_vertices() != 0); - CGAL_triangulation_assertion((!is_1_cover()) || (o == Offset())); + CGAL_assertion(f != Face_handle()); + CGAL_assertion(number_of_vertices() != 0); + CGAL_assertion((!is_1_cover()) || (o == Offset())); const bool simplicity_criterion = f->has_zero_offsets() && o.is_zero(); @@ -2269,21 +2267,21 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle nb[3]; int nb_index[3]; int offsets[3]; - CGAL_triangulation_assertion_code( Vertex_handle vertices[3]; ) + CGAL_assertion_code( Vertex_handle vertices[3]; ) if (!simplicity_criterion) { // Choose the periodic copy of tester.point() that is inside c. current_off = get_location_offset(f, p, o); - CGAL_triangulation_assertion(oriented_side(f, p, combine_offsets(o, current_off)) != ON_NEGATIVE_SIDE); + CGAL_assertion(oriented_side(f, p, combine_offsets(o, current_off)) != ON_NEGATIVE_SIDE); for (int i = 0; i < 3; ++i) { nb[i] = f->neighbor(i); nb_index[i] = nb[i]->index(f); offsets[i] = f->offset(i); - CGAL_triangulation_assertion_code( vertices[i] = f->vertex(i); ); + CGAL_assertion_code( vertices[i] = f->vertex(i); ); } } @@ -2301,8 +2299,8 @@ Periodic_2_triangulation_2::insert_in_face(const Point& p, const Offset Face_handle new_face = nb[i]->neighbor(nb_index[i]); int v_index = new_face->index(v); - CGAL_triangulation_assertion(new_face->vertex(ccw(v_index)) == vertices[ccw(i)]); - CGAL_triangulation_assertion(new_face->vertex(cw(v_index)) == vertices[cw(i)]); + CGAL_assertion(new_face->vertex(ccw(v_index)) == vertices[ccw(i)]); + CGAL_assertion(new_face->vertex(cw(v_index)) == vertices[cw(i)]); new_offsets[v_index] = v_offset; new_offsets[ccw(v_index)] = offsets[ccw(i)]; @@ -2330,9 +2328,9 @@ template typename Periodic_2_triangulation_2::Vertex_handle Periodic_2_triangulation_2::insert(const Point &p, Face_handle start) { - CGAL_triangulation_assertion((_domain.xmin() <= p.x()) && + CGAL_assertion((_domain.xmin() <= p.x()) && (p.x() < _domain.xmax())); - CGAL_triangulation_assertion((_domain.ymin() <= p.y()) && + CGAL_assertion((_domain.ymin() <= p.y()) && (p.y() < _domain.ymax())); if (number_of_stored_vertices() == 0) @@ -2383,9 +2381,9 @@ Periodic_2_triangulation_2::insert(const Point& p, } // vstart should be non-virtual, but should have virtual copies - CGAL_triangulation_assertion(_virtual_vertices.find(vstart) + CGAL_assertion(_virtual_vertices.find(vstart) == _virtual_vertices.end()); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(vstart) + CGAL_assertion(_virtual_vertices_reverse.find(vstart) != _virtual_vertices_reverse.end()); } @@ -2455,7 +2453,7 @@ Gt, Tds >::insert(const Point& p, const Offset &o, Locate_type lt, } default: { - CGAL_triangulation_assertion(false); // locate step failed + CGAL_assertion(false); // locate step failed return Vertex_handle(); } } @@ -2744,7 +2742,7 @@ bool Periodic_2_triangulation_2::compare_walks(const Point& p, std::cerr << std::endl; } - CGAL_triangulation_assertion(b); + CGAL_assertion(b); return b; } @@ -2959,9 +2957,9 @@ typename Periodic_2_triangulation_2::Face_handle Periodic_2_triangulati Gt, Tds >::locate(const Point& p, const Offset &o, Locate_type& lt, int& li, Face_handle start) const { - CGAL_triangulation_assertion((_domain.xmin() <= p.x()) && + CGAL_assertion((_domain.xmin() <= p.x()) && (p.x() < _domain.xmax())); - CGAL_triangulation_assertion((_domain.ymin() <= p.y()) && + CGAL_assertion((_domain.ymin() <= p.y()) && (p.y() < _domain.ymax())); if (dimension() <= 0) @@ -3000,7 +2998,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() { if (is_1_cover()) return; - CGAL_triangulation_expensive_assertion(is_triangulation_in_1_sheet()); + CGAL_expensive_assertion(is_triangulation_in_1_sheet()); bool to_delete, has_simplifiable_offset; Virtual_vertex_map_it vvmit; @@ -3087,16 +3085,16 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() // The vector from nb to the "original" periodic copy of nb, that is // the copy that will not be deleted. Offset difference_offset(x, y); - CGAL_triangulation_assertion( !difference_offset.is_null() ); + CGAL_assertion( !difference_offset.is_null() ); // We now have to find the "original" periodic copy of nb from // its vertices. Therefore, we first have to find the vertices. for (int j = 0; j < 3; j++) { - CGAL_triangulation_assertion( (off[j] - difference_offset)[0] >= 0); - CGAL_triangulation_assertion( (off[j] - difference_offset)[1] >= 0); - CGAL_triangulation_assertion( (off[j] - difference_offset)[0] < 3); - CGAL_triangulation_assertion( (off[j] - difference_offset)[1] < 3); + CGAL_assertion( (off[j] - difference_offset)[0] >= 0); + CGAL_assertion( (off[j] - difference_offset)[1] >= 0); + CGAL_assertion( (off[j] - difference_offset)[0] < 3); + CGAL_assertion( (off[j] - difference_offset)[1] < 3); // find the Vertex_handles of the vertices of the "original" // periodic copy of nb. If the vertex is inside the original @@ -3151,19 +3149,19 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() off[i] = Offset(); get_vertex(it, i, vert[i], off[i]); it->set_vertex(i, vert[i]); - CGAL_triangulation_assertion(vert[i]->point()[0] < _domain.xmax()); - CGAL_triangulation_assertion(vert[i]->point()[1] < _domain.ymax()); - CGAL_triangulation_assertion(vert[i]->point()[0] >= _domain.xmin()); - CGAL_triangulation_assertion(vert[i]->point()[1] >= _domain.ymin()); + CGAL_assertion(vert[i]->point()[0] < _domain.xmax()); + CGAL_assertion(vert[i]->point()[1] < _domain.ymax()); + CGAL_assertion(vert[i]->point()[0] >= _domain.xmin()); + CGAL_assertion(vert[i]->point()[1] >= _domain.ymin()); // redirect also the face pointer of the vertex. it->vertex(i)->set_face(it); } // Set the offsets. set_offsets(it, off[0], off[1], off[2]); - CGAL_triangulation_assertion( int_to_off(it->offset(0)) == off[0] ); - CGAL_triangulation_assertion( int_to_off(it->offset(1)) == off[1] ); - CGAL_triangulation_assertion( int_to_off(it->offset(2)) == off[2] ); + CGAL_assertion( int_to_off(it->offset(0)) == off[0] ); + CGAL_assertion( int_to_off(it->offset(1)) == off[1] ); + CGAL_assertion( int_to_off(it->offset(2)) == off[2] ); } } @@ -3196,7 +3194,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() { if (_virtual_vertices.count(vit) != 0) { - CGAL_triangulation_assertion( _virtual_vertices.count( vit ) == 1 ); + CGAL_assertion( _virtual_vertices.count( vit ) == 1 ); vertices_to_delete.push_back(vit); } } @@ -3213,7 +3211,7 @@ void Periodic_2_triangulation_2::convert_to_1_sheeted_covering() _too_long_edge_counter = 0; _too_long_edges.clear(); - CGAL_triangulation_assertion(is_1_cover()); + CGAL_assertion(is_1_cover()); } template @@ -3221,7 +3219,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { if (_cover == make_array(3, 3)) return; - CGAL_triangulation_precondition(is_1_cover()); + CGAL_precondition(is_1_cover()); // Create 9 copies of each vertex and write virtual_vertices and // virtual_vertices_reverse @@ -3299,7 +3297,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (int i = 0; i < 3; i++) { vvrmit[i] = _virtual_vertices_reverse.find((*fit)->vertex(i)); - CGAL_triangulation_assertion( + CGAL_assertion( vvrmit[i] != _virtual_vertices_reverse.end()); vvoff[i] = int_to_off((*fit)->offset(i)); } @@ -3313,7 +3311,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() int o_i = ((n + 1) / 3 + vvoff[i].x() + 3) % 3; int o_j = ((n + 1) + vvoff[i].y() + 3) % 3; int n_c = 3 * o_i + o_j - 1; - CGAL_triangulation_assertion(n_c >= -1); + CGAL_assertion(n_c >= -1); if (n_c == -1) vvh[i] = (*fit)->vertex(i); else @@ -3333,13 +3331,13 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { Virtual_vertex_reverse_map_it vvrmit = _virtual_vertices_reverse.find( (*fit)->vertex(i)); - CGAL_triangulation_assertion(vvrmit != _virtual_vertices_reverse.end()); + CGAL_assertion(vvrmit != _virtual_vertices_reverse.end()); Offset vvoff = int_to_off((*fit)->offset(i)); if (!vvoff.is_null()) { int n_f = 3 * vvoff.x() + vvoff.y() - 1; - CGAL_triangulation_assertion(n_f >= 0); - CGAL_triangulation_assertion(static_cast(n_f) < vvrmit->second.size()); + CGAL_assertion(n_f >= 0); + CGAL_assertion(static_cast(n_f) < vvrmit->second.size()); (*fit)->set_vertex(i, vvrmit->second[n_f]); } } @@ -3350,14 +3348,14 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (typename std::list::iterator fit = original_faces.begin(); fit != original_faces.end(); ++fit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); VCRMIT c_cp = virtual_faces_reverse.find(*fit); - CGAL_triangulation_assertion(c_cp != virtual_faces_reverse.end()); + CGAL_assertion(c_cp != virtual_faces_reverse.end()); for (int i = 0; i < 3; i++) { Face_handle fit_nb = (*fit)->neighbor(i); VCRMIT c_cp_nb = virtual_faces_reverse.find(fit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_faces_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_faces_reverse.end()); Offset nboff = (*oit)[i]; for (int n = 0; n < 8; n++) { @@ -3372,16 +3370,16 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() } if (n_nb == -1) { - CGAL_triangulation_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); - CGAL_triangulation_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex( cw(i))) ); + CGAL_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); + CGAL_assertion(fit_nb->has_vertex(c_cp->second[n]->vertex( cw(i))) ); c_cp->second[n]->set_neighbor(i, fit_nb); } else { - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex( cw(i))) ); + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex(ccw(i))) ); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex(c_cp->second[n]->vertex( cw(i))) ); c_cp->second[n]->set_neighbor(i, c_cp_nb->second[n_nb]); } } @@ -3393,7 +3391,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() for (typename std::list::iterator fit = original_faces.begin(); fit != original_faces.end(); ++fit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); for (int i = 0; i < 3; i++) { Offset nboff = (*oit)[i]; @@ -3401,14 +3399,14 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { Face_handle fit_nb = (*fit)->neighbor(i); VCRMIT c_cp_nb = virtual_faces_reverse.find(fit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_faces_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_faces_reverse.end()); int o_i = (3 - nboff.x()) % 3; int o_j = (3 - nboff.y()) % 3; int n_nb = 3 * o_i + o_j - 1; - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex(ccw(i))) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex( cw(i))) ); + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex(ccw(i))) ); + CGAL_assertion(c_cp_nb->second[n_nb]->has_vertex((*fit)->vertex( cw(i))) ); (*fit)->set_neighbor(i, c_cp_nb->second[n_nb]); } } @@ -3428,7 +3426,7 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() != original_faces.end(); ++fit) { VCRMIT c_cp = virtual_faces_reverse.find(*fit); - CGAL_triangulation_assertion( c_cp != virtual_faces_reverse.end()); + CGAL_assertion( c_cp != virtual_faces_reverse.end()); Offset off[3]; for (int i = 0; i < 3; i++) off[i] = int_to_off((*fit)->offset(i)); @@ -3445,8 +3443,8 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { off_cp[i] = Offset((o_i == 2) ? off[i].x() : 0, (o_j == 2) ? off[i].y() : 0); - CGAL_triangulation_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); - CGAL_triangulation_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); + CGAL_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); + CGAL_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); } set_offsets(c_cp->second[n], off_cp[0], off_cp[1], off_cp[2]); } @@ -3458,25 +3456,23 @@ void Periodic_2_triangulation_2::convert_to_9_sheeted_covering() { //This statement does not seem to have any effect set_offsets(*fit, 0, 0, 0); - CGAL_triangulation_assertion((*fit)->offset(0) == 0); - CGAL_triangulation_assertion((*fit)->offset(1) == 0); - CGAL_triangulation_assertion((*fit)->offset(2) == 0); + CGAL_assertion((*fit)->offset(0) == 0); + CGAL_assertion((*fit)->offset(1) == 0); + CGAL_assertion((*fit)->offset(2) == 0); } _cover = make_array(3, 3); // Set up too long edges data structure - int i = 0; for (Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { _too_long_edges[vit] = std::list(); - ++i; } _too_long_edge_counter = find_too_long_edges(_too_long_edges); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); - CGAL_triangulation_assertion(!is_1_cover()); + CGAL_assertion(!is_1_cover()); } // iterate over all edges and store the ones that are longer than @@ -3547,17 +3543,17 @@ inline void Periodic_2_triangulation_2::get_vertex(Vertex_handle vh_i, // if vh_i is not contained in virtual_vertices, then it is in the // original domain. vh = vh_i; - CGAL_triangulation_assertion(vh != Vertex_handle()); + CGAL_assertion(vh != Vertex_handle()); } else { // otherwise it has to be looked up as well as its offset. vh = it->second.first; off += it->second.second; - CGAL_triangulation_assertion(vh->point().x() < _domain.xmax()); - CGAL_triangulation_assertion(vh->point().y() < _domain.ymax()); - CGAL_triangulation_assertion(vh->point().x() >= _domain.xmin()); - CGAL_triangulation_assertion(vh->point().y() >= _domain.ymin()); + CGAL_assertion(vh->point().x() < _domain.xmax()); + CGAL_assertion(vh->point().y() < _domain.ymax()); + CGAL_assertion(vh->point().x() >= _domain.xmin()); + CGAL_assertion(vh->point().y() >= _domain.ymin()); } } @@ -3575,7 +3571,7 @@ GT, Tds >::get_face(const Vertex_handle* vh) const Face_circulator done(fc); do { - CGAL_triangulation_assertion( + CGAL_assertion( fc->vertex(0) == vh[2] || fc->vertex(1) == vh[2] || fc->vertex(2) == vh[2]); @@ -3591,7 +3587,7 @@ GT, Tds >::get_face(const Vertex_handle* vh) const } while (++fc != done); - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Face_handle(); } @@ -3599,7 +3595,7 @@ template Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, const Offset &off, Face_handle f, Locate_type <, int &li) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Orientation o0, o1, o2; o0 = o1 = o2 = ZERO; @@ -3607,7 +3603,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, if ((cumm_off == 0) && is_1_cover()) { - CGAL_triangulation_assertion(off == Offset()); + CGAL_assertion(off == Offset()); const Point &p0 = f->vertex(0)->point(); const Point &p1 = f->vertex(1)->point(); @@ -3629,7 +3625,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, p[i] = &(f->vertex(i)->point()); offs[i] = get_offset(f, i); } - CGAL_triangulation_assertion(orientation(*p[0], *p[1], *p[2], + CGAL_assertion(orientation(*p[0], *p[1], *p[2], offs[0], offs[1], offs[2]) == POSITIVE); bool found = false; for (int i = 0; (i < 4) && (!found); i++) @@ -3681,7 +3677,7 @@ Bounded_side Periodic_2_triangulation_2::side_of_face(const Point &q, default: { // impossible : cannot be on 3 edges for a real triangle - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3753,7 +3749,7 @@ Bounded_side Periodic_2_triangulation_2::bounded_side(const Point &p0, { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2) != COLLINEAR); Orientation o1 = orientation(p0, p1, p); Orientation o2 = orientation(p1, p2, p); @@ -3796,7 +3792,7 @@ Bounded_side Periodic_2_triangulation_2::bounded_side(const Point &p0, const Offset &o1, const Offset &o2, const Offset &o) const { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2, o0, o1, o2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2, o0, o1, o2) != COLLINEAR); Orientation orient1 = orientation(p0, p1, p, o0, o1, o); Orientation orient2 = orientation(p1, p2, p, o1, o2, o); Orientation orient3 = orientation(p2, p0, p, o2, o0, o); @@ -3995,7 +3991,7 @@ void Periodic_2_triangulation_2::insert_too_long_edge(Face_handle f, in } else { - CGAL_triangulation_precondition(&*vh2 < &*vh1); + CGAL_precondition(&*vh2 < &*vh1); if (edge_is_too_long(p2, p1) && (find(_too_long_edges[vh2].begin(), _too_long_edges[vh2].end(), vh1) == _too_long_edges[vh2].end())) { @@ -4039,7 +4035,7 @@ void Periodic_2_triangulation_2::remove_too_long_edges_in_star( } else { - CGAL_triangulation_precondition(&*vh2 < &*vh); + CGAL_precondition(&*vh2 < &*vh); if (edge_is_too_long(p1, p2) && (find(_too_long_edges[vh2].begin(), _too_long_edges[vh2].end(), vh) != _too_long_edges[vh2].end())) @@ -4190,14 +4186,14 @@ Periodic_2_triangulation_2::save(std::ostream& os) const << Offset(0, 0) << std::endl; else os << it->point() << Offset(0, 0); - CGAL_triangulation_assertion(_virtual_vertices_reverse.find(it) + CGAL_assertion(_virtual_vertices_reverse.find(it) != _virtual_vertices_reverse.end()); vv = _virtual_vertices_reverse.find(it)->second; - CGAL_triangulation_assertion(vv.size() == 8); + CGAL_assertion(vv.size() == 8); for (std::size_t j = 0; j < vv.size(); j++) { vvit = _virtual_vertices.find(vv[j]); - CGAL_triangulation_assertion(vvit != _virtual_vertices.end()); + CGAL_assertion(vvit != _virtual_vertices.end()); V[vv[j]] = i++; if (IO::is_ascii(os)) os << vv[j]->point() << std::endl @@ -4206,7 +4202,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const } } } - CGAL_triangulation_postcondition(i == _cover[0]*_cover[1]*n); + CGAL_postcondition(i == _cover[0]*_cover[1]*n); Unique_hash_map F(0, _tds.number_of_faces()); int inum = 0; @@ -4299,7 +4295,7 @@ Periodic_2_triangulation_2::load(std::istream& is) // the faces by the indices of their vertices in the preceding list // of vertices, plus the non combinatorial information on each face // the neighbors of each face by their index in the preceding list of face - CGAL_triangulation_precondition(is.good()); + CGAL_precondition(is.good()); clear(); @@ -4321,7 +4317,7 @@ Periodic_2_triangulation_2::load(std::istream& is) } std::cout << "Line:" << __LINE__ << " cx:" << cx << " cy:" << cy << " n:" << n << std::endl; - CGAL_triangulation_assertion((n / (cx * cy))*cx*cy == n); + CGAL_assertion((n / (cx * cy))*cx*cy == n); tds().set_dimension((n == 0 ? -2 : 2)); _domain = domain; @@ -4434,19 +4430,17 @@ Periodic_2_triangulation_2::load(std::istream& is) for (std::size_t j = 0 ; j < m; j++) is >> *(F[j]); - int i = 0; for (Vertex_iterator vi = vertices_begin(); vi != vertices_end(); ++vi) { _too_long_edges[vi] = std::list(); - ++i; } _edge_length_threshold = FT(0.166) * (_domain.xmax() - _domain.xmin()) * (_domain.xmax() - _domain.xmin()); _too_long_edge_counter = find_too_long_edges(_too_long_edges); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); return is; } @@ -4472,11 +4466,11 @@ test_next(const Periodic_2_triangulation_2 &t1, // Returns false if an inequality has been found. // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.number_of_vertices() != 0); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(t1.number_of_vertices() != 0); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); typedef Periodic_2_triangulation_2 Tr1; typedef Periodic_2_triangulation_2 Tr2; diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h index 5935bd8980b..c2e8d60557a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_face_base_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -64,7 +64,7 @@ public: /// Periodic functions int offset(int i) const { - CGAL_triangulation_precondition( i >= 0 && i < 3 ); + CGAL_precondition( i >= 0 && i < 3 ); return ((_off >> 2 * i) & 3); } bool has_zero_offsets() const diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h index 91ddd875383..c3df3a7274d 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h @@ -455,13 +455,13 @@ typename Periodic_2_triangulation_hierarchy_2::Vertex_handle Periodic_2_triangulation_hierarchy_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < m_maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_if_no_collision(v, p); if (l == 0) { @@ -491,13 +491,13 @@ typename Periodic_2_triangulation_hierarchy_2::Vertex_handle Periodic_2_triangulation_hierarchy_2:: move_point(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < m_maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_point(v, p); if (l == 0) { diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h index 7e101966af8..afa1a55fce5 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -95,7 +95,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -138,7 +138,7 @@ public: bool operator==(const Periodic_triangle_iterator& ti) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -208,7 +208,7 @@ private: void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; @@ -290,18 +290,18 @@ private: get_edge_offsets(off0, off1, off2); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->offset(0)); off1 = _t->int_to_off(pos->offset(1)); off2 = _t->int_to_off(pos->offset(2)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0) @@ -317,7 +317,7 @@ private: Periodic_triangle construct_periodic_triangle() const { - CGAL_triangulation_assertion(pos != typename T::Face_handle()); + CGAL_assertion(pos != typename T::Face_handle()); Offset off0, off1, off2; get_edge_offsets(off0, off1, off2); Offset transl_off = Offset((((_off >> 1) & 1) == 1 ? -1 : 0), @@ -414,7 +414,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -457,7 +457,7 @@ public: bool operator==(const Periodic_segment_iterator& ti) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -524,7 +524,7 @@ private: void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; @@ -601,14 +601,14 @@ private: get_edge_offsets(off0, off1); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset(_t->cw(pos->second))); off1 = _t->int_to_off(pos->first->offset(_t->ccw(pos->second))); } Offset diff_off = off0 - off1; - CGAL_triangulation_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); - CGAL_triangulation_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); + CGAL_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); + CGAL_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); return( 2 * (diff_off.x() == 0 ? 0 : 1) + (diff_off.y() == 0 ? 0 : 1)); @@ -616,7 +616,7 @@ private: Periodic_segment construct_periodic_segment() const { - CGAL_triangulation_assertion(pos->first != typename T::Face_handle()); + CGAL_assertion(pos->first != typename T::Face_handle()); Offset off0, off1; get_edge_offsets(off0, off1); Offset transl_off = Offset((((_off >> 1) & 1) == 1 ? -1 : 0), @@ -708,7 +708,7 @@ public: while (pos != _t->vertices_end() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -730,7 +730,7 @@ public: while (pos != _t->vertices_begin() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -752,7 +752,7 @@ public: bool operator==(const Periodic_point_iterator& pi) const { // We are only allowed to compare iterators of the same type. - CGAL_triangulation_assertion(_it == pi._it); + CGAL_assertion(_it == pi._it); return _t == pi._t && pos == pi.pos; } @@ -795,7 +795,7 @@ private: Periodic_point construct_periodic_point() const { - CGAL_triangulation_assertion(pos != typename T::Vertex_handle()); + CGAL_assertion(pos != typename T::Vertex_handle()); Offset off = _t->get_offset(pos); return std::make_pair(pos->point(), off); } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h index b6c6796dc00..b0ae5b190c2 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_traits_2.h @@ -20,7 +20,6 @@ #include #include -#include namespace CGAL { diff --git a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/test_p2t2_delaunay_performance.cpp b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/test_p2t2_delaunay_performance.cpp index ddef1fcc6de..3268d9dd881 100644 --- a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/test_p2t2_delaunay_performance.cpp +++ b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/test_p2t2_delaunay_performance.cpp @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) // For generating the plot: /* - + diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h deleted file mode 100644 index d6e097fc9e6..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/make_periodic_3_mesh_3.h +++ /dev/null @@ -1,149 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. -It produces simplicial meshes which discretize 3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, -etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, -and sliver perturber should never be called after the sliver exuder. -In the case of further refinement, only the sliver exuder can be used. - -The function outputs the mesh to an object which provides iterators to -traverse the resulting mesh data structure or can be written to a file -(see \ref Periodic_3_mesh_3_section_examples ). - -\tparam C3T3 is required to be a model of the concept -`MeshComplex_3InTriangulation_3`. This is the return type. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of the concept `Periodic_3MeshDomain_3`, -or of the refined concept `Periodic_3MeshDomainWithFeatures_3` if the domain has corners -and curve segments that need to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC is required to be a model of the concept -`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. -The argument `criteria` of type `MC` specifies the size and shape -requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument -`criteria` provides a sizing field to guide the discretization -of 1-dimensional exposed features. - -\cgalHeading{Named Parameters} - -- `features` allows -the user to specify whether 0 and 1-dimensional features have to be -taken into account or not -when the domain is a model of `Periodic_3MeshDomainWithFeatures_3`. -The type `Features` of this parameter is an internal undescribed type. -The library provides functions to construct appropriate values of that type. -
      -
    • \link parameters::features() `parameters::features(domain)` \endlink -sets `features` according to the domain, -i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a -`Periodic_3MeshDomainWithFeatures_3`. This is the default behavior -if parameter `features` is not specified. -
    • `parameters::no_features()` prevents the representation -of 0 and 1-dimensional features in the mesh. -
    - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -- `lloyd`: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT`: `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb`: `parameters::perturb()` and `parameters::no_perturb()` are designed to -trigger or not a call to `perturb_periodic_3_mesh_3` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`CGAL::perturb_periodic_3_mesh_3` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude`: `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in an arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. - -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further - details): *ODT-smoother*, *Lloyd-smoother*, *perturb*, *exude*. - -Beware that optimization of the mesh is obtained -by perturbing mesh vertices and modifying the mesh connectivity -and that this has an impact -on the strict compliance to the refinement criteria. -Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `refine_periodic_3_mesh_3()` -\sa `make_mesh_3()` - -\sa `parameters::features()` -\sa `parameters::no_features()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude()` -\sa `parameters::no_exude()` -\sa `parameters::perturb()` -\sa `parameters::no_perturb()` -\sa `parameters::lloyd()` -\sa `parameters::no_lloyd()` -\sa `parameters::odt()` -\sa `parameters::no_odt()` -*/ - -template -C3T3 make_periodic_3_mesh_3(const MD& domain, - const MC& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h deleted file mode 100644 index af1e2224ca8..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/optimize_periodic_3_mesh_3.h +++ /dev/null @@ -1,83 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization -process based on the minimization of a global energy function. - -This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `lloyd_optimize_mesh_3()`. - -\note This function requires the \ref thirdpartyEigen library. -*/ -template -CGAL::Mesh_optimization_return_code -lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization -process based on the minimization of a global energy function. - -This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `odt_optimize_mesh_3()`. -*/ -template -Mesh_optimization_return_code -odt_optimize_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - std::size_t parameters::max_iteration_number=0, - double parameters::convergence=0.02, - double parameters::freeze_bound = 0.01, - bool parameters::do_freeze=true); - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that -improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. - -This function directly calls `perturb_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `perturb_mesh_3()`. -*/ -template -CGAL::Mesh_optimization_return_code -perturb_periodic_3_mesh_3(C3T3& c3t3, - const MD& domain, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `exude_periodic_3_mesh_3()` performs a sliver exudation process -on a periodic Delaunay mesh. - -The sliver exudation process consists in optimizing the weights of vertices -of the periodic weighted Delaunay triangulation in such a way that slivers disappear -and the quality of the mesh improves. - -\warning This optimizer modifies the weight of vertices of the periodic triangulation -and, if called, must be the last optimizer to be called. If the mesh is refined after -this optimization has been performed, all improvements will be lost. - -This function directly calls `exude_mesh_3()`, but is provided for convenience. -Further information can be found on the documentation of the function `exude_mesh_3()`. -*/ -template -CGAL::Mesh_optimization_return_code -exude_periodic_3_mesh_3(C3T3& c3t3, - double parameters::time_limit=0, - double parameters::sliver_bound=0); - -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h deleted file mode 100644 index ea2d35cc1bf..00000000000 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/refine_periodic_3_mesh_3.h +++ /dev/null @@ -1,142 +0,0 @@ -namespace CGAL { - -/*! -\ingroup PkgPeriodic3Mesh3Functions - -The function `refine_periodic_3_mesh_3()` is a 3D periodic -mesh generator. It produces periodic simplicial meshes which discretize -3D periodic domains. - -The periodic mesh generation algorithm is a Delaunay refinement process -followed by an optimization phase. -The criteria driving the Delaunay refinement -process may be tuned to achieve the user needs with respect to -the size of mesh elements, the accuracy of boundaries approximation, etc. - -The optimization phase is a sequence of optimization processes, -amongst the following available optimizers: an ODT-smoothing, -a Lloyd smoothing, a sliver perturber, and a sliver exuder. -Each optimization process can be activated or not, according to the user requirements -and available time. -By default, only the perturber and the exuder are activated. -Note that the benefits of the exuder will be lost if the mesh -is further refined afterward. - -\attention The function template `refine_periodic_3_mesh_3()` may be used -to refine a previously computed mesh, e.g.: -\code{.cpp} -C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); - -CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); -\endcode - -\attention Note that the triangulation must form at all times a simplicial complex within -a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro -of the manual of 3D periodic triangulations). It is the responsability of the user to provide -a triangulation that satisfies this condition when calling the refinement -function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh -complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` -will always satisfy this condition. - -\tparam C3T3 is required to be a model of the concept `MeshComplex_3InTriangulation_3`. -The argument `c3t3` is passed by reference as this object is modified -by the refinement process. As the refinement process only adds points -to the triangulation, all vertices of the triangulation of `c3t3` remain in the -mesh during the refinement process. The object `c3t3` can be used to insert -specific points in the domain to ensure that they will be contained in the -final triangulation. -The type `C3T3` is in particular required to provide a nested type -`C3T3::Triangulation` for the 3D periodic triangulation -embedding the periodic mesh. The vertex and cell base classes of the -triangulation `C3T3::Triangulation` are required to be models of the -concepts `MeshVertexBase_3` and `Periodic_3TriangulationDSVertexBase_3`, and of -the concepts `MeshCellBase_3` and `Periodic_3TriangulationDSCellBase_3`, respectively. - -\tparam MD is required to be a model of -the concept `Periodic_3MeshDomain_3` or of the refined concept -`Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features -of the input complex have to be accurately represented in the mesh. -The argument `domain` is the sole link through which the domain -to be discretized is known by the mesh generation algorithm. - -\tparam MC has to be a model of the concept `MeshCriteria_3`, -or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain -has exposed features. The argument `criteria` of type `MC` specifies the -size and shape requirements for mesh tetrahedra and surface facets. These criteria -form the rules which drive the refinement process. All mesh elements -satisfy those criteria at the end of the refinement process. -In addition, if the domain has features, the argument `criteria` provides -a sizing field to guide the discretization of 1-dimensional exposed features. - -The four additional parameters are optimization parameters. -They control which optimization processes are performed -and allow the user to tune the parameters of the optimization processes. -Individual optimization parameters are not described here as they are -internal types (see instead the documentation page of each optimizer). -For each optimization algorithm, there exist two global functions -that allow to enable or disable the optimizer: - -\cgalHeading{Named Parameters} -- `lloyd` `parameters::lloyd()` and `parameters::no_lloyd()` are designed to -trigger or not a call to `lloyd_optimize_periodic_3_mesh_3()` function and to set the -parameters of this optimizer. If one parameter is not set, the default value of -`lloyd_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `ODT` `parameters::odt()` and `parameters::no_odt()` are designed to -trigger or not a call to `odt_optimize_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. -If one parameter is not set, the default value of -`odt_optimize_periodic_3_mesh_3()` is used for this parameter. - -- `perturb` `parameters::perturb()` and `parameters::no_perturb()` -are designed to trigger or not a call to `perturb_periodic_3_mesh_3()` function and -to set the parameters of this optimizer. If one parameter is not set, the default value of -`perturb_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -- `exude` `parameters::exude()` and `parameters::no_exude()` are designed to -trigger or not a call to `exude_periodic_3_mesh_3()` function and to override to set the -parameters of this optimizer. If one parameter is not set, the default value of -`exude_periodic_3_mesh_3()` is used for this parameter, except for the time bound which is set to be -equal to the refinement CPU time. - -The optimization parameters can be passed in arbitrary order. If one parameter -is not passed, its default value is used. The default values are -`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. -Note that whatever may be the optimization processes activated, -they are always launched in the order that is a suborder -of the following (see user manual for further -details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. - -Beware that optimization of the mesh is obtained by perturbing mesh vertices -and modifying the mesh connectivity and that this has an impact on the strict -compliance to the refinement criteria. Though a strict compliance to mesh criteria -is guaranteed at the end of the Delaunay refinement, this may no longer be true after -some optimization processes. Also beware that the default behavior does involve some -optimization processes. - -\sa `make_periodic_3_mesh_3()` -\sa `refine_mesh_3()` -\sa `exude_periodic_3_mesh_3()` -\sa `perturb_periodic_3_mesh_3()` -\sa `lloyd_optimize_periodic_3_mesh_3()` -\sa `odt_optimize_periodic_3_mesh_3()` -\sa `parameters::exude` -\sa `parameters::no_exude` -\sa `parameters::perturb` -\sa `parameters::no_perturb` -\sa `parameters::lloyd` -\sa `parameters::no_lloyd` -\sa `parameters::odt` -\sa `parameters::no_odt` -*/ -template -void refine_periodic_3_mesh_3(C3T3& c3t3, - const MD& mesh_domain, - const MC& mesh_criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); - -} /* namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in index d49050978bf..64d22001a23 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Doxyfile.in @@ -1,5 +1,9 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} +INPUT += \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_periodic_3_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_periodic_3_mesh_3.h \ + ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/optimize_periodic_3_mesh_3.h PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Periodic Mesh Generation" EXTRACT_ALL = false HIDE_UNDOC_CLASSES = true diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index 5d1380e5950..701fa394146 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -250,29 +250,24 @@ for further information. \section Periodic_3_mesh_3_section_interface Interface +As of \cgal 5.6, this package uses \ref bgl_namedparameters to set parameters. More details are provided in \ref FromBoostNPtoCGALNP. + \subsection Periodic_3_mesh_3TheGlobalFunctions The Global Functions A periodic 3D mesh generation process is launched through a call to one of the two following functions: \code{.cpp} -template +template C3T3 make_periodic_3_mesh_3(const PeriodicMeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Features_options features = parameters::features(domain), - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); -template +template void refine_periodic_3_mesh_3(C3T3& c3t3, const PeriodicMeshDomain& domain, const MeshCriteria& criteria, - parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), - parameters::internal::Odt_options odt = parameters::no_odt(), - parameters::internal::Perturb_options perturb = parameters::perturb(), - parameters::internal::Exude_options exude = parameters::exude()); + const NamedParameters& np); \endcode The function `make_periodic_3_mesh_3()` generates from scratch a periodic mesh @@ -444,7 +439,7 @@ These (purely visual) issues disappear when considering multiple copies together \subsection Periodic_3_mesh_33DDomainsImplicitIsosurfaces 3D Periodic Domains Bounded by Implicit Isosurfaces The following code produces a 3D periodic mesh for a domain whose boundary surface is an isosurface defined by an implicit function. -Note the use of named parameters (from the Boost library) in the +Note the use of named parameters in the constructor of the `Mesh_criteria` instance. \cgalFigureRef{Periodic_3_mesh_3Periodic_implicit_shape} shows the resulting mesh. diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp index 0b57091170c..b2dbdfd2bc6 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp @@ -41,7 +41,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit functions FT sphere_function(const Point& p) @@ -78,11 +78,11 @@ int main(int argc, char** argv) Multi_domain_wrapper multi_domain_function(funcs, vps); Periodic_mesh_domain domain(multi_domain_function, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.04, - facet_distance = 0.025, - cell_radius_edge_ratio = 2., - cell_size = 0.04); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.04). + facet_distance(0.025). + cell_radius_edge_ratio(2.). + cell_size(0.04)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp index 9c39c8758e3..7e308977787 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp @@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function FT schwarz_p(const Point& p) @@ -57,11 +57,11 @@ int main(int argc, char** argv) Periodic_mesh_domain domain = Periodic_mesh_domain::create_implicit_mesh_domain(schwarz_p, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.035 * domain_size, - facet_distance = 0.025 * domain_size, - cell_radius_edge_ratio = 2., - cell_size = 0.05); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.035 * domain_size). + facet_distance(0.025 * domain_size). + cell_radius_edge_ratio(2.). + cell_size(0.05)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 680b0153c95..b6d3cd08b66 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -45,7 +45,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function static const FT cx = 0.51, cy = 0.51, cz = 0.5; @@ -91,11 +91,11 @@ int main(int argc, char** argv) Periodic_function(cone_function, canonical_cube), canonical_cube); // Mesh criteria - Periodic_mesh_criteria criteria(edge_size = 0.02 * domain_size, - facet_angle = 0.05 * domain_size, - facet_size = 0.02 * domain_size, - cell_radius_edge_ratio = 2, - cell_size = 0.5); + Periodic_mesh_criteria criteria(params::edge_size(0.02 * domain_size). + facet_angle(0.05 * domain_size). + facet_size(0.02 * domain_size). + cell_radius_edge_ratio(2). + cell_size(0.5)); // Create the features that we want to preserve Polylines polylines; @@ -108,14 +108,18 @@ int main(int argc, char** argv) domain.add_corner(Point(0.51, 0.51, 0.5)); // Mesh generation WITHOUT feature preservation (and no optimizers) - C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), - no_exude(), no_perturb()); + C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, + params::no_features(). + no_exude(). + no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); // Mesh generation WITH feature preservation (and no optimizers) - C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, features(), - no_exude(), no_perturb()); + C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, + params::features(). + no_exude(). + no_perturb()); std::ofstream medit_file_bis("output_implicit_shape_with_protection.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 3d2c42a4c4e..d4dc33167d9 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -34,7 +34,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Implicit function FT double_p(const Point& p) @@ -62,35 +62,37 @@ int main(int argc, char** argv) Periodic_mesh_domain domain = Periodic_mesh_domain::create_implicit_mesh_domain(double_p, canonical_cube); - Periodic_mesh_criteria criteria(facet_angle = 30, - facet_size = 0.05 * domain_size, - facet_distance = 0.025 * domain_size, - cell_radius_edge_ratio = 2., - cell_size = 0.05); + Periodic_mesh_criteria criteria(params::facet_angle(30). + facet_size(0.05 * domain_size). + facet_distance(0.025 * domain_size). + cell_radius_edge_ratio(2.). + cell_size(0.05)); // Mesh generation with optimizers C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, - odt(convergence=0.03, freeze_bound=0.02, time_limit=30), - lloyd(max_iteration_number=10), - perturb(sliver_bound=10, time_limit=30), - exude(sliver_bound=10, time_limit=0)); + params::odt(params::convergence(0.03).freeze_bound(0.02).time_limit(30)), + params::lloyd(params::max_iteration_number(10)), + params::perturb(params::sliver_bound(10).time_limit(30)), + params::exude(params::sliver_bound(10).time_limit(0))); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); // Below, the mesh generation and the optimizations are done in several calls C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, - no_odt(), no_lloyd(), - no_perturb(), no_exude()); + params::no_odt(). + no_lloyd(). + no_perturb(). + no_exude()); std::ofstream medit_file_bis("output_implicit_shape_non-optimized.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); // Now, call each optimizer with its global function - CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30); - CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, max_iteration_number=10); - CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, sliver_bound=10, time_limit=30); - CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0); + CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::convergence(0.03).freeze_bound(0.02).time_limit(30)); + CGAL::lloyd_optimize_periodic_3_mesh_3(c3t3_bis, domain, params::max_iteration_number(10)); + CGAL::perturb_periodic_3_mesh_3(c3t3_bis, domain, params::sliver_bound(10).time_limit(30)); + CGAL::exude_periodic_3_mesh_3(c3t3_bis, params::sliver_bound(10).time_limit(0)); std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh"); CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp index 8de56fad9a7..ecc1758386a 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp @@ -36,7 +36,7 @@ typedef CGAL::Mesh_complex_3_in_triangulation_3 C3t3; typedef CGAL::Mesh_criteria_3 Periodic_mesh_criteria; // To avoid verbose function and named parameters call -using namespace CGAL::parameters; +namespace params = CGAL::parameters; // Function FT schwarz_p(const Point& p) @@ -67,11 +67,11 @@ int main(int argc, char** argv) size.set_size(0.1, volume_dimension, domain.index_from_subdomain_index(2)); // exterior size.set_size(0.03, volume_dimension, domain.index_from_subdomain_index(1)); // interior - Periodic_mesh_criteria criteria(facet_angle = 30., - facet_size = 0.05, - facet_distance = 0.025, - cell_radius_edge_ratio = 2., - cell_size = size); + Periodic_mesh_criteria criteria(params::facet_angle(30.). + facet_size(0.05). + facet_distance(0.025). + cell_radius_edge_ratio(2.). + cell_size(size)); // Mesh generation C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 6ea15ec5ad7..0f5d2765947 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -203,8 +203,8 @@ private: Vertex_handle get_vertex_corner_from_point(const Bare_point& p, const Index& p_index) const; - /// Insert point(p,w) into the triangulation and set its dimension to \c dim - /// and its index to \c index. + /// Insert point(p,w) into the triangulation and set its dimension to `dim` + /// and its index to `index`. /// The handle of the newly created vertex is returned. template Vertex_handle insert_point(const Bare_point& p, @@ -215,8 +215,8 @@ private: const bool special_ball); /** - * Insert point(p,w) into the triangulation and set its dimension to \c dim and - * its index to \c index. + * Insert point(p,w) into the triangulation and set its dimension to `dim` and + * its index to `index`. * The handle of the newly created vertex is returned. * * This function also ensures that `point(p,w)` will not be inside a @@ -233,11 +233,11 @@ private: const Curve_index_container& curve_indices, ErasedVeOutIt out); - /// Insert balls between the points identified by the handles \c vp and \c vq - /// on the curve identified by \c curve_index. + /// Insert balls between the points identified by the handles `vp` and `vq` + /// on the curve identified by `curve_index`. /// - /// \param orientation Orientation of the curve segment between \c vp and - /// \c vq, given the orientation of the curve of index \c curve_index + /// \param orientation Orientation of the curve segment between `vp` and + /// `vq`, given the orientation of the curve of index `curve_index` template ErasedVeOutIt insert_balls(const Vertex_handle& vp, const Vertex_handle& vq, @@ -260,25 +260,25 @@ private: const Curve_index& curve_index, ErasedVeOutIt out); - /// Return `true` if the balls of \c va and \c vb intersect, and (va,vb) is not + /// Return `true` if the balls of `va` and `vb` intersect, and `(va,vb)` is not /// an edge of the complex. bool non_adjacent_but_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Return `true` if the balls of \c va and \c vb intersect. + /// Return `true` if the balls of `va` and `vb` intersect. bool do_balls_intersect(const Vertex_handle& va, const Vertex_handle& vb) const; - /// Change the size of the ball of the vertex \c v. + /// Change the size of the ball of the vertex `v`. bool change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_ball = false); /// Return `true` if balls of v1 and v2 intersect "enough". - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index` bool is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, @@ -289,17 +289,17 @@ private: /// of those vertices is ok. If not, fix it. void check_and_repopulate_edges(); - /// Check if the vertex \c v is well sampled, and if its not the case, fix it. + /// Check if the vertex `v` is well sampled, and if its not the case, fix it. /// Fill `out` with deleted vertices during this process. The value type of `out` /// is `Vertex_handle`. template ErasedVeOutIt check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out); - /// Given two vertices \c start and \c next inserted on the curve with - /// index \c curve_index, return `CGAL::POSITIVE` if the curve arc from - /// \c start to \c next is oriented in the same orientation as the curve - /// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise. + /// Given two vertices `start` and `next inserted` on the curve with + /// index `curve_index`, return `CGAL::POSITIVE` if the curve arc from + /// `start` to `next` is oriented in the same orientation as the curve + /// segment with index `curve_index`, or `CGAL::NEGATIVE` otherwise. /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` CGAL::Orientation @@ -307,13 +307,13 @@ private: const Vertex_handle& next, Curve_index curve_index) const; - /// Walk along the edge from \c start, following the direction \c start to - /// \c next, and fills \c out with the vertices which do not fulfill + /// Walk along the edge from `start`, following the direction `start` to + /// `next`, and fills `out` with the vertices which do not fulfill /// the sampling conditions. /// - /// \param orientation Orientation of the curve segment between \c v1 and - /// \c v2, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `v1` and + /// `v2`, given the orientation of the curve of index + /// `curve_index` /// /// \pre `c3t3.curve_index(v1, v2) == curve_index` template @@ -324,8 +324,8 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out) const; - /// Return the next vertex along edge, i.e the vertex after \c start, following - /// the direction from \c previous to \c start. + /// Return the next vertex along edge, i.e the vertex after `start`, following + /// the direction from `previous` to `start`. /// \pre (previous,start) is in c3t3 /// \pre `c3t3.curve_index(start, previous) == curve_index` Vertex_handle @@ -334,12 +334,12 @@ private: const Curve_index& curve_index) const; /// Replace the vertices between ]begin,last[ with new vertices, along the curve - /// identified by \c curve_index. + /// identified by `curve_index`. /// The value type of `InputIterator` is `Vertex_handle`. /// - /// \param orientation Orientation of the curve segment between \c begin and - /// \c last, given the orientation of the curve of index - /// \c curve_index + /// \param orientation Orientation of the curve segment between `begin` and + /// `last`, given the orientation of the curve of index + /// `curve_index` /// template ErasedVeOutIt repopulate(InputIterator begin, @@ -355,33 +355,33 @@ private: const CGAL::Orientation orientation, ErasedVeOutIt out); - /// Check if the size of \c v2 is compatible (i.e. greater) with the linear - /// interpolation of the sizes of \c v1 and \c v3. + /// Check if the size of `v2` is compatible (i.e. greater) with the linear + /// interpolation of the sizes of `v1` and `v3`. bool is_sizing_field_correct(const Vertex_handle& v1, const Vertex_handle& v2, const Vertex_handle& v3, const Curve_index& index, const CGAL::Orientation orientation) const; - /// Repopulate all incident curves around the corner \c v. - /// \pre \c v is a corner of c3t3 + /// Repopulate all incident curves around the corner `v`. + /// \pre `v` is a corner of c3t3 template ErasedVeOutIt repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); - /// Return `true` if the edge with index \c curve_index is already treated. + /// Return `true` if the edge with index `curve_index` is already treated. bool is_treated(const Curve_index& curve_index) const { return (treated_edges_.find(curve_index) != treated_edges_.end()); } - /// Set the edge with index \c curve_index as treated. + /// Set the edge with index `curve_index` as treated. void set_treated(const Curve_index& curve_index) { treated_edges_.insert(curve_index); } - /// Compute the Euclidean distance between the bare points \c and \c q. + /// Compute the Euclidean distance between the bare points `p` and `q`. FT compute_distance(const Bare_point& p, const Bare_point& q) const { // No need to call min_squared_distance() because 'p' and 'q' have been @@ -398,7 +398,7 @@ private: return compute_distance(pa, pb); } - /// Compute the Euclidean distance between the bare points of \c va and \c vb. + /// Compute the Euclidean distance between the bare points of `va` and `vb`. FT compute_distance(const Vertex_handle& va, const Vertex_handle& vb) const { typename Gt::Construct_point_3 cp = @@ -410,7 +410,7 @@ private: return CGAL::sqrt(c3t3_.triangulation().min_squared_distance(cp(wpa), cp(wpb))); } - /// Return the radius of the ball of vertex \c v. + /// Return the radius of the ball of vertex `v`. FT get_radius(const Vertex_handle& v) const { typename Gt::Compute_weight_3 cw = diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h index 64f113fa331..61d39cf6279 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h @@ -715,8 +715,8 @@ public: const Facet* /* this_facet_must_be_in_the_cz */ = nullptr, bool* /* the_facet_is_in_its_cz */ = nullptr) const { - CGAL_triangulation_precondition(could_lock_zone == nullptr); - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(could_lock_zone == nullptr); + CGAL_precondition(number_of_vertices() != 0); clear_v_offsets(); diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 092e864bab5..2c42a1b9800 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -26,11 +26,9 @@ #include #include -#include #include #include - -#include +#include namespace CGAL { namespace Periodic_3_mesh_3 { @@ -168,56 +166,187 @@ struct C3t3_initializer // make_periodic_3_mesh_3 stuff // ----------------------------------- -// Manual redirections -// boost::parameter can't handle make_periodic_3_mesh_3 return_type alone... -template -C3T3 make_periodic_3_mesh_3(const MD& md, const MC& mc, const T& ...t) +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator. + * It produces simplicial meshes which discretize 3D periodic domains. + * The periodic mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, + * etc. + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process can be activated or not, according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, + * and sliver perturber should never be called after the sliver exuder. + * In the case of further refinement, only the sliver exuder can be used. + * The function outputs the mesh to an object which provides iterators to + * traverse the resulting mesh data structure or can be written to a file + * (see \ref Periodic_3_mesh_3_section_examples ). + * + * + * \tparam C3T3 is required to be a model of + * the concept `MeshComplex_3InTriangulation_3`. This is the return type. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` + * respectively. + * + * \tparam MD is required to be a model of + * the concept `MeshDomain_3`, or of the refined concept + * `MeshDomainWithFeatures_3` + * if the domain has corners and curves that need to be accurately represented in the mesh. + * The argument `domain` + * is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * + * \tparam MC has to be a model of the concept + * `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. + * The argument `criteria` of type `MC` specifies the + * size and shape requirements for mesh tetrahedra + * and surface facets. These criteria + * form the rules which drive the refinement process. All mesh elements + * satisfy those criteria at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + * + * + * \param domain the domain to be discretized + * \param criteria the criteria + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Feature preservation options} + * \cgalParamDescription{If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be + * taken into account while generating the mesh. The following two named parameters control + * this option: + *
      + *
    • \link parameters::features() `parameters::features(domain)` \endlink + *
    • `parameters::no_features()` + *
    } + * \cgalParamDefault{`parameters::features(domain)`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in an arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * + * Note that regardless of which optimization processes are activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `refine_periodic_3_mesh_3()` + * \sa `make_mesh_3()` + * \sa `exude_mesh_3()` + * \sa `perturb_mesh_3()` + * \sa `lloyd_optimize_mesh_3()` + * \sa `odt_optimize_mesh_3()` + */ +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { + using parameters::choose_parameter; + using parameters::get_parameter; C3T3 c3t3; - make_periodic_3_mesh_3_bp(c3t3,md,mc,t...); + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd().v); + parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain).v); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + make_periodic_3_mesh_3_impl(c3t3, domain, criteria, + exude_param, perturb_param, odt_param, lloyd_param, + features_param.features(), mesh_options_param, + manifold_options_param); return c3t3; } -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - make_periodic_3_mesh_3_bp, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (features_param, (parameters::internal::Features_options), parameters::features(domain)) - (exude_param, (parameters::internal::Exude_options), parameters::exude()) - (perturb_param, (parameters::internal::Perturb_options), parameters::perturb()) - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) - ) +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +C3T3 make_periodic_3_mesh_3(MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) { - make_periodic_3_mesh_3_impl(c3t3, domain, criteria, - exude_param, perturb_param, odt_param, lloyd_param, - features_param.features(), mesh_options_param, - manifold_options_param); + return make_periodic_3_mesh_3(domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); } -CGAL_PRAGMA_DIAG_POP -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif /** * @brief This function meshes the domain defined by mesh_traits @@ -225,7 +354,7 @@ CGAL_PRAGMA_DIAG_POP * * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if it is set to \c true, an exudation step will be done at + * @param exude if it is set to `true`, an exudation step will be done at * the end of the Delaunay refinement process * * @return The mesh as a C3T3 object @@ -247,19 +376,19 @@ void make_periodic_3_mesh_3_impl(C3T3& c3t3, // Initialize c3t3 Periodic_3_mesh_3::internal::C3t3_initializer< C3T3, MeshDomain, MeshCriteria, - Mesh_3::internal::has_Has_features::value>()(c3t3, - domain, - criteria, - with_features, - mesh_options); + internal::has_Has_features::value>()(c3t3, + domain, + criteria, + with_features, + mesh_options); // Build mesher and launch refinement process refine_periodic_3_mesh_3(c3t3, domain, criteria, - exude, perturb, odt, lloyd, - parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it - mesh_options, manifold_options); + parameters::exude_options = exude, parameters::perturb_options = perturb, parameters::odt_options = odt, + parameters::lloyd_options = lloyd, parameters::no_reset_c3t3(), // do not reset c3t3 as we just created it + parameters::mesh_options = mesh_options, parameters::manifold_option = manifold_options); } - +#endif //DOXYGEN_RUNNING } // end namespace CGAL #endif // CGAL_PERIODIC_3_MESH_3_MAKE_PERIODIC_3_MESH_3_H diff --git a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h index 8b3d75cbfe4..0a7c1e5ef4c 100644 --- a/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/optimize_periodic_3_mesh_3.h @@ -19,106 +19,191 @@ #define CGAL_OPTIMIZE_PERIODIC_3_MESH_3_H #include - +#include #include namespace CGAL { - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - // ---------------------------------- pertuber --------------------------------- - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - perturb_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (sliver_bound_, *, parameters::default_values_for_mesh_3::perturb_sliver_bound) - (sliver_criterion_, *, parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3, sliver_bound_)) - (perturbation_vector_, *, default_perturbation_vector(c3t3,domain,sliver_criterion_)) - ) -) +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that + * improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh. + * + * This function directly calls `perturb_mesh_3()`, but is provided for convenience. + * Further information can be found in the documentation of the function `perturb_mesh_3()`. + */ +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_USE(sliver_bound_); - return perturb_mesh_3_impl(c3t3, domain, time_limit_, sliver_criterion_, - perturbation_vector_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,internal_np::maximum_running_time),parameters::default_values_for_mesh_3::time_limit); + auto sliver_bound = choose_parameter(get_parameter(np,internal_np::lower_sliver_bound), parameters::default_values_for_mesh_3::perturb_sliver_bound); + auto sliver_criterion = choose_parameter(get_parameter(np, internal_np::sliver_criteria), parameters::default_values_for_mesh_3::default_sliver_criterion(c3t3,sliver_bound)); + auto perturbation_vector = choose_parameter(get_parameter(np,internal_np::perturb_vector), default_perturbation_vector(c3t3,domain,sliver_criterion)); + return perturb_mesh_3_impl(c3t3, domain, time_limit, sliver_criterion, perturbation_vector); +} + +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return perturb_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code perturb_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return perturb_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } // ---------------------------------- exuder ----------------------------------- - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - exude_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*)) - (optional - (time_limit_, *, 0) - (sliver_bound_, *, parameters::default_values_for_mesh_3::exude_sliver_bound) - ) -) +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `exude_periodic_3_mesh_3()` performs a sliver exudation process + * on a periodic Delaunay mesh. + * + * The sliver exudation process consists in optimizing the weights of vertices + * of the periodic weighted Delaunay triangulation in such a way that slivers disappear + * and the quality of the mesh improves. + * + * \warning This optimizer modifies the weight of vertices of the periodic triangulation + * and, if called, must be the last optimizer to be called. If the mesh is refined after + * this optimization has been performed, all improvements will be lost. + * + * This function directly calls `exude_mesh_3()`, but is provided for convenience. + * Further information can be found in the documentation of the function `exude_mesh_3()`. + */ +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3,const CGAL_NP_CLASS& np = parameters::default_values()) { - return exude_mesh_3_impl(c3t3, time_limit_, sliver_bound_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + double sliver_bound= choose_parameter(get_parameter(np,internal_np::lower_sliver_bound),parameters::default_values_for_mesh_3::exude_sliver_bound); + return exude_mesh_3_impl(c3t3,time_limit,sliver_bound); +} +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(C3T3& c3t3, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return exude_periodic_3_mesh_3(c3t3,internal_np::combine_named_parameters(np1, np2, nps...)); +} +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code exude_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return exude_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } -// ------------------------------ odt optimizer -------------------------------- -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - odt_optimize_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (max_iteration_number_, *, 0) - (convergence_, *, parameters::default_values_for_mesh_3::odt_convergence_ratio) - (freeze_bound_, *, parameters::default_values_for_mesh_3::odt_freeze_ratio) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze) - ) -) +// ------------------------------ odt optimizer -------------------------------- +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization + * process based on the minimization of a global energy function. + * + * This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. + * Further information can be found in the documentation of the function `odt_optimize_mesh_3()`. + */ +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, const CGAL_NP_CLASS& np = parameters::default_values()) { - return odt_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_, do_freeze_); + using parameters::choose_parameter; + using parameters::get_parameter; + double time_limit=choose_parameter(get_parameter(np,internal_np::maximum_running_time),0); + std::size_t max_iteration_number=choose_parameter(get_parameter(np,internal_np::number_of_iterations),0); + double convergence=choose_parameter(get_parameter(np,internal_np::convergence_ratio),0.02); + double freeze_bound=choose_parameter(get_parameter(np,internal_np::vertex_freeze_bound),0.01); + bool do_freeze=choose_parameter(get_parameter(np,internal_np::freeze),true); + return odt_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iteration_number, convergence, freeze_bound, do_freeze); +} + +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return odt_optimize_periodic_3_mesh_3(c3t3, domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code odt_optimize_periodic_3_mesh_3(const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return odt_optimize_periodic_3_mesh_3(internal_np::combine_named_parameters(np1, np2, nps...)); } // ------------------------------- lloyd optimizer ----------------------------- - -BOOST_PARAMETER_FUNCTION( - (Mesh_optimization_return_code), - lloyd_optimize_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*)) - (optional - (time_limit_, *, 0) - (max_iteration_number_, *, 0) - (convergence_, *, parameters::default_values_for_mesh_3::lloyd_convergence_ratio) - (freeze_bound_, *, parameters::default_values_for_mesh_3::lloyd_freeze_ratio) - (do_freeze_, *, parameters::default_values_for_mesh_3::do_freeze) - ) -) +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization + * process based on the minimization of a global energy function. + * + * This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. + * Further information can be found in the documentation of the function `lloyd_optimize_mesh_3()`. + * + * \note This function requires the \ref thirdpartyEigen library. +*/ +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain,const CGAL_NP_CLASS& np = parameters::default_values()) { - return lloyd_optimize_mesh_3_impl(c3t3, domain, - time_limit_, max_iteration_number_, - convergence_, freeze_bound_, do_freeze_); + using parameters::choose_parameter; + using parameters::get_parameter; + std::size_t max_iterations = choose_parameter(get_parameter(np, internal_np::number_of_iterations), 0); + const double convergence_ratio = choose_parameter(get_parameter(np, internal_np::convergence_ratio), 0.02); + const double freeze_bound = choose_parameter(get_parameter(np, internal_np::vertex_freeze_bound), 0.001); + const double time_limit = choose_parameter(get_parameter(np, internal_np::maximum_running_time), 0.); + bool do_freeze = choose_parameter(get_parameter(np,internal_np::freeze),true); + return lloyd_optimize_mesh_3_impl(c3t3, domain, time_limit, max_iterations, convergence_ratio, freeze_bound, do_freeze); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +// Overload handling parameters passed with operator= +template +Mesh_optimization_return_code lloyd_optimize_periodic_3_mesh_3(C3T3& c3t3,MeshDomain& domain, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return lloyd_optimize_periodic_3_mesh_3(c3t3,domain, internal_np::combine_named_parameters(np1, np2, nps...)); +} } // namespace CGAL diff --git a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h index de1b05fbf0a..a26050181ae 100644 --- a/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/refine_periodic_3_mesh_3.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -133,51 +133,208 @@ void project_points(C3T3& c3t3, } // namespace internal -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable:4003) // not enough actual parameters for macro -#endif - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_FUNCTION( - (void), - refine_periodic_3_mesh_3, - parameters::tag, - (required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced - (deduced - (optional - (exude_param, (parameters::internal::Exude_options), parameters::no_exude()) // another default parameter distinct from Mesh_3 - (perturb_param, (parameters::internal::Perturb_options), parameters::no_perturb()) // another default parameter distinct from Mesh_3 - (odt_param, (parameters::internal::Odt_options), parameters::no_odt()) - (lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd()) - (reset_param, (parameters::Reset), parameters::reset_c3t3()) - (mesh_options_param, (parameters::internal::Mesh_3_options), - parameters::internal::Mesh_3_options()) - (manifold_options_param, (parameters::internal::Manifold_options), - parameters::internal::Manifold_options()) - ) - ) -) +/*! + * \ingroup PkgPeriodic3Mesh3Functions + * + * The function `refine_periodic_3_mesh_3()` is a 3D periodic + * mesh generator. It produces periodic simplicial meshes which discretize + * 3D periodic domains. + * + * The periodic mesh generation algorithm is a Delaunay refinement process + * followed by an optimization phase. + * The criteria driving the Delaunay refinement + * process may be tuned to achieve the user needs with respect to + * the size of mesh elements, the accuracy of boundaries approximation, etc. + * + * The optimization phase is a sequence of optimization processes, + * amongst the following available optimizers: an ODT-smoothing, + * a Lloyd smoothing, a sliver perturber, and a sliver exuder. + * Each optimization process can be activated or not, according to the user requirements + * and available time. + * By default, only the perturber and the exuder are activated. + * Note that the benefits of the exuder will be lost if the mesh + * is further refined afterward. + * + * \attention The function template `refine_periodic_3_mesh_3()` may be used + * to refine a previously computed mesh, e.g.: + * \code{.cpp} + * C3T3 c3t3 = CGAL::make_periodic_3_mesh_3(domain,criteria); + * + * CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria); + * \endcode + * + * \attention Note that the triangulation must form at all times a simplicial complex within + * a single copy of the domain (see Sections \ref P3Triangulation3secspace and \ref P3Triangulation3secintro + * of the manual of 3D periodic triangulations). It is the responsability of the user to provide + * a triangulation that satisfies this condition when calling the refinement + * function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh + * complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` + * will always satisfy this condition. + * + * + * \tparam C3T3 is required to be a model of + * the concept + * `MeshComplex_3InTriangulation_3`. + * The argument `c3t3` is passed by + * reference as this object is modified by the refinement process. As the + * refinement process only adds points to the triangulation, all + * vertices of the triangulation of `c3t3` remain in the + * mesh during the refinement process. Object `c3t3` can be used to insert + * specific points in the domain to ensure that they will be contained in the + * final triangulation. + * The type `C3T3` is in particular required to provide a nested type + * `C3T3::Triangulation` for the 3D triangulation + * embedding the mesh. The vertex and cell base classes of the + * triangulation `C3T3::Triangulation` are required to be models of the + * concepts `MeshVertexBase_3` and `MeshCellBase_3` + * respectively. + * + * \tparam MD is required to be a model of + * the concept `Periodic_3MeshDomain_3` or of the refined concept + * `Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features + * of the input complex have to be accurately represented in the mesh. + * The argument `domain` is the sole link through which the domain + * to be discretized is known by the mesh generation algorithm. + * + * \tparam MC is required to be a model of the concept + * `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` + * if the domain has exposed features. The argument `criteria` of + * type `MC` specifies the + * size and shape requirements for mesh tetrahedra + * and surface facets. These criteria + * form the rules which drive the refinement process. All mesh elements + * satisfy those criteria at the end of the refinement process. + * In addition, if the domain has features, the argument + * `criteria` provides a sizing field to guide the discretization + * of 1-dimensional exposed features. + * + * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters + * + * \param c3t3 the mesh to be refined. + * \param domain the domain to be discretized + * \param criteria the criteria + * \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below: + * + * The following four parameters are optional optimization parameters. + * They control which optimization processes are performed + * and allow the user to tune the parameters of the optimization processes. + * Individual optimization parameters are not described here as they are + * internal types (see instead the documentation page of each optimizer). + * For each optimization algorithm, there exist two global functions + * that allow to enable or disable the optimizer: + * + * \cgalNamedParamsBegin + * \cgalParamSectionBegin{Topological options (manifoldness)} + * \cgalParamDescription{In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, + * three named parameters control this option: + *
      + *
    • `parameters::manifold()` + *
    • `parameters::manifold_with_boundary()` + *
    • `parameters::non_manifold()` + *
    + * Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold.} + * \cgalParamDefault{`parameters::non_manifold()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Lloyd optimization} + * \cgalParamDescription{`lloyd_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_lloyd()` + *
    • `parameters::lloyd_optimize_mesh_3()` + *
    } + * \cgalParamDefault{`parameters::no_lloyd()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{ODT optimization} + * \cgalParamDescription{`odt_optimize_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_odt()` + *
    • `parameters::odt()` + *
    } + * \cgalParamDefault{`parameters::no_odt()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh perturbation} + * \cgalParamDescription{`perturb_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::no_perturb()` + *
    • `parameters::perturb()` + *
    } + * \cgalParamDefault{`parameters::perturb()`} + * \cgalParamSectionEnd + * \cgalParamSectionBegin{Mesh exudation} + * \cgalParamDescription{`exude_mesh_3()` can optionally be called after the meshing process. + * Two named parameters control this behavior: + *
      + *
    • `parameters::exude()` + *
    • `parameters::no_exude()` + *
    } + * \cgalParamDefault{`parameters::exude()`} + * \cgalParamSectionEnd + * \cgalNamedParamsEnd + * + * The optimization parameters can be passed in arbitrary order. If one parameter + * is not passed, its default value is used. The default values are + * `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. + * Note that whatever may be the optimization processes activated, + * they are always launched in the order that is a suborder + * of the following (see user manual for further + * details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*. + * + * Beware that optimization of the mesh is obtained + * by perturbing mesh vertices and modifying the mesh connectivity + * and that this has an impact + * on the strict compliance to the refinement criteria. + * Though a strict compliance to mesh criteria + * is guaranteed at the end of the Delaunay refinement, this may no longer be true after + * some optimization processes. Also beware that the default behavior does involve some + * optimization processes. + * + * \sa `make_periodic_3_mesh_3()` + * \sa `refine_mesh_3()` + * \sa `exude_periodic_3_mesh_3()` + * \sa `perturb_periodic_3_mesh_3()` + * \sa `lloyd_optimize_periodic_3_mesh_3()` + * \sa `odt_optimize_periodic_3_mesh_3()` + */ +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values()) { - return refine_periodic_3_mesh_3_impl(c3t3, domain, criteria, + using parameters::choose_parameter; + using parameters::get_parameter; + parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude().v); + parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb().v); + parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt().v); + parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd().v); + bool reset = choose_parameter(get_parameter(np, internal_np::do_reset_c3t3), false); + parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options()); + parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options()); + + return refine_periodic_3_mesh_3_impl(c3t3, + domain, + criteria, exude_param, perturb_param, odt_param, lloyd_param, - reset_param(), + reset, mesh_options_param, manifold_options_param); } -CGAL_PRAGMA_DIAG_POP - -#if defined(BOOST_MSVC) -# pragma warning(pop) -#endif +#ifndef DOXYGEN_RUNNING +// Overload handling parameters passed with operator= +template +void refine_periodic_3_mesh_3(C3T3& c3t3, MeshDomain& domain, MeshCriteria& criteria, + const CGAL_NP_CLASS_1& np1, + const CGAL_NP_CLASS_2& np2, + const NP& ... nps) +{ + return refine_periodic_3_mesh_3(c3t3, domain, criteria, internal_np::combine_named_parameters(np1, np2, nps...)); +} /** * @brief This function refines the mesh c3t3 wrt domain & criteria @@ -185,11 +342,11 @@ CGAL_PRAGMA_DIAG_POP * @param c3t3 the mesh to be refined. * @param domain the domain to be discretized * @param criteria the criteria - * @param exude if \c true, an exudation step will be done at + * @param exude if `true`, an exudation step will be done at * the end of the Delaunay refinement process - * @param perturb if \c true, an explicit vertex perturbation step will be + * @param perturb if `true`, an explicit vertex perturbation step will be * done at the end of refinement process - * @param reset_c3t3 if \c true, a new C3T3 will be construct from param c3t3. + * @param reset_c3t3 if `true`, a new C3T3 will be construct from param c3t3. * The new c3t3 keeps only the vertices (as NON-weighted points with their * dimension and Index) of the triangulation. That allows to refine a mesh * which has been exuded. @@ -309,6 +466,7 @@ void refine_periodic_3_mesh_3_impl(C3T3& c3t3, CGAL_expensive_postcondition(c3t3.triangulation().is_valid()); CGAL_expensive_postcondition(c3t3.is_valid()); } +#endif //DOXYGEN_RUNNING } // end namespace CGAL diff --git a/Periodic_3_mesh_3/package_info/Periodic_3_mesh_3/dependencies b/Periodic_3_mesh_3/package_info/Periodic_3_mesh_3/dependencies index daab68c8c70..eb2b8e24cc3 100644 --- a/Periodic_3_mesh_3/package_info/Periodic_3_mesh_3/dependencies +++ b/Periodic_3_mesh_3/package_info/Periodic_3_mesh_3/dependencies @@ -28,12 +28,11 @@ Principal_component_analysis_LGPL Profiling_tools Property_map Random_numbers +SMDS_3 STL_Extension Solver_interface Spatial_sorting Stream_support -SMDS_3 TDS_3 Triangulation_3 Union_find - diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp index 64ed148670d..513e34d5ebc 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/Scene.cpp @@ -12,7 +12,7 @@ * * The above copyright notice including the dates of first publication and * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ + * https://spdx.org/licenses/SGI-B-2.0.html * shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/resources/about.html b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/resources/about.html index bf9e3becae7..9816a12a0c3 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/resources/about.html +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/resources/about.html @@ -2,8 +2,8 @@

    CGAL Periodic Delaunay Triangulation

    Copyright ©2008-2009
    - INRIA Sophia Antipolis - Mediterranee

    -

    This application illustrates the 3D Periodic Delaunay Triangulation + INRIA Sophia Antipolis - Mediterranee

    +

    This application illustrates the 3D Periodic Delaunay Triangulation of CGAL.

    See also the package manual:
    diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h index 6173cd701a0..eed30ec2d3b 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/Scene.h @@ -62,8 +62,8 @@ struct Scene { y = (y < d.ymin() ? y+d.ymax()-d.ymin() : (y >= d.ymax() ? y-d.ymax()+d.ymin() : y)); - CGAL_triangulation_postcondition((d.xmin()<=x)&&(xfirst->vertex(i); if(squared_distance(p1,p2) > edge_length_threshold) { - CGAL_triangulation_assertion(find(too_long_edges[v_no].begin(), - too_long_edges[v_no].end(), - edge_to_add.second) == too_long_edges[v_no].end()); + CGAL_assertion(find(too_long_edges[v_no].begin(), + too_long_edges[v_no].end(), + edge_to_add.second) == too_long_edges[v_no].end()); too_long_edges[v_no].push_back(edge_to_add.second); ++too_long_edge_counter; } @@ -316,8 +316,8 @@ public: void create_initial_triangulation() { // create the base for too_long_edges; - CGAL_triangulation_assertion( too_long_edges.empty() ); - CGAL_triangulation_assertion(too_long_edge_counter == 0); + CGAL_assertion( too_long_edges.empty() ); + CGAL_assertion(too_long_edge_counter == 0); for(Vertex_iterator vit = vertices_begin(); vit !=vertices_end(); ++vit ) too_long_edges[vit] = std::list();; @@ -374,7 +374,7 @@ public: template void insert_too_long_edges(Vertex_handle v, const CellIt begin, const CellIt end) { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); // add newly added edges to too_long_edges, if necessary. Point p1,p2; std::pair< Vertex_handle, Vertex_handle > edge_to_add; @@ -389,7 +389,7 @@ public: if(&*((*it)->vertex(j)) > &*((*it)->vertex(k))) continue; // make the offsets canonical (wrt. to some notion) // add to too_long_edges, if not yet added and if "too long" - CGAL_triangulation_precondition( + CGAL_precondition( &*((*it)->vertex(j))< &*((*it)->vertex(k))); edge_to_add = std::make_pair((*it)->vertex(j), (*it)->vertex(k)); @@ -906,7 +906,7 @@ typename Periodic_3_Delaunay_triangulation_3::Vertex_handle Periodic_3_Delaunay_triangulation_3::nearest_vertex_in_cell( const Cell_handle& c, const Point& p, const Offset& o) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Vertex_handle nearest = c->vertex(0); for(int i=1; i<4; i++) { nearest = (compare_distance(p,nearest->point(),c->vertex(i)->point(), @@ -925,12 +925,12 @@ typename Periodic_3_Delaunay_triangulation_3::Vertex_handle Periodic_3_Delaunay_triangulation_3:: move_point(Vertex_handle v, const Point& p) { - CGAL_triangulation_expensive_precondition(is_vertex(v)); + CGAL_expensive_precondition(is_vertex(v)); // Remember an incident vertex to restart // the point location after the removal. // Cell_handle c = v->cell(); //Vertex_handle old_neighbor = c->vertex(c->index(v) == 0 ? 1 : 0); - // CGAL_triangulation_assertion(old_neighbor != v); + // CGAL_assertion(old_neighbor != v); remove(v); @@ -953,7 +953,7 @@ void Periodic_3_Delaunay_triangulation_3::remove(Vertex_handle v) Cover_manager cover_manager(*this); Base::remove(v, remover, ct, cover_manager); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); } // Undocumented function that tries to remove 'v' but only does so if removal @@ -964,7 +964,7 @@ bool Periodic_3_Delaunay_triangulation_3:: remove_if_no_cover_change(Vertex_handle v) { - CGAL_triangulation_precondition(this->is_1_cover()); + CGAL_precondition(this->is_1_cover()); // Since we are in a 1-sheet configuration, we can call directly periodic_remove() // and don't need the conflict tester. The rest is copied from above. @@ -985,8 +985,8 @@ remove_if_no_cover_change(Vertex_handle v) return false; // removing would cause a cover change } - CGAL_triangulation_expensive_postcondition(is_valid()); - CGAL_triangulation_postcondition(this->is_1_cover()); + CGAL_expensive_postcondition(is_valid()); + CGAL_postcondition(this->is_1_cover()); return true; // successfully removed the vertex } @@ -999,7 +999,7 @@ Periodic_3_Delaunay_triangulation_3::find_conflicts( const Point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); std::vector facets; facets.reserve(64); @@ -1097,7 +1097,7 @@ _side_of_sphere(const Cell_handle& c, const Point& q, // 2 iterations are enough (cf paper) for(int i=4; i>2; --i) { if(points[i] == &pts[4]) { - CGAL_triangulation_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) + CGAL_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE); // since p0 p1 p2 p3 are non coplanar and positively oriented return ON_UNBOUNDED_SIDE; @@ -1121,7 +1121,7 @@ _side_of_sphere(const Cell_handle& c, const Point& q, } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -1129,7 +1129,7 @@ template < class Gt, class Tds > bool Periodic_3_Delaunay_triangulation_3:: is_Gabriel(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1300,7 +1300,7 @@ public: bool test_initial_cell(Cell_handle c, const Offset &off) const { if(!(operator()(c, off))) - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return true; } @@ -1339,11 +1339,11 @@ public: inline void hide_point(Cell_handle, const Point &) { } inline void hide(Point &, Cell_handle ) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } inline void do_hide(const Point &, Cell_handle ) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } template < class Tester > inline bool replace_vertex(const Point &, Vertex_handle , @@ -1463,7 +1463,7 @@ operator>> (std::istream& is, Periodic_3_Delaunay_triangulation_3 &tr) tr.compute_too_long_edges(); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h index ca7124d8688..d1b13b8e804 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -46,13 +46,13 @@ public: int &operator[](int i) { if (i==0) return _offx; if (i==1) return _offy; - CGAL_triangulation_assertion(i==2); + CGAL_assertion(i==2); return _offz; } int operator[](int i) const { if (i==0) return _offx; if (i==1) return _offy; - CGAL_triangulation_assertion(i==2); + CGAL_assertion(i==2); return _offz; } void operator+=(const Periodic_3_offset_3 &other) { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h index 65ff47224f3..d59967f0055 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_regular_triangulation_3.h @@ -250,8 +250,8 @@ public: if(!is_1_cover()) insert_cells_with_too_big_orthoball(tr.cells_begin(), tr.cells_end()); - CGAL_triangulation_expensive_postcondition(*this == tr); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(is_valid()); } Periodic_3_regular_triangulation_3 operator=(Periodic_3_regular_triangulation_3 tr) @@ -269,7 +269,7 @@ public: void create_initial_triangulation() { - CGAL_triangulation_assertion( cells_with_too_big_orthoball.empty() ); + CGAL_assertion( cells_with_too_big_orthoball.empty() ); for(Cell_iterator iter = cells_begin(), end_iter = cells_end(); iter != end_iter; ++iter) cells_with_too_big_orthoball.insert(iter); @@ -412,8 +412,8 @@ public: Conflict_tester tester(point, this); Point_hider hider(this); Cover_manager cover_manager(*this); - CGAL_triangulation_precondition(point.weight() >= 0); - CGAL_triangulation_precondition_msg + CGAL_precondition(point.weight() >= 0); + CGAL_precondition_msg ( point.weight() < orthosphere_radius_threshold , "point.weight() < 1/64 * domain_size * domain_size" @@ -428,8 +428,8 @@ public: Conflict_tester tester(point, this); Point_hider hider(this); Cover_manager cover_manager(*this); - CGAL_triangulation_precondition(point.weight() >= 0); - CGAL_triangulation_precondition_msg + CGAL_precondition(point.weight() >= 0); + CGAL_precondition_msg ( point.weight() < orthosphere_radius_threshold, "point.weight() < 1/64 * domain_size * domain_size" @@ -444,7 +444,7 @@ public: if(first == last) return 0; - CGAL_triangulation_precondition_code + CGAL_precondition_code ( bool precondition_is_satisfied = true; for(InputIterator pc_first = first, pc_last = last; pc_first != pc_last; ++pc_first) @@ -457,7 +457,7 @@ public: } ) - CGAL_triangulation_precondition_msg + CGAL_precondition_msg ( precondition_is_satisfied, "0 <= point.weight() < 1/64 * domain_size * domain_size" @@ -555,7 +555,7 @@ public: insert(*hi); } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } // Undocumented function that tries to remove 'v' but only does so if removal @@ -563,7 +563,7 @@ public: // \pre the triangulation is 1-sheeted bool remove_if_no_cover_change(Vertex_handle v) { - CGAL_triangulation_precondition(this->is_1_cover()); + CGAL_precondition(this->is_1_cover()); // Since we are in a 1-sheet configuration, we can call directly periodic_remove() // and don't need the conflict tester. The rest is copied from above. @@ -591,8 +591,8 @@ public: insert(*hi); } - CGAL_triangulation_expensive_postcondition(is_valid()); - CGAL_triangulation_postcondition(this->is_1_cover()); + CGAL_expensive_postcondition(is_valid()); + CGAL_postcondition(this->is_1_cover()); return true; // successfully removed the vertex } @@ -648,7 +648,7 @@ public: Oriented_side power_side_of_oriented_power_sphere(const Weighted_point &p, const Weighted_point &q) const { - CGAL_triangulation_precondition(this->equal(p, q)); + CGAL_precondition(this->equal(p, q)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q); } Oriented_side power_side_of_oriented_power_sphere(const Weighted_point &p, const Weighted_point &q, @@ -700,7 +700,7 @@ public: const Offset& o3 = this->get_offset(c,3); const Offset& oq = offset; - CGAL_triangulation_precondition( orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE ); + CGAL_precondition( orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE ); Oriented_side os = ON_NEGATIVE_SIDE; os = power_side_of_oriented_power_sphere(p0, p1, p2, p3, q, o0, o1, o2, o3, oq); @@ -721,7 +721,7 @@ public: // of the determinant has non null coefficient. for(int i=4; i>1; --i) { if(points[i] == &pts[4]) { - CGAL_triangulation_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) + CGAL_assertion(orientation(p0, p1, p2, p3, o0, o1, o2, o3) == POSITIVE); // since p0 p1 p2 p3 are non coplanar and positively oriented return ON_UNBOUNDED_SIDE; @@ -745,7 +745,7 @@ public: } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -802,12 +802,12 @@ public: CGAL_precondition(CGAL::abs(move.z()) < domain().zmax() - domain().zmin() ); // 'new_position' must be canonical - CGAL_triangulation_precondition(new_position.x() < domain().xmax()); - CGAL_triangulation_precondition(new_position.y() < domain().ymax()); - CGAL_triangulation_precondition(new_position.z() < domain().zmax()); - CGAL_triangulation_precondition(new_position.x() >= domain().xmin()); - CGAL_triangulation_precondition(new_position.y() >= domain().ymin()); - CGAL_triangulation_precondition(new_position.z() >= domain().zmin()); + CGAL_precondition(new_position.x() < domain().xmax()); + CGAL_precondition(new_position.y() < domain().ymax()); + CGAL_precondition(new_position.z() < domain().zmax()); + CGAL_precondition(new_position.x() >= domain().xmin()); + CGAL_precondition(new_position.y() >= domain().ymin()); + CGAL_precondition(new_position.z() >= domain().zmin()); if(new_position == v->point()) return; @@ -936,9 +936,9 @@ public: std::cout << "moved v to " << v->point() << std::endl; #endif - CGAL_triangulation_precondition(!(v->point().x() < domain().xmin()) && v->point().x() < domain().xmax()); - CGAL_triangulation_precondition(!(v->point().y() < domain().ymin()) && v->point().y() < domain().ymax()); - CGAL_triangulation_precondition(!(v->point().z() < domain().zmin()) && v->point().z() < domain().zmax()); + CGAL_precondition(!(v->point().x() < domain().xmin()) && v->point().x() < domain().xmax()); + CGAL_precondition(!(v->point().y() < domain().ymin()) && v->point().y() < domain().ymax()); + CGAL_precondition(!(v->point().z() < domain().zmin()) && v->point().z() < domain().zmax()); } Weighted_point point(const Periodic_weighted_point& pp) const @@ -968,12 +968,12 @@ public: Vertex_handle nearest_power_vertex(const Bare_point& p, Cell_handle start) const { - CGAL_triangulation_precondition(p.x() < domain().xmax()); - CGAL_triangulation_precondition(p.y() < domain().ymax()); - CGAL_triangulation_precondition(p.z() < domain().zmax()); - CGAL_triangulation_precondition(p.x() >= domain().xmin()); - CGAL_triangulation_precondition(p.y() >= domain().ymin()); - CGAL_triangulation_precondition(p.z() >= domain().zmin()); + CGAL_precondition(p.x() < domain().xmax()); + CGAL_precondition(p.y() < domain().ymax()); + CGAL_precondition(p.z() < domain().zmax()); + CGAL_precondition(p.x() >= domain().xmin()); + CGAL_precondition(p.y() >= domain().ymin()); + CGAL_precondition(p.z() >= domain().zmin()); if(number_of_vertices() == 0) return Vertex_handle(); @@ -1067,7 +1067,7 @@ public: bool is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_power_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -1102,7 +1102,7 @@ public: bool is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_power_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -1186,12 +1186,12 @@ public: // offsets to find the minimum Offset get_min_dist_offset_general(const Bare_point& p, const Vertex_handle vh) const { - CGAL_triangulation_precondition(p.x() < domain().xmax()); - CGAL_triangulation_precondition(p.y() < domain().ymax()); - CGAL_triangulation_precondition(p.z() < domain().zmax()); - CGAL_triangulation_precondition(p.x() >= domain().xmin()); - CGAL_triangulation_precondition(p.y() >= domain().ymin()); - CGAL_triangulation_precondition(p.z() >= domain().zmin()); + CGAL_precondition(p.x() < domain().xmax()); + CGAL_precondition(p.y() < domain().ymax()); + CGAL_precondition(p.z() < domain().zmax()); + CGAL_precondition(p.x() >= domain().xmin()); + CGAL_precondition(p.y() >= domain().ymin()); + CGAL_precondition(p.z() >= domain().zmin()); Offset min_off = Offset(0,0,0); @@ -1215,7 +1215,7 @@ public: Vertex_handle nearest_vertex_in_cell(const Cell_handle& c, const Bare_point& p, const Offset & o) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); Vertex_handle nearest = c->vertex(0); for(int i=1; i<4; i++) { @@ -1384,7 +1384,7 @@ public: OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit) const { - CGAL_triangulation_precondition(number_of_vertices() != 0); + CGAL_precondition(number_of_vertices() != 0); std::vector facets; facets.reserve(64); @@ -1671,12 +1671,12 @@ public: // inline void hide(Weighted_point&, Cell_handle ) const // useless? // { -// CGAL_triangulation_assertion(false); +// CGAL_assertion(false); // } // // inline void do_hide(const Weighted_point&, Cell_handle ) const // useless? // { -// CGAL_triangulation_assertion(false); +// CGAL_assertion(false); // } // template < class Tester > @@ -1755,7 +1755,7 @@ operator>> (std::istream& is, Periodic_3_regular_triangulation_3& tr) tr.insert_cells_with_too_big_orthoball(tr.cells_begin(), tr.cells_end()); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 60ead7714a3..7f3f5de89a4 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -262,12 +262,12 @@ public: typedef typename internal::Exact_field_selector::Type EFT; typedef NT_converter NTC; CGAL_USE_TYPE(NTC); - CGAL_triangulation_precondition_code( NTC ntc; ) - CGAL_triangulation_precondition(ntc(domain.xmax())-ntc(domain.xmin()) + CGAL_precondition_code( NTC ntc; ) + CGAL_precondition(ntc(domain.xmax())-ntc(domain.xmin()) == ntc(domain.ymax())-ntc(domain.ymin())); - CGAL_triangulation_precondition(ntc(domain.ymax())-ntc(domain.ymin()) + CGAL_precondition(ntc(domain.ymax())-ntc(domain.ymin()) == ntc(domain.zmax())-ntc(domain.zmin())); - CGAL_triangulation_precondition(ntc(domain.zmax())-ntc(domain.zmin()) + CGAL_precondition(ntc(domain.zmax())-ntc(domain.zmin()) == ntc(domain.xmax())-ntc(domain.xmin())); _gt.set_domain(domain); @@ -290,8 +290,8 @@ public: else copy_multiple_covering(tr); - CGAL_triangulation_expensive_postcondition(*this == tr); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(is_valid()); } virtual ~Periodic_3_triangulation_3() {} @@ -316,7 +316,7 @@ public: { vlist.push_back(vit); virtual_vertices_reverse.insert(std::make_pair(vit,std::vector(26))); - CGAL_triangulation_assertion(virtual_vertices_reverse.find(vit)->second.size() == 26); + CGAL_assertion(virtual_vertices_reverse.find(vit)->second.size() == 26); } } @@ -332,7 +332,7 @@ public: Offset off = vit2->offset(); virtual_vertices.insert(std::make_pair(vit2, std::make_pair(*vlist_it,off))); virtual_vertices_reverse.find(*vlist_it)->second[9*off[0]+3*off[1]+off[2]-1] = vit2; - CGAL_triangulation_assertion(get_offset(vit2) == off); + CGAL_assertion(get_offset(vit2) == off); } } @@ -412,9 +412,9 @@ public: } const std::vector& periodic_copies(const Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_sheets() != CGAL::make_array(1,1,1)); - CGAL_triangulation_precondition(virtual_vertices.find(v) == virtual_vertices.end()); - CGAL_triangulation_assertion( + CGAL_precondition(number_of_sheets() != CGAL::make_array(1,1,1)); + CGAL_precondition(virtual_vertices.find(v) == virtual_vertices.end()); + CGAL_assertion( virtual_vertices_reverse.find(v) != virtual_vertices_reverse.end()); return virtual_vertices_reverse.find(v)->second; } @@ -480,9 +480,9 @@ public: // Offset converters int off_to_int(const Offset& off) const { - CGAL_triangulation_assertion( off.x() == 0 || off.x() == 1 ); - CGAL_triangulation_assertion( off.y() == 0 || off.y() == 1 ); - CGAL_triangulation_assertion( off.z() == 0 || off.z() == 1 ); + CGAL_assertion( off.x() == 0 || off.x() == 1 ); + CGAL_assertion( off.y() == 0 || off.y() == 1 ); + CGAL_assertion( off.z() == 0 || off.z() == 1 ); int i = ((off.x()&1)<<2) + ((off.y()&1)<<1) + ((off.z()&1)); return i; } @@ -529,24 +529,24 @@ public: } } - CGAL_triangulation_assertion((std::min)((std::min)(off0[0],off1[0]), + CGAL_assertion((std::min)((std::min)(off0[0],off1[0]), (std::min)(off2[0],off3[0])) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[1],off1[1]), + CGAL_assertion((std::min)((std::min)(off0[1],off1[1]), (std::min)(off2[1],off3[1])) == 0); - CGAL_triangulation_assertion((std::min)((std::min)(off0[2],off1[2]), + CGAL_assertion((std::min)((std::min)(off0[2],off1[2]), (std::min)(off2[2],off3[2])) == 0); - CGAL_triangulation_assertion((0 <= off0[0]) && (off0[0] < 2)); - CGAL_triangulation_assertion((0 <= off1[0]) && (off1[0] < 2)); - CGAL_triangulation_assertion((0 <= off2[0]) && (off2[0] < 2)); - CGAL_triangulation_assertion((0 <= off3[0]) && (off3[0] < 2)); - CGAL_triangulation_assertion((0 <= off0[1]) && (off0[1] < 2)); - CGAL_triangulation_assertion((0 <= off1[1]) && (off1[1] < 2)); - CGAL_triangulation_assertion((0 <= off2[1]) && (off2[1] < 2)); - CGAL_triangulation_assertion((0 <= off3[1]) && (off3[1] < 2)); - CGAL_triangulation_assertion((0 <= off0[2]) && (off0[2] < 2)); - CGAL_triangulation_assertion((0 <= off1[2]) && (off1[2] < 2)); - CGAL_triangulation_assertion((0 <= off2[2]) && (off2[2] < 2)); - CGAL_triangulation_assertion((0 <= off3[2]) && (off3[2] < 2)); + CGAL_assertion((0 <= off0[0]) && (off0[0] < 2)); + CGAL_assertion((0 <= off1[0]) && (off1[0] < 2)); + CGAL_assertion((0 <= off2[0]) && (off2[0] < 2)); + CGAL_assertion((0 <= off3[0]) && (off3[0] < 2)); + CGAL_assertion((0 <= off0[1]) && (off0[1] < 2)); + CGAL_assertion((0 <= off1[1]) && (off1[1] < 2)); + CGAL_assertion((0 <= off2[1]) && (off2[1] < 2)); + CGAL_assertion((0 <= off3[1]) && (off3[1] < 2)); + CGAL_assertion((0 <= off0[2]) && (off0[2] < 2)); + CGAL_assertion((0 <= off1[2]) && (off1[2] < 2)); + CGAL_assertion((0 <= off2[2]) && (off2[2] < 2)); + CGAL_assertion((0 <= off3[2]) && (off3[2] < 2)); int o0i = ((off0[0]&1)<<2)+((off0[1]&1)<<1)+(off0[2]&1); int o1i = ((off1[0]&1)<<2)+((off1[1]&1)<<1)+(off1[2]&1); @@ -822,9 +822,9 @@ public: } Periodic_segment periodic_segment(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition( i != j ); - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 3 && j >= 0 && j <= 3 ); + CGAL_precondition( i != j ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 3 && j >= 0 && j <= 3 ); return CGAL::make_array(std::make_pair(c->vertex(i)->point(), get_offset(c,i)), std::make_pair(c->vertex(j)->point(), get_offset(c,j))); } @@ -880,8 +880,8 @@ public: } Periodic_triangle periodic_triangle(const Cell_handle c, int i) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( i >= 0 && i <= 3 ); if( (i&1)==0 ) return CGAL::make_array(std::make_pair(c->vertex((i+2)&3)->point(), get_offset(c,(i+2)&3)), std::make_pair(c->vertex((i+1)&3)->point(), get_offset(c,(i+1)&3)), @@ -952,7 +952,7 @@ public: Periodic_tetrahedron periodic_tetrahedron(const Cell_handle c) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); return CGAL::make_array(std::make_pair(c->vertex(0)->point(), get_offset(c,0)), std::make_pair(c->vertex(1)->point(), get_offset(c,1)), std::make_pair(c->vertex(2)->point(), get_offset(c,2)), @@ -1349,21 +1349,21 @@ protected: std::vector double_vertices; Locate_type lt = Locate_type(); int li=0, lj=0; - CGAL_triangulation_assertion_code( Locate_type lta = Locate_type(); ) - CGAL_triangulation_assertion_code( int ia = 0; ) - CGAL_triangulation_assertion_code( int ja = 0; ) + CGAL_assertion_code( Locate_type lta = Locate_type(); ) + CGAL_assertion_code( int ia = 0; ) + CGAL_assertion_code( int ja = 0; ) Cell_handle hint; while(begin!=end) { tester.set_point(*begin); Offset lo; hint = periodic_locate(*begin, Offset(), lo, lt, li, lj, start); - CGAL_triangulation_assertion_code( if(number_of_vertices() != 0) { ); - CGAL_triangulation_assertion(side_of_cell( + CGAL_assertion_code( if(number_of_vertices() != 0) { ); + CGAL_assertion(side_of_cell( *begin,Offset(), hint, lta, ia, ja) != ON_UNBOUNDED_SIDE); - CGAL_triangulation_assertion(lta == lt); - CGAL_triangulation_assertion(ia == li); - CGAL_triangulation_assertion(ja == lj); - CGAL_triangulation_assertion_code( } + CGAL_assertion(lta == lt); + CGAL_assertion(ia == li); + CGAL_assertion(ja == lj); + CGAL_assertion_code( } ); new_vertex = insert_in_conflict(*begin,lt,hint,li,lj,tester,hider, cover_manager); @@ -1416,7 +1416,7 @@ protected: typename Virtual_vertex_reverse_map::iterator origin_it = this->virtual_vertices_reverse.find(vh); std::vector& copies = origin_it->second; typename std::vector::iterator copy_iter = std::find(copies.begin(), copies.end(), vertex_handle); - CGAL_triangulation_assertion(copy_iter != copies.end()); + CGAL_assertion(copy_iter != copies.end()); copies.erase(copy_iter); if(copies.empty()) virtual_vertices_reverse.erase(origin_it); @@ -1424,8 +1424,8 @@ protected: return; } - CGAL_triangulation_assertion(this->virtual_vertices.find(vertex_handle) == this->virtual_vertices.end()); - CGAL_triangulation_assertion(this->virtual_vertices_reverse.find(vertex_handle) == this->virtual_vertices_reverse.end()); + CGAL_assertion(this->virtual_vertices.find(vertex_handle) == this->virtual_vertices.end()); + CGAL_assertion(this->virtual_vertices_reverse.find(vertex_handle) == this->virtual_vertices_reverse.end()); } public: @@ -1760,7 +1760,7 @@ protected: Periodic_point_3 periodic_circumcenter(Cell_handle c, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_precondition(c != Cell_handle()); + CGAL_precondition(c != Cell_handle()); Point_3 p = construct_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point(), c->vertex(3)->point(), @@ -1820,7 +1820,7 @@ protected: bool canonical_dual_segment(Cell_handle c, int i, Periodic_segment_3& ps, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_precondition(c != Cell_handle()); + CGAL_precondition(c != Cell_handle()); Offset off = neighbor_offset(c,i,c->neighbor(i)); Periodic_point_3 p1 = periodic_circumcenter(c, construct_circumcenter); Periodic_point_3 p2 = periodic_circumcenter(c->neighbor(i), construct_circumcenter); @@ -1879,7 +1879,7 @@ protected: template Stream& draw_dual(Stream& os, ConstructCircumcenter construct_circumcenter) const { - CGAL_triangulation_assertion_code( unsigned int i = 0; ) + CGAL_assertion_code( unsigned int i = 0; ) for(Facet_iterator fit = facets_begin(), end = facets_end(); fit != end; ++fit) { if(!is_canonical(*fit)) @@ -1888,11 +1888,11 @@ protected: Periodic_segment_3 pso; canonical_dual_segment(fit->first, fit->second, pso, construct_circumcenter); Segment so = construct_segment(pso); - CGAL_triangulation_assertion_code ( ++i; ) + CGAL_assertion_code ( ++i; ) os << so.source() << '\n'; os << so.target() << '\n'; } - CGAL_triangulation_assertion( i == number_of_facets() ); + CGAL_assertion( i == number_of_facets() ); return os; } @@ -1988,9 +1988,9 @@ protected: z = (z < d.zmin() ? z+d.zmax()-d.zmin() : (z >= d.zmax() ? z-d.zmax()+d.zmin() : z)); - CGAL_triangulation_postcondition((d.xmin()<=x)&&(xneighbor(0)->neighbor( + CGAL_postcondition(start!=Cell_handle()); + CGAL_assertion(start->neighbor(0)->neighbor( start->neighbor(0)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(1)->neighbor( + CGAL_assertion(start->neighbor(1)->neighbor( start->neighbor(1)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(2)->neighbor( + CGAL_assertion(start->neighbor(2)->neighbor( start->neighbor(2)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(3)->neighbor( + CGAL_assertion(start->neighbor(3)->neighbor( start->neighbor(3)->index(start))==start); // We implement the remembering visibility/stochastic walk. @@ -2181,7 +2181,7 @@ try_next_cell: continue; } - CGAL_triangulation_assertion(next->neighbor(next->index(c)) == c); + CGAL_assertion(next->neighbor(next->index(c)) == c); // We temporarily put p at i's place in pts. const Point* backup = pts[i]; @@ -2251,7 +2251,7 @@ try_next_cell: break; default: // the point cannot lie on four facets - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } lo = off_query; @@ -2272,7 +2272,7 @@ inexact_periodic_locate(const Point& p, const Offset& o_p, if(number_of_vertices() == 0) { return Cell_handle(); } - CGAL_triangulation_assertion(number_of_vertices() != 0); + CGAL_assertion(number_of_vertices() != 0); if(start == Cell_handle()) { start = cells_begin(); @@ -2289,14 +2289,14 @@ inexact_periodic_locate(const Point& p, const Offset& o_p, off_query += Offset(0,0,1); } - CGAL_triangulation_postcondition(start!=Cell_handle()); - CGAL_triangulation_assertion(start->neighbor(0)->neighbor( + CGAL_postcondition(start!=Cell_handle()); + CGAL_assertion(start->neighbor(0)->neighbor( start->neighbor(0)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(1)->neighbor( + CGAL_assertion(start->neighbor(1)->neighbor( start->neighbor(1)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(2)->neighbor( + CGAL_assertion(start->neighbor(2)->neighbor( start->neighbor(2)->index(start))==start); - CGAL_triangulation_assertion(start->neighbor(3)->neighbor( + CGAL_assertion(start->neighbor(3)->neighbor( start->neighbor(3)->index(start))==start); // We implement the remembering visibility/stochastic walk. @@ -2394,14 +2394,14 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( const Point& q, const Offset& off, Cell_handle c, Locate_type& lt, int& i, int& j) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); Orientation o0,o1,o2,o3; o0 = o1 = o2 = o3 = ZERO; int cumm_off = c->offset(0) | c->offset(1) | c->offset(2) | c->offset(3); if((cumm_off == 0) && (is_1_cover())) { - CGAL_triangulation_assertion(off == Offset()); + CGAL_assertion(off == Offset()); const Point& p0 = c->vertex(0)->point(); const Point& p1 = c->vertex(1)->point(); const Point& p2 = c->vertex(2)->point(); @@ -2421,7 +2421,7 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( p[i] = &(c->vertex(i)->point()); offs[i] = get_offset(c,i); } - CGAL_triangulation_assertion(orientation(*p[0], *p[1], *p[2], *p[3], + CGAL_assertion(orientation(*p[0], *p[1], *p[2], *p[3], offs[0], offs[1], offs[2], offs[3]) == POSITIVE); bool found=false; for(int i=0; (i<8)&&(!found); i++) { @@ -2491,7 +2491,7 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( default: { // impossible : cannot be on 4 facets for a real tetrahedron - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -2524,10 +2524,10 @@ Periodic_3_triangulation_3::periodic_insert( Point_hider& hider, CoverManager& cover_manager, Vertex_handle vh) { Vertex_handle v; - CGAL_triangulation_precondition(number_of_vertices() != 0); - CGAL_triangulation_assertion_code( + CGAL_precondition(number_of_vertices() != 0); + CGAL_assertion_code( Locate_type lt_assert; int i_assert; int j_assert;); - CGAL_triangulation_precondition(side_of_cell(tester.point(),o, c, + CGAL_precondition(side_of_cell(tester.point(),o, c, lt_assert, i_assert, j_assert) != ON_UNBOUNDED_SIDE); tester.set_offset(o); @@ -2536,7 +2536,7 @@ Periodic_3_triangulation_3::periodic_insert( bool found = false; Offset current_off = get_location_offset(tester, c, found); - CGAL_triangulation_assertion(side_of_cell(tester.point(), + CGAL_assertion(side_of_cell(tester.point(), combine_offsets(o,current_off),c,lt_assert,i_assert,j_assert) != ON_UNBOUNDED_SIDE); @@ -2595,7 +2595,7 @@ Periodic_3_triangulation_3::periodic_insert( v_offsets.clear(); if(vh != Vertex_handle()) { -// CGAL_triangulation_assertion(virtual_vertices.find(v) == virtual_vertices.end()); +// CGAL_assertion(virtual_vertices.find(v) == virtual_vertices.end()); virtual_vertices[v] = Virtual_vertex(vh,o); virtual_vertices_reverse[vh].push_back(v); } @@ -2641,8 +2641,8 @@ Periodic_3_triangulation_3::create_initial_triangulation(const Point& p) virtual_vertices_reverse[vir_vertices[0][0][0]].push_back( vir_vertices[i][j][k]); } - CGAL_triangulation_assertion(vir_vertices[i][j][k] != Vertex_handle()); - CGAL_triangulation_assertion(vir_vertices[0][0][0]->point() == p); + CGAL_assertion(vir_vertices[i][j][k] != Vertex_handle()); + CGAL_assertion(vir_vertices[0][0][0]->point() == p); } } } @@ -2655,7 +2655,7 @@ Periodic_3_triangulation_3::create_initial_triangulation(const Point& p) // 6 cells per 'cube' cells[i][j][k][l] = _tds.create_cell(); for(int n=0; n<4; n++) - CGAL_triangulation_assertion(cells[i][j][k][l] != Cell_handle()); + CGAL_assertion(cells[i][j][k][l] != Cell_handle()); } } } @@ -2781,8 +2781,8 @@ find_conflicts(Cell_handle d, const Offset& current_off, OutputIteratorCells, OutputIteratorInternalFacets> it) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); - CGAL_triangulation_precondition( tester(d, current_off) ); + CGAL_precondition( number_of_vertices() != 0 ); + CGAL_precondition( tester(d, current_off) ); std::stack > cell_stack; cell_stack.push(std::make_pair(d,current_off)); @@ -2849,11 +2849,11 @@ inline typename Periodic_3_triangulation_3::Vertex_handle Periodic_3_triangulation_3::insert_in_conflict(const Point& p, Locate_type lt, Cell_handle c, int li, int lj, const Conflict_tester& tester, Point_hider& hider, CoverManager& cover_manager) { - CGAL_triangulation_assertion((domain().xmin() <= p.x()) + CGAL_assertion((domain().xmin() <= p.x()) && (p.x() < domain().xmax())); - CGAL_triangulation_assertion((domain().ymin() <= p.y()) + CGAL_assertion((domain().ymin() <= p.y()) && (p.y() < domain().ymax())); - CGAL_triangulation_assertion((domain().zmin() <= p.z()) + CGAL_assertion((domain().zmin() <= p.z()) && (p.z() < domain().zmax())); if(number_of_vertices() == 0) { @@ -2874,14 +2874,14 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, vstart = c->vertex(0); else vstart = vvmit->second.first; - CGAL_triangulation_assertion(virtual_vertices.find(vstart) + CGAL_assertion(virtual_vertices.find(vstart) == virtual_vertices.end()); - CGAL_triangulation_assertion(virtual_vertices_reverse.find(vstart) + CGAL_assertion(virtual_vertices_reverse.find(vstart) != virtual_vertices_reverse.end()); } - CGAL_triangulation_assertion( number_of_vertices() != 0 ); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_assertion( number_of_vertices() != 0 ); + CGAL_expensive_assertion(is_valid()); hider.set_original_cube(true); Vertex_handle vh = periodic_insert(p, Offset(), lt, c, tester, hider, cover_manager); if(is_1_cover()) { @@ -2903,14 +2903,14 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, } } } - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); // Fall back to 1-cover if the criterion that the longest edge is shorter // than sqrt(0.166) is fulfilled. if( cover_manager.can_be_converted_to_1_sheet() ) { - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); convert_to_1_sheeted_covering(); - CGAL_triangulation_expensive_assertion( is_valid() ); + CGAL_expensive_assertion( is_valid() ); } return vh; } @@ -2918,17 +2918,17 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point& p, /// tests if two vertices of one cell are just periodic copies of each other template < class GT, class TDS > inline bool Periodic_3_triangulation_3::has_self_edges(Cell_handle c) const { - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(1)) || + CGAL_assertion((c->vertex(0) != c->vertex(1)) || (c->offset(0) != c->offset(1))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(2)) || + CGAL_assertion((c->vertex(0) != c->vertex(2)) || (c->offset(0) != c->offset(2))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(3)) || + CGAL_assertion((c->vertex(0) != c->vertex(3)) || (c->offset(0) != c->offset(3))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(2)) || + CGAL_assertion((c->vertex(1) != c->vertex(2)) || (c->offset(1) != c->offset(2))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(3)) || + CGAL_assertion((c->vertex(1) != c->vertex(3)) || (c->offset(1) != c->offset(3))); - CGAL_triangulation_assertion((c->vertex(2) != c->vertex(3)) || + CGAL_assertion((c->vertex(2) != c->vertex(3)) || (c->offset(2) != c->offset(3))); return ((c->vertex(0) == c->vertex(1)) || (c->vertex(0) == c->vertex(2)) || @@ -2964,8 +2964,8 @@ is_valid(bool verbose, int level) const iter_2 != end_iter_2; ++iter_2) { - CGAL_triangulation_assertion(virtual_vertices.find(*iter_2) != virtual_vertices.end()); - CGAL_triangulation_assertion(virtual_vertices.at(*iter_2).first == iter->first); + CGAL_assertion(virtual_vertices.find(*iter_2) != virtual_vertices.end()); + CGAL_assertion(virtual_vertices.at(*iter_2).first == iter->first); } } } @@ -2974,10 +2974,10 @@ is_valid(bool verbose, int level) const for(Cell_iterator cit = cells_begin(); cit != cells_end(); ++cit) { for(int i=0; i<4; i++) { - CGAL_triangulation_assertion(cit != cit->neighbor(i)); + CGAL_assertion(cit != cit->neighbor(i)); for(int j=i+1; j<4; j++) { - CGAL_triangulation_assertion(cit->neighbor(i) != cit->neighbor(j)); - CGAL_triangulation_assertion(cit->vertex(i) != cit->vertex(j)); + CGAL_assertion(cit->neighbor(i) != cit->neighbor(j)); + CGAL_assertion(cit->vertex(i) != cit->vertex(j)); } } // Check positive orientation: @@ -3107,15 +3107,15 @@ remove(Vertex_handle v, PointRemover& r, Conflict_tester& t, CoverManager& cover } Virtual_vertex_map_it vvmit = virtual_vertices.find(v); if(vvmit != virtual_vertices.end()) v = vvmit->second.first; - CGAL_triangulation_assertion(virtual_vertices_reverse.find(v) + CGAL_assertion(virtual_vertices_reverse.find(v) != virtual_vertices_reverse.end()); vhrem = virtual_vertices_reverse.find(v)->second; virtual_vertices_reverse.erase(v); - CGAL_triangulation_assertion(vhrem.size()==26); + CGAL_assertion(vhrem.size()==26); for(int i=0; i<26; i++) { periodic_remove(vhrem[i],r, cover_manager); virtual_vertices.erase(vhrem[i]); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); } periodic_remove(v,r, cover_manager); } @@ -3169,7 +3169,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana make_hole(v, outer_map, hole); - CGAL_triangulation_assertion(outer_map.size()==hole.size()); + CGAL_assertion(outer_map.size()==hole.size()); if(!is_1_cover()) { cover_manager.delete_unsatisfying_elements(hole.begin(), hole.end()); @@ -3211,16 +3211,16 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana for(unsigned int i=0; i < vertices.size(); i++) { typedef typename Point_remover::Triangulation_R3::Point TRPoint; - CGAL_triangulation_assertion( + CGAL_assertion( get_offset(vertices[i]) + combine_offsets(Offset(), vh_off_map[vertices[i]]) == combine_offsets(get_offset(vertices[i]),vh_off_map[vertices[i]])); TRPoint trp = std::make_pair(vertices[i]->point(), combine_offsets( get_offset(vertices[i]), vh_off_map[vertices[i]]) ); VertexE_handle vh = remover.tmp.insert(trp, ch); vmap[vh] = vertices[i]; - CGAL_triangulation_assertion(vmap.is_defined(vh)); + CGAL_assertion(vmap.is_defined(vh)); } - CGAL_triangulation_assertion(remover.tmp.number_of_vertices() != 0); + CGAL_assertion(remover.tmp.number_of_vertices() != 0); // Construct the set of vertex triples of tmp // We reorient the vertex triple so that it matches those from outer_map @@ -3263,7 +3263,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana typename Vertex_triple_FacetE_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_FacetE_map::value_type i_vt_f_pair = *iit; CellE_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -3282,7 +3282,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana if(cover_manager.update_cover_data_during_management(new_ch, new_cells, abort_if_cover_change)) { - CGAL_triangulation_expensive_postcondition(_tds.is_valid()); + CGAL_expensive_postcondition(_tds.is_valid()); return false; // removing would cause / has caused a cover change } @@ -3331,7 +3331,7 @@ periodic_remove(Vertex_handle v, PointRemover& remover, CoverManager& cover_mana _tds.delete_vertex(v); _tds.delete_cells(hole.begin(), hole.end()); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); return true; // sucessfully removed the vertex } @@ -3444,17 +3444,17 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() // The vector from nb to the "original" periodic copy of nb, that is // the copy that will not be deleted. Offset difference_offset(x,y,z); - CGAL_triangulation_assertion( !difference_offset.is_null() ); + CGAL_assertion( !difference_offset.is_null() ); // We now have to find the "original" periodic copy of nb from // its vertices. Therefore, we first have to find the vertices. for( int j = 0; j < 4; j++ ) { - CGAL_triangulation_assertion( (off[j]-difference_offset)[0] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[1] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[2] >= 0); - CGAL_triangulation_assertion( (off[j]-difference_offset)[0] < 3); - CGAL_triangulation_assertion( (off[j]-difference_offset)[1] < 3); - CGAL_triangulation_assertion( (off[j]-difference_offset)[2] < 3); + CGAL_assertion( (off[j]-difference_offset)[0] >= 0); + CGAL_assertion( (off[j]-difference_offset)[1] >= 0); + CGAL_assertion( (off[j]-difference_offset)[2] >= 0); + CGAL_assertion( (off[j]-difference_offset)[0] < 3); + CGAL_assertion( (off[j]-difference_offset)[1] < 3); + CGAL_assertion( (off[j]-difference_offset)[2] < 3); // find the Vertex_handles of the vertices of the "original" // periodic copy of nb. If the vertex is inside the original @@ -3506,22 +3506,22 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() off[i] = Offset(); get_vertex( it, i, vert[i], off[i]); it->set_vertex( i, vert[i]); - CGAL_triangulation_assertion(vert[i]->point()[0] < domain().xmax()); - CGAL_triangulation_assertion(vert[i]->point()[1] < domain().ymax()); - CGAL_triangulation_assertion(vert[i]->point()[2] < domain().zmax()); - CGAL_triangulation_assertion(vert[i]->point()[0] >= domain().xmin()); - CGAL_triangulation_assertion(vert[i]->point()[1] >= domain().ymin()); - CGAL_triangulation_assertion(vert[i]->point()[2] >= domain().zmin()); + CGAL_assertion(vert[i]->point()[0] < domain().xmax()); + CGAL_assertion(vert[i]->point()[1] < domain().ymax()); + CGAL_assertion(vert[i]->point()[2] < domain().zmax()); + CGAL_assertion(vert[i]->point()[0] >= domain().xmin()); + CGAL_assertion(vert[i]->point()[1] >= domain().ymin()); + CGAL_assertion(vert[i]->point()[2] >= domain().zmin()); // redirect also the cell pointer of the vertex. it->vertex(i)->set_cell(it); } // Set the offsets. set_offsets(it, off[0], off[1], off[2], off[3] ); - CGAL_triangulation_assertion( int_to_off(it->offset(0)) == off[0] ); - CGAL_triangulation_assertion( int_to_off(it->offset(1)) == off[1] ); - CGAL_triangulation_assertion( int_to_off(it->offset(2)) == off[2] ); - CGAL_triangulation_assertion( int_to_off(it->offset(3)) == off[3] ); + CGAL_assertion( int_to_off(it->offset(0)) == off[0] ); + CGAL_assertion( int_to_off(it->offset(1)) == off[1] ); + CGAL_assertion( int_to_off(it->offset(2)) == off[2] ); + CGAL_assertion( int_to_off(it->offset(3)) == off[3] ); } } @@ -3553,7 +3553,7 @@ Periodic_3_triangulation_3::convert_to_1_sheeted_covering() for( Vertex_iterator vit = all_vertices_begin(); vit != all_vertices_end(); ++vit ) { if( virtual_vertices.count( vit ) != 0 ) { - CGAL_triangulation_assertion( virtual_vertices.count( vit ) == 1 ); + CGAL_assertion( virtual_vertices.count( vit ) == 1 ); vertices_to_delete.push_back( vit ); } } @@ -3572,7 +3572,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() if(_cover == CGAL::make_array(3,3,3)) return; - CGAL_triangulation_precondition(is_1_cover()); + CGAL_precondition(is_1_cover()); // Create 27 copies of each vertex and write virtual_vertices and // virtual_vertices_reverse @@ -3640,7 +3640,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() Offset vvoff[4]; for(int i=0; i<4; i++) { vvrmit[i] = virtual_vertices_reverse.find((*cit)->vertex(i)); - CGAL_triangulation_assertion( + CGAL_assertion( vvrmit[i] != virtual_vertices_reverse.end()); vvoff[i] = int_to_off((*cit)->offset(i)); } @@ -3653,7 +3653,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() int o_j = ((n+1)/3+vvoff[i].y()+3)%3; int o_k = ((n+1)+vvoff[i].z()+3)%3; int n_c = 9*o_i+3*o_j+o_k-1; - CGAL_triangulation_assertion(n_c >= -1); + CGAL_assertion(n_c >= -1); if(n_c == -1) vvh[i] = (*cit)->vertex(i); else vvh[i] = vvrmit[i]->second[n_c]; } @@ -3669,12 +3669,12 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() for(int i=0; i<4; i++) { Virtual_vertex_reverse_map_it vvrmit = virtual_vertices_reverse.find((*cit)->vertex(i)); - CGAL_triangulation_assertion(vvrmit != virtual_vertices_reverse.end()); + CGAL_assertion(vvrmit != virtual_vertices_reverse.end()); Offset vvoff = int_to_off((*cit)->offset(i)); if(!vvoff.is_null()) { int n_c = 9*vvoff.x()+3*vvoff.y()+vvoff.z()-1; - CGAL_triangulation_assertion(n_c >= 0); - CGAL_triangulation_assertion(static_cast(n_c) + CGAL_assertion(n_c >= 0); + CGAL_assertion(static_cast(n_c) < vvrmit->second.size()); (*cit)->set_vertex(i,vvrmit->second[n_c]); } @@ -3685,13 +3685,13 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() typename std::list >::iterator oit = off_nb.begin(); for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); VCRMIT c_cp = virtual_cells_reverse.find(*cit); - CGAL_triangulation_assertion(c_cp != virtual_cells_reverse.end()); + CGAL_assertion(c_cp != virtual_cells_reverse.end()); for(int i=0; i<4; i++) { Cell_handle cit_nb = (*cit)->neighbor(i); VCRMIT c_cp_nb = virtual_cells_reverse.find(cit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_cells_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_cells_reverse.end()); Offset nboff = (*oit)[i]; for(int n=0; n<26; n++) { int n_nb; @@ -3703,23 +3703,23 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() n_nb = 9*o_i+3*o_j+o_k-1; } if(n_nb == -1) { - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(cit_nb->has_vertex( + CGAL_assertion(cit_nb->has_vertex( c_cp->second[n]->vertex((i+3)%4)) ); c_cp->second[n]->set_neighbor(i,cit_nb); } else { - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex(c_cp->second[n]->vertex((i+3)%4)) ); c_cp->second[n]->set_neighbor(i,c_cp_nb->second[n_nb]); } @@ -3731,25 +3731,25 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() oit = off_nb.begin(); for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit, ++oit) { - CGAL_triangulation_assertion( oit != off_nb.end() ); + CGAL_assertion( oit != off_nb.end() ); for(int i=0; i<4; i++) { Offset nboff = (*oit)[i]; if(!nboff.is_null()) { Cell_handle cit_nb = (*cit)->neighbor(i); VCRMIT c_cp_nb = virtual_cells_reverse.find(cit_nb); - CGAL_triangulation_assertion(c_cp_nb != virtual_cells_reverse.end()); + CGAL_assertion(c_cp_nb != virtual_cells_reverse.end()); int o_i = (3-nboff.x())%3; int o_j = (3-nboff.y())%3; int o_k = (3-nboff.z())%3; int n_nb = 9*o_i+3*o_j+o_k-1; - CGAL_triangulation_assertion(n_nb >= 0); - CGAL_triangulation_assertion(static_cast(n_nb) + CGAL_assertion(n_nb >= 0); + CGAL_assertion(static_cast(n_nb) <= c_cp_nb->second.size()); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+1)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+2)%4)) ); - CGAL_triangulation_assertion(c_cp_nb->second[n_nb] + CGAL_assertion(c_cp_nb->second[n_nb] ->has_vertex((*cit)->vertex((i+3)%4)) ); (*cit)->set_neighbor(i,c_cp_nb->second[n_nb]); } @@ -3767,7 +3767,7 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() for(typename std::list::iterator cit = original_cells.begin(); cit != original_cells.end(); ++cit) { VCRMIT c_cp = virtual_cells_reverse.find(*cit); - CGAL_triangulation_assertion( c_cp != virtual_cells_reverse.end()); + CGAL_assertion( c_cp != virtual_cells_reverse.end()); Offset off[4]; for(int i=0; i<4; i++) off[i] = int_to_off((*cit)->offset(i)); @@ -3788,9 +3788,9 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() off_cp[i] = Offset((o_i==2)?off[i].x():0, (o_j==2)?off[i].y():0, (o_k==2)?off[i].z():0); - CGAL_triangulation_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); - CGAL_triangulation_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); - CGAL_triangulation_assertion(off_cp[i].z() == 0 || off_cp[i].z() == 1); + CGAL_assertion(off_cp[i].x() == 0 || off_cp[i].x() == 1); + CGAL_assertion(off_cp[i].y() == 0 || off_cp[i].y() == 1); + CGAL_assertion(off_cp[i].z() == 0 || off_cp[i].z() == 1); } set_offsets(c_cp->second[n],off_cp[0],off_cp[1],off_cp[2],off_cp[3]); } @@ -3801,14 +3801,14 @@ Periodic_3_triangulation_3::convert_to_27_sheeted_covering() cit != original_cells.end(); ++cit) { //This statement does not seem to have any effect set_offsets(*cit, 0,0,0,0); - CGAL_triangulation_assertion((*cit)->offset(0) == 0); - CGAL_triangulation_assertion((*cit)->offset(1) == 0); - CGAL_triangulation_assertion((*cit)->offset(2) == 0); - CGAL_triangulation_assertion((*cit)->offset(3) == 0); + CGAL_assertion((*cit)->offset(0) == 0); + CGAL_assertion((*cit)->offset(1) == 0); + CGAL_assertion((*cit)->offset(2) == 0); + CGAL_assertion((*cit)->offset(3) == 0); } _cover = CGAL::make_array(3,3,3); - CGAL_triangulation_expensive_assertion(is_valid()); + CGAL_expensive_assertion(is_valid()); update_cover_data_after_converting_to_27_sheeted_covering(); } @@ -3840,7 +3840,7 @@ Periodic_3_triangulation_3::get_cell(const Vertex_handle* vh) const incident_cells(vh[3],std::back_inserter(cells)); for( typename std::vector::iterator it = cells.begin(); it != cells.end(); it++ ) { - CGAL_triangulation_assertion( + CGAL_assertion( (*it)->vertex(0) == vh[3] || (*it)->vertex(1) == vh[3] ||(*it)->vertex(2) == vh[3] || (*it)->vertex(3) == vh[3]); for( int j=0; j<3; j++ ) { @@ -3854,7 +3854,7 @@ Periodic_3_triangulation_3::get_cell(const Vertex_handle* vh) const return (*it); } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Cell_handle(); } @@ -3869,12 +3869,12 @@ inline typename Periodic_3_triangulation_3::Offset Periodic_3_triangulation_3::get_location_offset( const Conflict_tester& tester, Cell_handle c) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); int cumm_off = c->offset(0) | c->offset(1) | c->offset(2) | c->offset(3); if(cumm_off == 0) { // default case: - CGAL_triangulation_assertion(tester(c, Offset())); + CGAL_assertion(tester(c, Offset())); return Offset(); } else { // Main idea seems to just test all possibilities. @@ -3886,7 +3886,7 @@ Periodic_3_triangulation_3::get_location_offset( } } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Offset(); } @@ -3896,7 +3896,7 @@ inline typename Periodic_3_triangulation_3::Offset Periodic_3_triangulation_3::get_location_offset( const Conflict_tester& tester, Cell_handle c, bool& found) const { - CGAL_triangulation_precondition( number_of_vertices() != 0 ); + CGAL_precondition( number_of_vertices() != 0 ); found = false; @@ -3932,8 +3932,8 @@ Periodic_3_triangulation_3::neighbor_offset( Cell_handle ch, int i, Cell_handle nb) const { // Redundance in the signature! - CGAL_triangulation_precondition(ch->neighbor(i) == nb); - CGAL_triangulation_precondition(nb->neighbor(nb->index(ch)) == ch); + CGAL_precondition(ch->neighbor(i) == nb); + CGAL_precondition(nb->neighbor(nb->index(ch)) == ch); Vertex_handle vertex_ch; int index_ch, index_nb; @@ -3978,17 +3978,17 @@ inline void Periodic_3_triangulation_3::get_vertex( // if 'vh_i' is not contained in virtual_vertices, then it is in // the original domain. vh = vh_i; - CGAL_triangulation_assertion(vh != Vertex_handle()); + CGAL_assertion(vh != Vertex_handle()); } else { // otherwise it has to be looked up as well as its offset. vh = it->second.first; off += it->second.second; - CGAL_triangulation_assertion(vh->point().x() < domain().xmax()); - CGAL_triangulation_assertion(vh->point().y() < domain().ymax()); - CGAL_triangulation_assertion(vh->point().z() < domain().zmax()); - CGAL_triangulation_assertion(vh->point().x() >= domain().xmin()); - CGAL_triangulation_assertion(vh->point().y() >= domain().ymin()); - CGAL_triangulation_assertion(vh->point().z() >= domain().zmin()); + CGAL_assertion(vh->point().x() < domain().xmax()); + CGAL_assertion(vh->point().y() < domain().ymax()); + CGAL_assertion(vh->point().z() < domain().zmax()); + CGAL_assertion(vh->point().x() >= domain().xmin()); + CGAL_assertion(vh->point().y() >= domain().ymin()); + CGAL_assertion(vh->point().z() >= domain().zmin()); } } @@ -4007,7 +4007,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) // of vertices, plus the non combinatorial information on each cell // the neighbors of each cell by their index in the preceding list of cells { - CGAL_triangulation_precondition(is.good()); + CGAL_precondition(is.good()); typedef Periodic_3_triangulation_3 Triangulation; typedef typename Triangulation::size_type size_type; @@ -4035,7 +4035,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) read(is,n); } - CGAL_triangulation_assertion((n/(cx*cy*cz))*cx*cy*cz == n); + CGAL_assertion((n/(cx*cy*cz))*cx*cy*cz == n); tr.tds().set_dimension((n==0?-2:3)); tr._gt.set_domain(domain); @@ -4093,7 +4093,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) for(std::size_t j=0; j < m; j++) is >> *(C[j]); - CGAL_triangulation_expensive_assertion( tr.is_valid() ); + CGAL_expensive_assertion( tr.is_valid() ); return is; } @@ -4167,13 +4167,13 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) os << it->point() << std::endl << Offset(0,0,0) << std::endl; else os << it->point() << Offset(0,0,0); - CGAL_triangulation_assertion(tr.virtual_vertices_reverse.find(it) + CGAL_assertion(tr.virtual_vertices_reverse.find(it) != tr.virtual_vertices_reverse.end()); vv = tr.virtual_vertices_reverse.find(it)->second; - CGAL_triangulation_assertion(vv.size() == 26); + CGAL_assertion(vv.size() == 26); for(std::size_t j=0; jpoint() << std::endl @@ -4182,7 +4182,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) } } } - CGAL_triangulation_postcondition(i == tr.number_of_sheets()[0] * + CGAL_postcondition(i == tr.number_of_sheets()[0] * tr.number_of_sheets()[1] * tr.number_of_sheets()[2] * n); @@ -4255,12 +4255,12 @@ test_next(const Periodic_3_triangulation_3& t1, queue.pop_back(); // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.number_of_vertices() != 0); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(3)) != Vmap.end()); + CGAL_precondition(t1.number_of_vertices() != 0); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(3)) != Vmap.end()); for(int i=0; i <= 3; ++i) { Cell_handle1 n1 = c1->neighbor(i); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h index fa256044b3f..128cb4038d0 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_Delaunay_triangulation_remove_traits_3.h @@ -16,7 +16,6 @@ #include #include -#include #include namespace CGAL { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h index af4192ea47f..947b8b553e5 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3/internal/Periodic_3_triangulation_iterators_3.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -86,7 +86,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -122,7 +122,7 @@ public: bool operator==(const Periodic_tetrahedron_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -196,7 +196,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -264,25 +264,25 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1,off2,off3); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->offset(0)); off1 = _t->int_to_off(pos->offset(1)); off2 = _t->int_to_off(pos->offset(2)); off3 = _t->int_to_off(pos->offset(3)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off0.z() == 0 || off0.z() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off1.z() == 0 || off1.z() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); - CGAL_triangulation_assertion(off2.z() == 0 || off2.z() == 1); - CGAL_triangulation_assertion(off3.x() == 0 || off3.x() == 1); - CGAL_triangulation_assertion(off3.y() == 0 || off3.y() == 1); - CGAL_triangulation_assertion(off3.z() == 0 || off3.z() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off0.z() == 0 || off0.z() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off1.z() == 0 || off1.z() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off2.z() == 0 || off2.z() == 1); + CGAL_assertion(off3.x() == 0 || off3.x() == 1); + CGAL_assertion(off3.y() == 0 || off3.y() == 1); + CGAL_assertion(off3.z() == 0 || off3.z() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0 && off3.x() == 0) @@ -301,7 +301,7 @@ private: } Periodic_tetrahedron construct_periodic_tetrahedron() const { - CGAL_triangulation_assertion(pos != typename T::Cell_handle()); + CGAL_assertion(pos != typename T::Cell_handle()); Offset off0, off1, off2, off3; get_edge_offsets(off0, off1, off2, off3); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -392,7 +392,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -428,7 +428,7 @@ public: bool operator==(const Periodic_triangle_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -499,7 +499,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -567,21 +567,21 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1,off2); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset((pos->second+1)&3)); off1 = _t->int_to_off(pos->first->offset((pos->second+2)&3)); off2 = _t->int_to_off(pos->first->offset((pos->second+3)&3)); } - CGAL_triangulation_assertion(off0.x() == 0 || off0.x() == 1); - CGAL_triangulation_assertion(off0.y() == 0 || off0.y() == 1); - CGAL_triangulation_assertion(off0.z() == 0 || off0.z() == 1); - CGAL_triangulation_assertion(off1.x() == 0 || off1.x() == 1); - CGAL_triangulation_assertion(off1.y() == 0 || off1.y() == 1); - CGAL_triangulation_assertion(off1.z() == 0 || off1.z() == 1); - CGAL_triangulation_assertion(off2.x() == 0 || off2.x() == 1); - CGAL_triangulation_assertion(off2.y() == 0 || off2.y() == 1); - CGAL_triangulation_assertion(off2.z() == 0 || off2.z() == 1); + CGAL_assertion(off0.x() == 0 || off0.x() == 1); + CGAL_assertion(off0.y() == 0 || off0.y() == 1); + CGAL_assertion(off0.z() == 0 || off0.z() == 1); + CGAL_assertion(off1.x() == 0 || off1.x() == 1); + CGAL_assertion(off1.y() == 0 || off1.y() == 1); + CGAL_assertion(off1.z() == 0 || off1.z() == 1); + CGAL_assertion(off2.x() == 0 || off2.x() == 1); + CGAL_assertion(off2.y() == 0 || off2.y() == 1); + CGAL_assertion(off2.z() == 0 || off2.z() == 1); int offx = ( ((off0.x() == 0 && off1.x() == 0 && off2.x() == 0) || (off0.x() == 1 && off1.x() == 1 && off2.x() == 1)) ? 0 : 1); @@ -594,7 +594,7 @@ private: } Periodic_triangle construct_periodic_triangle() const { - CGAL_triangulation_assertion(pos->first != typename T::Cell_handle()); + CGAL_assertion(pos->first != typename T::Cell_handle()); Offset off0, off1, off2; get_edge_offsets(off0, off1, off2); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -682,7 +682,7 @@ public: increment_domain(); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -718,7 +718,7 @@ public: bool operator==(const Periodic_segment_iterator& ti) const { - CGAL_triangulation_assertion(_it == ti._it); + CGAL_assertion(_it == ti._it); return _t == ti._t && pos == ti.pos && _off == ti._off; } @@ -785,7 +785,7 @@ private: // copies into account. void increment_domain() { int off = get_drawing_offsets(); - CGAL_triangulation_assertion(_off <= off); + CGAL_assertion(_off <= off); if (_off == off) { _off = 0; do { ++pos; } while (_it == T::UNIQUE_COVER_DOMAIN @@ -841,15 +841,15 @@ private: if (_it == T::UNIQUE_COVER_DOMAIN) get_edge_offsets(off0,off1); else { - CGAL_triangulation_assertion(_it == T::STORED_COVER_DOMAIN); + CGAL_assertion(_it == T::STORED_COVER_DOMAIN); off0 = _t->int_to_off(pos->first->offset(pos->second)); off1 = _t->int_to_off(pos->first->offset(pos->third)); } Offset diff_off = off0 - off1; - CGAL_triangulation_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); - CGAL_triangulation_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); - CGAL_triangulation_assertion(diff_off.z() >= -1 || diff_off.z() <= 1); + CGAL_assertion(diff_off.x() >= -1 || diff_off.x() <= 1); + CGAL_assertion(diff_off.y() >= -1 || diff_off.y() <= 1); + CGAL_assertion(diff_off.z() >= -1 || diff_off.z() <= 1); return( 4*(diff_off.x() == 0 ? 0:1) + 2*(diff_off.y() == 0 ? 0:1) @@ -857,7 +857,7 @@ private: } Periodic_segment construct_periodic_segment() const { - CGAL_triangulation_assertion(pos->first != typename T::Cell_handle()); + CGAL_assertion(pos->first != typename T::Cell_handle()); Offset off0, off1; get_edge_offsets(off0, off1); Offset transl_off = Offset((((_off>>2)&1)==1 ? -1:0), @@ -939,7 +939,7 @@ public: do { ++pos; } while (pos != _t->vertices_end() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -955,7 +955,7 @@ public: do { --pos; } while (pos != _t->vertices_begin() && !is_canonical()); break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); }; return *this; } @@ -976,7 +976,7 @@ public: bool operator==(const Periodic_point_iterator& pi) const { - CGAL_triangulation_assertion(_it == pi._it); + CGAL_assertion(_it == pi._it); return _t == pi._t && pos == pi.pos; } @@ -1017,7 +1017,7 @@ private: } Periodic_point construct_periodic_point() const { - CGAL_triangulation_assertion(pos != typename T::Vertex_handle()); + CGAL_assertion(pos != typename T::Vertex_handle()); Offset off = _t->get_offset(pos); return std::make_pair(pos->point(),off); } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h index c1b7a5300e6..2521082ae91 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_ds_cell_base_3.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -63,7 +63,7 @@ public: const Vertex_handle& vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); CGAL_assume( i >= 0 && i <= 3 ); return V[i]; } @@ -87,13 +87,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } const Cell_handle& neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -116,13 +116,13 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } int offset(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return ((off>>3*i)&7); } @@ -130,13 +130,13 @@ public: void set_vertex(int i, const Vertex_handle& v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } void set_neighbor(int i, const Cell_handle& n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); N[i] = n; } @@ -170,7 +170,7 @@ public: void set_offset(const Vertex_handle vh, int o) { - CGAL_triangulation_precondition(has_vertex(vh)); + CGAL_precondition(has_vertex(vh)); int vhi = index(vh); unsigned int offo[3] = {static_cast((o&1)), @@ -242,7 +242,7 @@ public: // TODO: Get rid of this flag! Used in convert_to_1_sheeted_covering. // Either use the conflict flag or a std::map. void set_additional_flag(unsigned char f) { - CGAL_triangulation_assertion(f < 4); + CGAL_assertion(f < 4); _additional_flag = f; } unsigned char get_additional_flag() const { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h index 5a46a8839b3..b3e6b28a413 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_hierarchy_3.h @@ -396,7 +396,7 @@ void Periodic_3_triangulation_hierarchy_3:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); CGAL_expensive_precondition(is_vertex(v)); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); @@ -412,12 +412,12 @@ typename Periodic_3_triangulation_hierarchy_3::Vertex_handle Periodic_3_triangulation_hierarchy_3:: move_point(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); Vertex_handle old, ret; for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); - CGAL_triangulation_assertion(hierarchy[l]->is_valid()); + CGAL_assertion(hierarchy[l]->is_valid()); Vertex_handle w = hierarchy[l]->move_point(v, p); if (l == 0) { ret = w; diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h index 3dd20ea6fae..f9c96b8eb5c 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_traits_3.h @@ -22,7 +22,6 @@ #include #include -#include namespace CGAL { diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/icons/about_CGAL.html b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/icons/about_CGAL.html index 6b2b2a5d943..f2f0fb9318b 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/icons/about_CGAL.html +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/icons/about_CGAL.html @@ -3,6 +3,6 @@

    Computational Geometry Algorithms Library

    CGAL provides efficient and reliable geometric algorithms in the form of a C++ library.

    -

    For more information visit www.cgal.org

    +

    For more information visit www.cgal.org

    diff --git a/Periodic_4_hyperbolic_triangulation_2/doc/Periodic_4_hyperbolic_triangulation_2/CGAL/Periodic_4_hyperbolic_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/doc/Periodic_4_hyperbolic_triangulation_2/CGAL/Periodic_4_hyperbolic_triangulation_2.h index ad2ed7e2906..095914a40e2 100644 --- a/Periodic_4_hyperbolic_triangulation_2/doc/Periodic_4_hyperbolic_triangulation_2/CGAL/Periodic_4_hyperbolic_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/doc/Periodic_4_hyperbolic_triangulation_2/CGAL/Periodic_4_hyperbolic_triangulation_2.h @@ -150,20 +150,6 @@ public: Deletes all faces and vertices of the triangulation. */ void clear(); - - /*! - Equality operator. - \todo implement - */ - bool operator==(const Periodic_4_hyperbolic_triangulation_2& tr1, - const Periodic_4_hyperbolic_triangulation_2& tr2); - - /*! - Inequality operator. - \todo implement - */ - bool operator!=(const Periodic_4_hyperbolic_triangulation_2& tr1, - const Periodic_4_hyperbolic_triangulation_2& tr2); /// @} diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h index f08eb4316ae..25cb1d77c6f 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h @@ -165,15 +165,11 @@ public: spatial_sort(points.begin(), points.end(), geom_traits()); Face_handle f; - int cnt = 0; - int cnt_good = 0; for(typename std::vector::const_iterator p=points.begin(), end = points.end(); p != end; ++p) { - ++cnt; Vertex_handle v = insert(*p, f); if(v != Vertex_handle()) { - ++cnt_good; f = v->face(); } } @@ -271,7 +267,7 @@ public: Point get_dummy_point(int i) const { - CGAL_triangulation_precondition(0 <= i && i <= static_cast(dummy_points.size())); + CGAL_precondition(0 <= i && i <= static_cast(dummy_points.size())); return dummy_points[i](); } @@ -543,7 +539,7 @@ remove(Vertex_handle v) int nidx = 0; if(nbf->neighbor(1) == nb) nidx = 1; if(nbf->neighbor(2) == nb) nidx = 2; - CGAL_triangulation_assertion(nbf->neighbor(nidx) == nb); + CGAL_assertion(nbf->neighbor(nidx) == nb); bdry_nbrs.insert(Edge_neighbor(e, Neighbor_pair(nbf, nidx))); bdry_verts.push_back(nb->vertex(ccw(idx))); @@ -596,8 +592,6 @@ remove(Vertex_handle v) Nbr_history failsafe; - int internb = 0; - int bdrynb = 0; for(std::size_t i=0; ineighbor(nbidx), nbf->neighbor(nbidx)->index(nbf)); - CGAL_triangulation_assertion(side1.first->neighbor(side1.second) == side2.first); - CGAL_triangulation_assertion(side2.first->neighbor(side2.second) == side1.first); + CGAL_assertion(side1.first->neighbor(side1.second) == side2.first); + CGAL_assertion(side2.first->neighbor(side2.second) == side1.first); Nbr_pair hist(side1, side2); failsafe.push_back(hist); tds().set_adjacency(nbf, nbidx, new_f[i], k); - bdrynb++; break; } } @@ -641,7 +634,6 @@ remove(Vertex_handle v) new_f[i]->vertex(cw(k)) == new_f[l]->vertex(ccw(j))) { tds().set_adjacency(new_f[i], k, new_f[l], j); - internb++; break; } } @@ -680,7 +672,7 @@ remove(Vertex_handle v) tds().delete_face(new_f[rit]); } - CGAL_triangulation_assertion(this->is_valid(true)); + CGAL_assertion(this->is_valid(true)); return false; } @@ -712,7 +704,7 @@ remove(Vertex_handle v) tds().delete_vertex(v); - CGAL_triangulation_assertion(this->is_valid(true)); + CGAL_assertion(this->is_valid(true)); return true; } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h index 76879a19464..29a8bba10fa 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -110,7 +110,7 @@ public: Periodic_4_hyperbolic_triangulation_2(const Periodic_4_hyperbolic_triangulation_2& tr) : _gt(tr.geom_traits()) { - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } Periodic_4_hyperbolic_triangulation_2& operator=(Periodic_4_hyperbolic_triangulation_2 tr) @@ -175,7 +175,7 @@ public: Periodic_point periodic_point(const Face_handle c, int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); return std::make_pair(c->vertex(i)->point(), c->translation(i)); } @@ -194,8 +194,8 @@ public: Periodic_segment periodic_segment(const Face_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition((i >= 0 && i <= 2) && (j >= 0 && j <= 2)); + CGAL_precondition(i != j); + CGAL_precondition((i >= 0 && i <= 2) && (j >= 0 && j <= 2)); return periodic_segment(c->vertex(i)->point(), c->vertex(j)->point(), c->translation(i), c->translation(j)); } @@ -263,14 +263,14 @@ public: Hyperbolic_segment construct_hyperbolic_segment(const Face_handle & fh, int idx) const { - CGAL_triangulation_precondition(idx >= 0 && idx <= 2); + CGAL_precondition(idx >= 0 && idx <= 2); return construct_hyperbolic_segment(fh->vertex(ccw(idx))->point(), fh->vertex(cw(idx))->point(), fh->translation(ccw(idx)), fh->translation(cw(idx))); } Hyperbolic_segment construct_hyperbolic_segment(const std::pair & edge) const { - CGAL_triangulation_precondition(edge.second >= 0 && edge.second <= 2); + CGAL_precondition(edge.second >= 0 && edge.second <= 2); return construct_hyperbolic_segment(edge.first, ccw(edge.second)); } @@ -523,7 +523,7 @@ public: Hyperbolic_translation neighbor_translation(const Face_handle fh, int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); int myi = ccw(i); Hyperbolic_translation myof = fh->translation(myi); @@ -645,9 +645,9 @@ inline bool Periodic_4_hyperbolic_triangulation_2:: has_self_edges(typename TDS::Face_handle c) const { - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(1)) || (c->translation(0) != c->translation(1))); - CGAL_triangulation_assertion((c->vertex(0) != c->vertex(2)) || (c->translation(0) != c->translation(2))); - CGAL_triangulation_assertion((c->vertex(1) != c->vertex(2)) || (c->translation(1) != c->translation(2))); + CGAL_assertion((c->vertex(0) != c->vertex(1)) || (c->translation(0) != c->translation(1))); + CGAL_assertion((c->vertex(0) != c->vertex(2)) || (c->translation(0) != c->translation(2))); + CGAL_assertion((c->vertex(1) != c->vertex(2)) || (c->translation(1) != c->translation(2))); return ((c->vertex(0) == c->vertex(1)) || (c->vertex(0) == c->vertex(2)) || @@ -691,11 +691,11 @@ is_valid(bool verbose) const { { for(int i=0; i<3; ++i) { - CGAL_triangulation_assertion(cit != cit->neighbor(i)); + CGAL_assertion(cit != cit->neighbor(i)); for(int j=i+1; j<3; ++j) { - CGAL_triangulation_assertion(cit->neighbor(i) != cit->neighbor(j)); - CGAL_triangulation_assertion(cit->vertex(i) != cit->vertex(j)); + CGAL_assertion(cit->neighbor(i) != cit->neighbor(j)); + CGAL_assertion(cit->vertex(i) != cit->vertex(j)); } } @@ -735,9 +735,9 @@ is_valid(bool verbose) const { if(!error) { - CGAL_triangulation_assertion(!has_self_edges()); - CGAL_triangulation_assertion(!has_cycles_length_2()); - CGAL_triangulation_assertion(_tds.number_of_vertices() + _tds.number_of_faces() + 2 == _tds.number_of_edges()); + CGAL_assertion(!has_self_edges()); + CGAL_assertion(!has_cycles_length_2()); + CGAL_assertion(_tds.number_of_vertices() + _tds.number_of_faces() + 2 == _tds.number_of_edges()); return true; } else @@ -990,8 +990,8 @@ hyperbolic_periodic_locate(const Point& p, Point np0 = construct_point(construct_point(nf->vertex(0)->point(), nf->translation(0)) , tr); Point np1 = construct_point(construct_point(nf->vertex(1)->point(), nf->translation(1)) , tr); Point np2 = construct_point(construct_point(nf->vertex(2)->point(), nf->translation(2)) , tr); - CGAL_triangulation_assertion_code(Oriented_side os1 = side_of_hyperbolic_triangle(np0, np1, np2, p, lt, li)); - CGAL_triangulation_assertion(os1 == ON_POSITIVE_SIDE); + CGAL_assertion_code(Oriented_side os1 = side_of_hyperbolic_triangle(np0, np1, np2, p, lt, li)); + CGAL_assertion(os1 == ON_POSITIVE_SIDE); lo = tr; return nf; } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h index 7092e12ab6a..8d4ae64f0bb 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Periodic_4_hyperbolic_triangulation_dummy_14.h @@ -251,7 +251,7 @@ insert_dummy_points(bool rational) for(Face_iterator fit = tds().faces_begin(); fit != tds().faces_end(); ++fit) this->make_canonical(fit); - CGAL_triangulation_assertion(is_valid(true)); + CGAL_assertion(is_valid(true)); return ret; } @@ -260,4 +260,3 @@ insert_dummy_points(bool rational) } // namespace CGAL #endif // CGAL_PERIODIC_4_HYPERBOLIC_TRIANGULATION_DUMMY_14_H - diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h index 8f625a81e4a..23b0972241b 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_face_base_2.h @@ -17,7 +17,6 @@ #include #include -#include #include namespace CGAL { @@ -73,13 +72,13 @@ public: Hyperbolic_translation translation(int i) const { - CGAL_triangulation_precondition(i >= 0 && i <= 2); + CGAL_precondition(i >= 0 && i <= 2); return o[i]; } void set_translation(const int& k, const Hyperbolic_translation& new_o) { - CGAL_triangulation_precondition(k >= 0 && k <= 2); + CGAL_precondition(k >= 0 && k <= 2); o[k] = new_o; } diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index 74b731a0d31..304cf589d5f 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -48,23 +48,23 @@ namespace CGAL { two particular properties that are hard coded by this class: the coordinates of the points and the normal vectors. - The coordinates of a point can be access using the index of the + The coordinates of a point can be accessed using the index of the point and the member function `point()`. This property is always present. The normal vector of a point can be accessed using the index of the point and the `normal()` method. This property must be explicitly created. All properties can be accessed as a range using the methods - `points()`, `normals()`, and `range()` for points coordinates, + `points()`, `normals()`, and `range()` for point coordinates, normal vectors, and other properties respectively. - Removing a point with properties is achieved by moving its `Index` + Removing a point with properties is achieved by moving its index at the end of the container and keeping track of the number of removed elements. A garbage collection method must be called to really remove it from memory. For convenience, all functions of the package \ref - PkgPointSetProcessing3 automatically creates the right named + PkgPointSetProcessing3 automatically create the right named parameters if called with a `CGAL::Point_set_3` object as argument. diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 0fafe579ba8..0d034a6bcb1 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index e50db48ca36..e002a834c5f 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 5ecedc40b68..282ad59d4a3 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index a420f5068b7..caf7e062a5e 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -16,7 +16,6 @@ #include #include -#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 234255d599b..d7d719d3978 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include @@ -193,7 +193,7 @@ bool write_LAS_with_properties(std::ostream& os, ///< output stream. LAS_property::Z> point_property, ///< property handler for points PropertyHandler&& ... properties) ///< parameter pack of property handlers { - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index 5be867b5ecf..0be0e4183a3 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -20,8 +20,8 @@ #include #include #include -#include #include +#include #include #include @@ -50,7 +50,7 @@ bool write_OFF_PSP(std::ostream& os, PointMap point_map = NP_helper::get_const_point_map(points, np); NormalMap normal_map = NP_helper::get_normal_map(points, np); - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 7da025f7640..6dca998ae72 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -111,7 +111,7 @@ template #include -#include +#include #include #include @@ -51,7 +51,7 @@ bool write_XYZ_PSP(std::ostream& os, PointMap point_map = NP_helper::get_const_point_map(points, np); NormalMap normal_map = NP_helper::get_normal_map(points, np); - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); if(!os) { diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h index 282aa89afe1..6bd7481e096 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Neighbor_query.h @@ -18,7 +18,6 @@ #include #include #include -#include #include diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h index 14db499896d..b29d1c24b4c 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Rich_grid.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -454,7 +454,7 @@ void compute_ball_neighbors_one_self( CGAL::Bbox_3 bbox, ///< bounding box const typename Kernel::FT radius) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); for (unsigned int i = 0; i < points.size(); ++i) { diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index 86fa5d23b19..396d9cdb0e0 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -72,8 +72,8 @@ compute_denoise_projection( typename Kernel::FT sharpness_angle ///< control sharpness(0-90) ) { - CGAL_point_set_processing_precondition(radius > 0); - CGAL_point_set_processing_precondition(sharpness_angle > 0 + CGAL_precondition(radius > 0); + CGAL_precondition(sharpness_angle > 0 && sharpness_angle < 90); // basic geometric types @@ -286,8 +286,8 @@ bilateral_smooth_point_set( const std::function& callback = choose_parameter(get_parameter(np, internal_np::callback), std::function()); - CGAL_point_set_processing_precondition(points.begin() != points.end()); - CGAL_point_set_processing_precondition(k > 1); + CGAL_precondition(points.begin() != points.end()); + CGAL_precondition(k > 1); // types for K nearest neighbors search structure typedef Point_set_processing_3::internal::Neighbor_query Neighbor_query; diff --git a/Point_set_processing_3/include/CGAL/cluster_point_set.h b/Point_set_processing_3/include/CGAL/cluster_point_set.h index 55b56ec8881..c79cd850df1 100644 --- a/Point_set_processing_3/include/CGAL/cluster_point_set.h +++ b/Point_set_processing_3/include/CGAL/cluster_point_set.h @@ -169,7 +169,7 @@ std::size_t cluster_point_set (PointRange& points, // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // If no radius is given, init with 1% of bbox diagonal if (neighbor_radius < 0) diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index 3b9c0f206c6..750bc40ae23 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -177,10 +176,10 @@ compute_average_spacing( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Instanciate a KD-tree search. Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 507418d45b8..bf4b589d788 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -147,8 +147,8 @@ update_new_point( typedef typename rich_grid_internal::Rich_point Rich_point; CGAL_assertion_code( unsigned int size = static_cast(rich_point_set.size()) ); - CGAL_point_set_processing_precondition(father_index < size); - CGAL_point_set_processing_precondition(mother_index < size); + CGAL_precondition(father_index < size); + CGAL_precondition(mother_index < size); // 1, get neighbor information from the two "parent points" Rich_point& new_v = rich_point_set[new_point_index]; @@ -386,16 +386,16 @@ edge_aware_upsample_point_set( typename PointRange::const_iterator end = points.end(); // preconditions - CGAL_point_set_processing_precondition(begin != end); - CGAL_point_set_processing_precondition(sharpness_angle >= 0 - &&sharpness_angle <= 90); - CGAL_point_set_processing_precondition(edge_sensitivity >= 0 - &&edge_sensitivity <= 1); + CGAL_precondition(begin != end); + CGAL_precondition(sharpness_angle >= 0 + &&sharpness_angle <= 90); + CGAL_precondition(edge_sensitivity >= 0 + &&edge_sensitivity <= 1); edge_sensitivity *= 10; // just project [0, 1] to [0, 10]. std::size_t number_of_input = std::distance(begin, end); - CGAL_point_set_processing_precondition(number_of_output_points > number_of_input); + CGAL_precondition(number_of_output_points > number_of_input); const unsigned int nb_neighbors = 6; // 1 ring @@ -424,7 +424,7 @@ edge_aware_upsample_point_set( rich_point_set[i].index = i; bbox += rich_point_set[i].pt.bbox(); - CGAL_point_set_processing_precondition(rich_point_set[i].normal.squared_length() > 1e-10); + CGAL_precondition(rich_point_set[i].normal.squared_length() > 1e-10); } // compute neighborhood diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 3bb7db74e5a..91e66704aff 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h index 86cfca10156..d5d05d3a0ac 100644 --- a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -66,7 +66,7 @@ public: Hash_epsilon_points_3 (double epsilon, PointMap p_map) : m_epsilon (epsilon), point_map(p_map) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } std::size_t operator() (const Point_3& a) const @@ -96,7 +96,7 @@ public: Equal_epsilon_points_3 (const double& epsilon, PointMap p_map) : m_epsilon (epsilon), point_map(p_map) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } bool operator() (const Point_3& a, const Point_3& b) const @@ -155,7 +155,7 @@ public: internal::Equal_epsilon_points_3(epsilon, point_map)) , min_points_per_cell (min_points_per_cell) { - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); } bool insert (const Point_3& p) @@ -249,7 +249,7 @@ grid_simplify_point_set( // actual type of input points typedef typename std::iterator_traits::value_type Enriched_point; - CGAL_point_set_processing_precondition(epsilon > 0); + CGAL_precondition(epsilon > 0); if (min_points_per_cell == 1) { diff --git a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h index 2d6c60c9245..4d44c8e3e21 100644 --- a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -210,8 +210,8 @@ namespace CGAL { typedef typename std::list::iterator cluster_iterator; CGAL_precondition (points.begin() != points.end()); - CGAL_point_set_processing_precondition (size > 0); - CGAL_point_set_processing_precondition (var_max > 0.0); + CGAL_precondition (size > 0); + CGAL_precondition (var_max > 0.0); // The first cluster is the whole input point set clusters_stack.push_front (cluster (std::list(), Point (0., 0., 0.))); diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 516b2671bdd..30a7f34d48c 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -215,10 +215,10 @@ jet_estimate_normals( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2 || neighbor_radius > FT(0)); + CGAL_precondition(k >= 2 || neighbor_radius > FT(0)); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index 9c6b34b93c3..4f6f308c274 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -218,10 +218,10 @@ jet_smooth_point_set( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Instanciate a KD-tree search. Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index 909dc37a63d..2a284b2e859 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -184,7 +184,7 @@ struct Propagate_normal_orientation : m_source(source), m_angle_max(angle_max) { // Precondition: 0 < angle_max <= PI/2 - CGAL_point_set_processing_precondition(0 < angle_max && angle_max <= CGAL_PI/2.); + CGAL_precondition(0 < angle_max && angle_max <= CGAL_PI/2.); } template @@ -265,7 +265,7 @@ mst_find_source( typedef typename boost::property_traits::reference Vector_ref; // Precondition: at least one element in the container - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Find top point ForwardIterator top_point = first; @@ -337,7 +337,7 @@ create_riemannian_graph( typedef typename boost::property_map::type Riemannian_graph_weight_map; // Precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); // Number of input points const std::size_t num_input_points = points.size(); @@ -363,7 +363,7 @@ create_riemannian_graph( for (ForwardIterator it = points.begin(); it != points.end(); it++) { typename Riemannian_graph::vertex_descriptor v = add_vertex(riemannian_graph); - CGAL_point_set_processing_assertion(v == get(index_map,it)); + CGAL_assertion(v == get(index_map,it)); riemannian_graph[v].input_point = it; } @@ -395,7 +395,7 @@ create_riemannian_graph( boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(neighbor_index, riemannian_graph), riemannian_graph); - CGAL_point_set_processing_assertion(inserted); + CGAL_assertion(inserted); // -> -> // Computes edge weight = 1 - | normal1 * normal2 | @@ -417,7 +417,7 @@ create_riemannian_graph( boost::tie(e, inserted) = add_edge(vertex(it_index, riemannian_graph), vertex(source_point_index, riemannian_graph), riemannian_graph); - CGAL_point_set_processing_assertion(inserted); + CGAL_assertion(inserted); riemannian_graph_weight_map[e] = 0.; } @@ -475,7 +475,7 @@ create_mst_graph( typedef internal::MST_graph MST_graph; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Number of input points const std::size_t num_input_points = num_vertices(riemannian_graph) - 1; @@ -511,13 +511,13 @@ create_mst_graph( // 1.56 and 1.57: // https://svn.boost.org/trac/boost/ticket/10382 typename MST_graph::vertex_descriptor v = add_vertex(mst_graph); - CGAL_point_set_processing_assertion(v == get(index_map,it)); + CGAL_assertion(v == get(index_map,it)); mst_graph[v].input_point = it; mst_graph[v].is_oriented = false; } typename MST_graph::vertex_descriptor v = add_vertex(mst_graph); - CGAL_point_set_processing_assertion(v == source_point_index); + CGAL_assertion(v == source_point_index); mst_graph[v].is_oriented = true; // add edges @@ -526,7 +526,7 @@ create_mst_graph( if (i != predecessor[i]) { // check that bi-directed graph is useless - CGAL_point_set_processing_assertion(predecessor[predecessor[i]] != i); + CGAL_assertion(predecessor[predecessor[i]] != i); add_edge(vertex(predecessor[i], mst_graph), vertex(i, mst_graph), @@ -655,10 +655,10 @@ mst_orient_normals( typedef MST_graph MST_graph; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // Precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 8447ae952ff..4d5e04b9491 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -186,10 +186,10 @@ pca_estimate_normals( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE_STREAM << (memory >> 20) << " Mb allocated\n"; diff --git a/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h b/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h deleted file mode 100644 index e5b85b5f3ef..00000000000 --- a/Point_set_processing_3/include/CGAL/point_set_processing_assertions.h +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright (c) 2007 INRIA (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) : Geert-Jan Giezeman, Sven Schoenherr, Laurent Saboret -// -// Generated from script create_assertions.sh - - -/// \cond SKIP_IN_MANUAL - -/// @file point_set_processing_assertions.h -/// Define checking macros for the Point_set_processing_3 package - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_point_set_processing_assertion -#undef CGAL_point_set_processing_assertion_msg -#undef CGAL_point_set_processing_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_point_set_processing_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_point_set_processing_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_assertion_code(CODE) -#else -# define CGAL_point_set_processing_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_assertion_code(CODE) CODE -# define CGAL_point_set_processing_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_exactness_assertion -#undef CGAL_point_set_processing_exactness_assertion_msg -#undef CGAL_point_set_processing_exactness_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_assertion_code(CODE) -#else -# define CGAL_point_set_processing_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_assertion_code(CODE) CODE -# define CGAL_point_set_processing_exactness_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_expensive_assertion -#undef CGAL_point_set_processing_expensive_assertion_msg -#undef CGAL_point_set_processing_expensive_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_assertion_code(CODE) -#else -# define CGAL_point_set_processing_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_assertion_code(CODE) CODE -# define CGAL_point_set_processing_expensive_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -#undef CGAL_point_set_processing_expensive_exactness_assertion -#undef CGAL_point_set_processing_expensive_exactness_assertion_msg -#undef CGAL_point_set_processing_expensive_exactness_assertion_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_assertions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_point_set_processing_precondition -#undef CGAL_point_set_processing_precondition_msg -#undef CGAL_point_set_processing_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_point_set_processing_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_precondition_code(CODE) -#else -# define CGAL_point_set_processing_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_precondition_code(CODE) CODE -# define CGAL_point_set_processing_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_exactness_precondition -#undef CGAL_point_set_processing_exactness_precondition_msg -#undef CGAL_point_set_processing_exactness_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_precondition_code(CODE) -#else -# define CGAL_point_set_processing_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_precondition_code(CODE) CODE -# define CGAL_point_set_processing_exactness_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_expensive_precondition -#undef CGAL_point_set_processing_expensive_precondition_msg -#undef CGAL_point_set_processing_expensive_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_precondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_precondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -#undef CGAL_point_set_processing_expensive_exactness_precondition -#undef CGAL_point_set_processing_expensive_exactness_precondition_msg -#undef CGAL_point_set_processing_expensive_exactness_precondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_preconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_point_set_processing_postcondition -#undef CGAL_point_set_processing_postcondition_msg -#undef CGAL_point_set_processing_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_point_set_processing_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_exactness_postcondition -#undef CGAL_point_set_processing_exactness_postcondition_msg -#undef CGAL_point_set_processing_exactness_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_exactness_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_expensive_postcondition -#undef CGAL_point_set_processing_expensive_postcondition_msg -#undef CGAL_point_set_processing_expensive_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -#undef CGAL_point_set_processing_expensive_exactness_postcondition -#undef CGAL_point_set_processing_expensive_exactness_postcondition_msg -#undef CGAL_point_set_processing_expensive_exactness_postcondition_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_postconditions 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_point_set_processing_warning -#undef CGAL_point_set_processing_warning_msg -#undef CGAL_point_set_processing_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_point_set_processing_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_warning_code(CODE) -#else -# define CGAL_point_set_processing_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_warning_code(CODE) CODE -# define CGAL_point_set_processing_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_exactness_warning -#undef CGAL_point_set_processing_exactness_warning_msg -#undef CGAL_point_set_processing_exactness_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_point_set_processing_exactness_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_exactness_warning_code(CODE) -#else -# define CGAL_point_set_processing_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_exactness_warning_code(CODE) CODE -# define CGAL_point_set_processing_exactness_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_expensive_warning -#undef CGAL_point_set_processing_expensive_warning_msg -#undef CGAL_point_set_processing_expensive_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_warning_code(CODE) -#else -# define CGAL_point_set_processing_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_warning_code(CODE) CODE -# define CGAL_point_set_processing_expensive_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - - -#undef CGAL_point_set_processing_expensive_exactness_warning -#undef CGAL_point_set_processing_expensive_exactness_warning_msg -#undef CGAL_point_set_processing_expensive_exactness_warning_code - -#if defined(CGAL_POINT_SET_PROCESSING_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POINT_SET_PROCESSING_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_point_set_processing_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_point_set_processing_expensive_exactness_warning_code(CODE) -#else -# define CGAL_point_set_processing_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_point_set_processing_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_point_set_processing_expensive_exactness_warning_code(CODE) CODE -# define CGAL_point_set_processing_expensive_exactness_warnings 1 -#endif // CGAL_POINT_SET_PROCESSING_NO_WARNINGS - -/// \endcond diff --git a/Point_set_processing_3/include/CGAL/radial_orient_normals.h b/Point_set_processing_3/include/CGAL/radial_orient_normals.h index 9c6ca92e71b..56c87840822 100644 --- a/Point_set_processing_3/include/CGAL/radial_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/radial_orient_normals.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -72,7 +72,7 @@ radial_orient_normals( typedef typename Kernel::FT FT; // Precondition: at least one element in the container. - CGAL_point_set_processing_precondition(first != beyond); + CGAL_precondition(first != beyond); // Find points barycenter. // Note: We should use CGAL::centroid() from PCA component. diff --git a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h index 50e71a2dc62..7d1f767b342 100644 --- a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ random_simplify_point_set( PointRange& points, double removed_percentage) { - CGAL_point_set_processing_precondition(removed_percentage >= 0 && removed_percentage <= 100); + CGAL_precondition(removed_percentage >= 0 && removed_percentage <= 100); // Random shuffle CGAL::cpp98::random_shuffle (points.begin(), points.end()); diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index 2b28e1e4c7b..0a2697120b6 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -206,12 +206,12 @@ remove_outliers( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); + CGAL_precondition(points.begin() != points.end()); // precondition: at least 2 nearest neighbors - CGAL_point_set_processing_precondition(k >= 2); + CGAL_precondition(k >= 2); - CGAL_point_set_processing_precondition(threshold_percent >= 0 && threshold_percent <= 100); + CGAL_precondition(threshold_percent >= 0 && threshold_percent <= 100); Neighbor_query neighbor_query (points, point_map); diff --git a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h index 02f956f2416..62c0ea1f76d 100644 --- a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h @@ -20,6 +20,7 @@ #include #include +#include #include @@ -545,6 +546,8 @@ void scanline_orient_normals (PointRange& points, const NamedParameters& np = pa std::cerr << nb_scanlines << " scanline(s) identified (mean length = " << std::size_t(points.size() / double(nb_scanlines)) << " point(s))" << std::endl; +#else + CGAL_USE(nb_scanlines); #endif } diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 598f0553d86..f2d9bd447c3 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h b/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h index 8f8d8d84963..a850e40ac39 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_edges.h @@ -40,7 +40,7 @@ namespace CGAL { /// `CGAL_EIGEN3_ENABLED` is defined then an overload using /// `Eigen_diagonalize_traits` is provided. Otherwise, the internal /// implementation `Diagonalize_traits` is used. -/// \sa CGAL::compute_vcm()` +/// \sa `CGAL::compute_vcm()` /// template bool diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index 5b69f3ef0f9..bf7a7f5225c 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index 7e4b86cdebe..41412051408 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -105,7 +105,7 @@ compute_update_sample_point( const std::vector& sample_densities ///< ) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); bool is_original_densities_empty = original_densities.empty(); bool is_sample_densities_empty = sample_densities.empty(); @@ -231,7 +231,7 @@ compute_density_weight_for_original_point( const typename Kernel::FT radius ///< neighbor radius square ) { - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); // basic geometric types typedef typename Kernel::Point_3 Point; @@ -465,9 +465,9 @@ wlop_simplify_and_regularize_point_set( // precondition: at least one element in the container. // to fix: should have at least three distinct points // but this is costly to check - CGAL_point_set_processing_precondition(points.begin() != points.end()); - CGAL_point_set_processing_precondition(select_percentage >= 0 - && select_percentage <= 100); + CGAL_precondition(points.begin() != points.end()); + CGAL_precondition(select_percentage >= 0 + && select_percentage <= 100); // Random shuffle CGAL::cpp98::random_shuffle (points.begin(), points.end()); @@ -507,7 +507,7 @@ wlop_simplify_and_regularize_point_set( #endif } - CGAL_point_set_processing_precondition(radius > 0); + CGAL_precondition(radius > 0); // Initiate a KD-tree search for original points std::vector original_treeElements; diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index b329573c042..bd0281cd9d7 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -38,7 +38,7 @@ #endif #include #include -#include +#include #include #include #include @@ -823,7 +823,7 @@ private: double D; if(!solver.linear_solver(A, B, X, D)) return false; - CGAL_surface_reconstruction_points_assertion(D == 1.0); + CGAL_assertion(D == 1.0); duration_solve = (clock() - time_init)/CLOCKS_PER_SEC; CGAL_TRACE_STREAM << " Solve sparse linear system: done (" << duration_solve << "sec.)\n"; @@ -1129,7 +1129,7 @@ private: if(voronoi_points.size() < 3) { - CGAL_surface_reconstruction_points_assertion(false); + CGAL_assertion(false); return 0.0; } diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h index 7dd6a245aa3..9f605978f7c 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Reconstruction_triangulation_3.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h index a6a27570c67..e43214ce663 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h @@ -46,46 +46,6 @@ namespace CGAL { namespace Surface_mesher { - /** - Type and functions required in GT: - - Compute_scalar_product_3 (from rev. 29646) - - Compute_squared_distance_3 - - Compute_squared_radius_3 - - Construct_center_3 - - Construct_midpoint_3 - - Construct_point_on_3 (from rev. 29646) - - Construct_scaled_vector_3 - - Construct_segment_3 (from rev. 29646) - - Construct_translated_point_3 - - Construct_vector_3 - - FT - - Has_on_bounded_side_3 (from rev. 29646) - - Line_3 - - Point_3 - - Ray_3 - - Segment_3 - - Sphere_3 - - Vector_3 (from rev. 29646) - - compute_scalar_product_3_object (from rev. 29646) - - compute_squared_distance_3_object - - compute_squared_radius_3_object - - construct_center_3_object - - construct_line_3_object (no longer, since rev. 29646) - - construct_midpoint_3_object - - construct_point_on_3_object (from rev. 29646) - - construct_scaled_vector_3_object - - construct_segment_3_object (from rev. 29646) - - construct_translated_point_3_object - - construct_vector_3_object - - has_on_bounded_side_3_object (from rev. 29646) -(Computed by use of: - perl -ne '/GT\(\)\.([a-zA-Z_0-9]+)/ - && print "$1\n";' {implicit_surface_oracle_3.h,Sphere_oracle_3.h} | sort -u - perl -ne '/GT::([a-zA-Z_0-9]+)/ - && print "$1\n";' {implicit_surface_oracle_3.h,Sphere_oracle_3.h} | sort -u -) - */ - template < class GT, diff --git a/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h b/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h index 14d91140b5e..04a712e080f 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/poisson_refine_triangulation.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace CGAL { @@ -212,7 +212,7 @@ unsigned int poisson_refine_triangulation( { // Convergence is guaranteed if radius_edge_ratio_bound >= 1.0 - CGAL_surface_reconstruction_points_precondition(radius_edge_ratio_bound >= 1.0); + CGAL_precondition(radius_edge_ratio_bound >= 1.0); // Mesher_level types typedef Poisson_mesh_cell_criteria_3< diff --git a/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h b/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h deleted file mode 100644 index 67bc3df7f1a..00000000000 --- a/Poisson_surface_reconstruction_3/include/CGAL/surface_reconstruction_points_assertions.h +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) 2007 INRIA (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) : Geert-Jan Giezeman, Sven Schoenherr, Laurent Saboret -// -// Generated from script create_assertions.sh - -/// \cond SKIP_IN_MANUAL - -/// @file surface_reconstruction_points_assertions.h -/// Define checking macros for the Poisson_surface_reconstruction_3 package - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_surface_reconstruction_points_assertion -#undef CGAL_surface_reconstruction_points_assertion_msg -#undef CGAL_surface_reconstruction_points_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_surface_reconstruction_points_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_surface_reconstruction_points_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_exactness_assertion -#undef CGAL_surface_reconstruction_points_exactness_assertion_msg -#undef CGAL_surface_reconstruction_points_exactness_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_expensive_assertion -#undef CGAL_surface_reconstruction_points_expensive_assertion_msg -#undef CGAL_surface_reconstruction_points_expensive_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_assertion_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_assertions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_surface_reconstruction_points_precondition -#undef CGAL_surface_reconstruction_points_precondition_msg -#undef CGAL_surface_reconstruction_points_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_surface_reconstruction_points_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_exactness_precondition -#undef CGAL_surface_reconstruction_points_exactness_precondition_msg -#undef CGAL_surface_reconstruction_points_exactness_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_precondition -#undef CGAL_surface_reconstruction_points_expensive_precondition_msg -#undef CGAL_surface_reconstruction_points_expensive_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_precondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_preconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_surface_reconstruction_points_postcondition -#undef CGAL_surface_reconstruction_points_postcondition_msg -#undef CGAL_surface_reconstruction_points_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_surface_reconstruction_points_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_exactness_postcondition -#undef CGAL_surface_reconstruction_points_exactness_postcondition_msg -#undef CGAL_surface_reconstruction_points_exactness_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_postcondition -#undef CGAL_surface_reconstruction_points_expensive_postcondition_msg -#undef CGAL_surface_reconstruction_points_expensive_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_postconditions 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_surface_reconstruction_points_warning -#undef CGAL_surface_reconstruction_points_warning_msg -#undef CGAL_surface_reconstruction_points_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_surface_reconstruction_points_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_exactness_warning -#undef CGAL_surface_reconstruction_points_exactness_warning_msg -#undef CGAL_surface_reconstruction_points_exactness_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_surface_reconstruction_points_exactness_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_exactness_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_exactness_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_exactness_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_expensive_warning -#undef CGAL_surface_reconstruction_points_expensive_warning_msg -#undef CGAL_surface_reconstruction_points_expensive_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - - -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning_msg -#undef CGAL_surface_reconstruction_points_expensive_exactness_warning_code - -#if defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_SURFACE_RECONSTRUCTION_POINTS_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_code(CODE) -#else -# define CGAL_surface_reconstruction_points_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_surface_reconstruction_points_expensive_exactness_warning_code(CODE) CODE -# define CGAL_surface_reconstruction_points_expensive_exactness_warnings 1 -#endif // CGAL_SURFACE_RECONSTRUCTION_POINTS_NO_WARNINGS - -/// \endcond diff --git a/Polygon/doc/Polygon/PackageDescription.txt b/Polygon/doc/Polygon/PackageDescription.txt index e5c9d156714..1d48e74493c 100644 --- a/Polygon/doc/Polygon/PackageDescription.txt +++ b/Polygon/doc/Polygon/PackageDescription.txt @@ -40,10 +40,6 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} - -The assertion flags for the polygons and polygon operations use -`POLYGON` in their names (e.g., `CGAL_POLYGON_NO_ASSERTIONS`). \cgalClassifedRefPages diff --git a/Polygon/include/CGAL/Polygon_2.h b/Polygon/include/CGAL/Polygon_2.h index be5ca8c9ef0..e4305cccfed 100644 --- a/Polygon/include/CGAL/Polygon_2.h +++ b/Polygon/include/CGAL/Polygon_2.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,7 @@ class Polygon_2 { /// `p.is_simple()`. Bounded_side bounded_side(const Point_2& value) const { - CGAL_polygon_precondition(is_simple()); + CGAL_precondition(is_simple()); return bounded_side_2(d_container.begin(), d_container.end(), value, traits); } diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h index 8338ce335a2..400c2a2e7a7 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_algorithms_impl.h @@ -166,7 +166,7 @@ ForwardIterator left_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); internal::Polygon_2::Compare_vertices less(traits.less_xy_2_object()); return std::min_element(first, last, less); @@ -182,7 +182,7 @@ ForwardIterator right_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits &traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); internal::Polygon_2::Compare_vertices less(traits.less_xy_2_object()); return std::max_element(first, last, less); @@ -198,7 +198,7 @@ ForwardIterator top_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); return std::max_element(first, last, traits.less_yx_2_object()); } @@ -212,7 +212,7 @@ ForwardIterator bottom_vertex_2(ForwardIterator first, ForwardIterator last, const PolygonTraits&traits) { - CGAL_polygon_precondition(first != last); + CGAL_precondition(first != last); return std::min_element(first, last, traits.less_yx_2_object()); } @@ -325,7 +325,7 @@ Oriented_side oriented_side_2(ForwardIterator first, const Traits& traits) { Orientation o = orientation_2(first, last, traits); - CGAL_polygon_assertion(o != COLLINEAR); + CGAL_assertion(o != COLLINEAR); Bounded_side b = bounded_side_2(first, last, point, traits); switch (b) { @@ -507,7 +507,7 @@ Orientation orientation_2(ForwardIterator first, ForwardIterator last, const Traits& traits) { - CGAL_polygon_precondition(is_simple_2(first, last, traits)); + CGAL_precondition(is_simple_2(first, last, traits)); ForwardIterator i = left_vertex_2(first, last, traits); diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h index ba7dfdecb12..b7c6c10b94b 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { #ifndef DOXYGEN_RUNNING //to avoid conflicts @@ -57,7 +57,7 @@ class Polygon_2_const_edge_circulator { : first_vertex(f) {} bool operator==( std::nullptr_t CGAL_assertion_code(p) ) const { - CGAL_polygon_assertion( p == 0); + CGAL_assertion( p == 0); return (first_vertex == 0); } diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h index ce0714af873..8ba11273428 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h @@ -41,7 +41,6 @@ bool operator==( const Polygon_2 &x, return true; typedef typename Traits_P::Equal_2 Equal_2; typedef typename Traits_P::Point_2 Point_2; -// CGAL_polygon_precondition( (x.size() != 0) || (y.size() != 0)); if ((x.size() == 0) && (y.size() == 0)) return true; if (x.size() != y.size()) return false; diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h index 0d77320370f..5e93c02bf43 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_simplicity.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -220,9 +220,9 @@ template bool Less_segments:: less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const { - CGAL_polygon_precondition( + CGAL_precondition( m_vertex_data->edges[tree_edge.as_int()].is_in_tree); - CGAL_polygon_precondition( + CGAL_precondition( !m_vertex_data->edges[new_edge.as_int()].is_in_tree); Vertex_index left, mid, right; m_vertex_data->left_and_right_index(left, right, tree_edge); @@ -323,20 +323,20 @@ insertion_event(Tree *tree, Vertex_index prev_vt, std::pair result; if (left_turn) { result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; } else { result = tree->insert(mid_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_mid.tree_it = result.first; td_mid.is_in_tree = true; result = tree->insert(prev_vt); - // CGAL_polygon_assertion(result.second) + // CGAL_assertion(result.second) td_prev.tree_it = result.first; td_prev.is_in_tree = true; } @@ -369,7 +369,7 @@ replacement_event(Tree *tree, Vertex_index cur_edge, Vertex_index next_edge) // check if continuation point is on the right side of neighbor segments typedef typename Tree::iterator It; Edge_data &td = edges[cur_edge.as_int()]; - CGAL_polygon_assertion(td.is_in_tree); + CGAL_assertion(td.is_in_tree); It cur_seg = td.tree_it; Vertex_index cur_vt = (td.is_left_to_right) ? next_edge : cur_edge; if (cur_seg != tree->begin()) { diff --git a/Polygon/include/CGAL/Polygon_2/polygon_assertions.h b/Polygon/include/CGAL/Polygon_2/polygon_assertions.h deleted file mode 100644 index 47711d72fef..00000000000 --- a/Polygon/include/CGAL/Polygon_2/polygon_assertions.h +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) 1997 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_polygon_assertion -#undef CGAL_polygon_assertion_msg -#undef CGAL_polygon_assertion_code - - -#ifndef CGAL_POLYGON_ASSERTIONS_H -#define CGAL_POLYGON_ASSERTIONS_H -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -namespace CGAL{ -inline void set_use_polygon_assertions(bool){} -inline bool get_use_polygon_assertions(){return true;} -} -#else -#include -namespace CGAL{ -inline bool& get_use_polygon_assertions() -{ - CGAL_STATIC_THREAD_LOCAL_VARIABLE(bool, b, true); - return b; -} -inline void set_use_polygon_assertions(bool b) -{ - get_use_polygon_assertions() = b; -} -} -#endif -#endif // CGAL_POLYGON_ASSERTIONS_H - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_polygon_assertion(EX) (static_cast(0)) -# define CGAL_polygon_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_assertion_code(CODE) -#else -# define CGAL_polygon_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_assertion_code(CODE) CODE -# define CGAL_polygon_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_exactness_assertion -#undef CGAL_polygon_exactness_assertion_msg -#undef CGAL_polygon_exactness_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_assertion(EX) (static_cast(0)) -# define CGAL_polygon_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_assertion_code(CODE) -#else -# define CGAL_polygon_exactness_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_assertion_code(CODE) CODE -# define CGAL_polygon_exactness_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_expensive_assertion -#undef CGAL_polygon_expensive_assertion_msg -#undef CGAL_polygon_expensive_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_assertion(EX) (static_cast(0)) -# define CGAL_polygon_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_assertion_code(CODE) -#else -# define CGAL_polygon_expensive_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_assertion_code(CODE) CODE -# define CGAL_polygon_expensive_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -#undef CGAL_polygon_expensive_exactness_assertion -#undef CGAL_polygon_expensive_exactness_assertion_msg -#undef CGAL_polygon_expensive_exactness_assertion_code - -#if defined(CGAL_POLYGON_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_assertion(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_assertion_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_assertions 1 -#endif // CGAL_POLYGON_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_polygon_precondition -#undef CGAL_polygon_precondition_msg -#undef CGAL_polygon_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_polygon_precondition(EX) (static_cast(0)) -# define CGAL_polygon_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_precondition_code(CODE) -#else -# define CGAL_polygon_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_precondition_code(CODE) CODE -# define CGAL_polygon_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_exactness_precondition -#undef CGAL_polygon_exactness_precondition_msg -#undef CGAL_polygon_exactness_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_precondition(EX) (static_cast(0)) -# define CGAL_polygon_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_precondition_code(CODE) -#else -# define CGAL_polygon_exactness_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_precondition_code(CODE) CODE -# define CGAL_polygon_exactness_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_expensive_precondition -#undef CGAL_polygon_expensive_precondition_msg -#undef CGAL_polygon_expensive_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_precondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_precondition_code(CODE) -#else -# define CGAL_polygon_expensive_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_precondition_code(CODE) CODE -# define CGAL_polygon_expensive_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -#undef CGAL_polygon_expensive_exactness_precondition -#undef CGAL_polygon_expensive_exactness_precondition_msg -#undef CGAL_polygon_expensive_exactness_precondition_code - -#if defined(CGAL_POLYGON_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_precondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_precondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_preconditions 1 -#endif // CGAL_POLYGON_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_polygon_postcondition -#undef CGAL_polygon_postcondition_msg -#undef CGAL_polygon_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_polygon_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_postcondition_code(CODE) -#else -# define CGAL_polygon_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_postcondition_code(CODE) CODE -# define CGAL_polygon_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_exactness_postcondition -#undef CGAL_polygon_exactness_postcondition_msg -#undef CGAL_polygon_exactness_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_postcondition_code(CODE) -#else -# define CGAL_polygon_exactness_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_postcondition_code(CODE) CODE -# define CGAL_polygon_exactness_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_expensive_postcondition -#undef CGAL_polygon_expensive_postcondition_msg -#undef CGAL_polygon_expensive_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_postcondition_code(CODE) -#else -# define CGAL_polygon_expensive_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_postcondition_code(CODE) CODE -# define CGAL_polygon_expensive_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -#undef CGAL_polygon_expensive_exactness_postcondition -#undef CGAL_polygon_expensive_exactness_postcondition_msg -#undef CGAL_polygon_expensive_exactness_postcondition_code - -#if defined(CGAL_POLYGON_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_postcondition(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_postcondition_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_postconditions 1 -#endif // CGAL_POLYGON_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_polygon_warning -#undef CGAL_polygon_warning_msg -#undef CGAL_polygon_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_polygon_warning(EX) (static_cast(0)) -# define CGAL_polygon_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_warning_code(CODE) -#else -# define CGAL_polygon_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_warning_code(CODE) CODE -# define CGAL_polygon_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_exactness_warning -#undef CGAL_polygon_exactness_warning_msg -#undef CGAL_polygon_exactness_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_polygon_exactness_warning(EX) (static_cast(0)) -# define CGAL_polygon_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_exactness_warning_code(CODE) -#else -# define CGAL_polygon_exactness_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_exactness_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_exactness_warning_code(CODE) CODE -# define CGAL_polygon_exactness_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_expensive_warning -#undef CGAL_polygon_expensive_warning_msg -#undef CGAL_polygon_expensive_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_warning(EX) (static_cast(0)) -# define CGAL_polygon_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_warning_code(CODE) -#else -# define CGAL_polygon_expensive_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_warning_code(CODE) CODE -# define CGAL_polygon_expensive_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS - - -#undef CGAL_polygon_expensive_exactness_warning -#undef CGAL_polygon_expensive_exactness_warning_msg -#undef CGAL_polygon_expensive_exactness_warning_code - -#if defined(CGAL_POLYGON_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_POLYGON_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_POLYGON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_polygon_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_polygon_expensive_exactness_warning_code(CODE) -#else -# define CGAL_polygon_expensive_exactness_warning(EX) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_polygon_expensive_exactness_warning_msg(EX,MSG) \ - ((!get_use_polygon_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_polygon_expensive_exactness_warning_code(CODE) CODE -# define CGAL_polygon_expensive_exactness_warnings 1 -#endif // CGAL_POLYGON_NO_WARNINGS diff --git a/Polygon/include/CGAL/Polygon_2_algorithms.h b/Polygon/include/CGAL/Polygon_2_algorithms.h index 5c836466c11..8233269217a 100644 --- a/Polygon/include/CGAL/Polygon_2_algorithms.h +++ b/Polygon/include/CGAL/Polygon_2_algorithms.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include /// namespace CGAL { diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 1699ca2a0f9..3906fe9dab3 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -32,7 +32,11 @@ /// Functions to test if there are self intersections, and to report faces that do intersect. /// \ingroup PkgPolygonMeshProcessingRef -/// \defgroup PMP_repairing_grp Combinatorial Repairing +/// \defgroup PMP_combinatorial_repair_grp Combinatorial Repair +/// Functions to repair polygon soups and polygon meshes. +/// \ingroup PkgPolygonMeshProcessingRef + +/// \defgroup PMP_geometric_repair_grp Geometric Repair /// Functions to repair polygon soups and polygon meshes. /// \ingroup PkgPolygonMeshProcessingRef @@ -162,7 +166,7 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage. - `CGAL::Polyhedral_envelope` - `CGAL::Side_of_triangle_mesh` -\cgalCRPSection{Combinatorial Repairing Functions} +\cgalCRPSection{Combinatorial Repair Functions} - `CGAL::Polygon_mesh_processing::merge_duplicate_points_in_polygon_soup()` - `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()` - `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()` @@ -179,6 +183,8 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage. - `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()` + +\cgalCRPSection{Geometric Repair Functions} - `CGAL::Polygon_mesh_processing::remove_almost_degenerate_faces()` \cgalCRPSection{Connected Components} 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 08e11df647d..947c907a7b3 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 @@ -46,7 +46,8 @@ and smoothing algorithms. - \ref PMPPredicates : predicates that can be evaluated on the processed polygon. mesh, which includes point location and self intersection tests. - \ref PMPOrientation : checking or fixing the orientation of a polygon soup. -- \ref PMPRepairing : repair of polygon meshes and polygon soups. +- \ref PMPCombinatorialRepair : repair of polygon meshes and polygon soups. +- \ref PMPGeometricRepair : repair of the geometry of polygon meshes. - \ref PMPNormalComp : normal computation at vertices and on faces of a polygon mesh. - \ref PMPSlicer : functor able to compute the intersections of a polygon mesh with arbitrary planes (slicer). - \ref PMPConnectedComponents : methods to deal with connected @@ -59,7 +60,7 @@ of the graph concepts defined in the package \ref PkgBGLRef. Using common graph enables having common input/output functions for all the models of these concepts. The page \ref PkgBGLIOFct provides an exhaustive description of the available I/O functions. In addition, this package offers the function `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()`, -which can perform some reparation if the input data do not represent a manifold surface. +which can perform some repairing if the input data do not represent a manifold surface. **************************************** \section PMPMeshing Meshing @@ -746,7 +747,7 @@ This example shows how to correctly repair and orient a soup to get a mesh from **************************************** -\section PMPRepairing Combinatorial Repairing +\section PMPCombinatorialRepair Combinatorial Repair ******************* \subsection PSRepairing Polygon Soup Repairing @@ -785,31 +786,7 @@ with duplicated border edges. \cgalExample{Polygon_mesh_processing/stitch_borders_example.cpp} -\if READY_TO_PUBLISH - -\subsection DegenerateFaces Removing Degenerate Faces - -Some degenerate faces may be part of a given triangle mesh. -A face is considered \e degenerate if two of its vertices -share the same location, or more generally if its three vertices are collinear. -The function `CGAL::Polygon_mesh_processing::remove_degenerate_faces()` -removes those faces and fixes the connectivity of the newly cleaned up mesh. -It is also possible to remove isolated vertices from any polygon mesh, using the function -`CGAL::Polygon_mesh_processing::remove_isolated_vertices()`. - -\subsubsection RemoveDegenerateExample Example - -In the following example, the degenerate faces of a triangle mesh -are removed, the connectivity is fixed, and the number of removed faces -is output. - -\cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp} -\endif - \subsection PMPManifoldness Polygon Mesh Manifoldness -This package offers repairing methods to clean ill-formed polygon soups, -see Section \ref PMPRepairing. - Non-manifold vertices can be detected using the function `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`. The function `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` can be used to attempt to create a combinatorially manifold surface mesh by splitting any non-manifold vertex @@ -835,6 +812,9 @@ more than once (although, with different vertices) before reaching the initial b `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()`, which merge vertices at identical positions, can be used to repair this configuration. +\section PMPGeometricRepair Geometric Repair +**************************************** + \subsection PMPRemoveCapsNeedles Removal of Almost Degenerate Triangle Faces Triangle faces of a mesh made up of almost collinear points are badly shaped elements that might not be desirable to have in a mesh. The function @@ -844,6 +824,27 @@ As some badly shaped elements are inevitable (the triangulation of a long cylind with only vertices on the top and bottom circles for example), extra parameters can be passed to prevent the removal of such elements (`collapse_length_threshold` and `flip_triangle_height_threshold`). +\if READY_TO_PUBLISH + +\subsection DegenerateFaces Removing Degenerate Faces + +Some degenerate faces may be part of a given triangle mesh. +A face is considered \e degenerate if two of its vertices +share the same location, or more generally if its three vertices are collinear. +The function `CGAL::Polygon_mesh_processing::remove_degenerate_faces()` +removes those faces and fixes the connectivity of the newly cleaned up mesh. +It is also possible to remove isolated vertices from any polygon mesh, using the function +`CGAL::Polygon_mesh_processing::remove_isolated_vertices()`. + +\subsubsection RemoveDegenerateExample Example + +In the following example, the degenerate faces of a triangle mesh +are removed, the connectivity is fixed, and the number of removed faces +is output. + +\cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp} +\endif + **************************************** \section PMPNormalComp Computing Normals diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp index 8b49c843d29..67c2c3615fe 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_progress.cpp @@ -105,6 +105,7 @@ struct Visitor : public PMP::Corefinement::Default_visitor { std::shared_ptr sptr; + mutable std::size_t tf_counter = 0; Visitor() : sptr(std::make_shared()) @@ -124,15 +125,16 @@ struct Visitor : std::cout << "Visitor::end_filtering_intersections() at " << sptr->time() << " sec." << std::endl; } - void start_triangulating_faces(std::size_t tf)const + void start_triangulating_faces(std::size_t tf) const { std::cout << "Visitor::start_triangulation() with " << tf << " faces at " << sptr->time() << " sec." << std::endl; sptr->start_triangulating_faces(tf); + tf_counter = 0; } - void face_triangulation(std::size_t i) const + void triangulating_faces_step() const { - sptr->face_triangulation(i); + sptr->face_triangulation(tf_counter++); } void end_triangulating_faces()const @@ -140,7 +142,7 @@ struct Visitor : std::cout << "Visitor::end_triangulating_faces() at " << sptr->time() << " sec." << std::endl; } - void start_coplanar_faces(std::size_t i) const + void start_handling_intersection_of_coplanar_faces(std::size_t i) const { sptr->start_coplanar_faces(i); } @@ -150,12 +152,12 @@ struct Visitor : sptr->intersection_of_coplanar_faces_step(); } - void end_coplanar_faces() const + void end_handling_intersection_of_coplanar_faces() const { std::cout << "Visitor::end_coplanar_faces() at " << sptr->time() << " sec." << std::endl; } - void start_intersection_points(std::size_t i) const + void start_handling_edge_face_intersections(std::size_t i) const { sptr->start_intersection_points(i); } @@ -165,7 +167,7 @@ struct Visitor : sptr->edge_face_intersections_step(); } - void end_intersection_points() const + void end_handling_edge_face_intersections() const { std::cout << "Visitor::end_intersection_points() at " << sptr->time() << " sec." << std::endl; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp index 484abcdefae..e58267d6da7 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/repair_polygon_soup_example.cpp @@ -17,7 +17,12 @@ typedef K::Point_3 Point_3; typedef CGAL::Surface_mesh Mesh; typedef std::array Custom_point; +//#define CGAL_USE_ARRAY_POLYGONS_IN_EXAMPLE +#ifdef CGAL_USE_ARRAY_POLYGONS_IN_EXAMPLE +typedef std::array CGAL_Polygon; +#else typedef std::vector CGAL_Polygon; +#endif namespace PMP = CGAL::Polygon_mesh_processing; @@ -47,54 +52,41 @@ int main(int, char**) std::vector > points; std::vector polygons; - points.push_back(CGAL::make_array(0,0,0)); - points.push_back(CGAL::make_array(1,0,0)); - points.push_back(CGAL::make_array(0,1,0)); - points.push_back(CGAL::make_array(-1,0,0)); - points.push_back(CGAL::make_array(0,-1,0)); - points.push_back(CGAL::make_array(0,1,0)); // duplicate point - points.push_back(CGAL::make_array(0,-2,0)); // unused point + points.push_back(CGAL::make_array( 0, 0, 0)); // 0 + points.push_back(CGAL::make_array( 1, 0, 0)); // 1 + points.push_back(CGAL::make_array( 0, 1, 0)); // 2 + points.push_back(CGAL::make_array(-1, 0, 0)); // 3 + points.push_back(CGAL::make_array( 0, -1, 0)); // 4 + points.push_back(CGAL::make_array( 0, 1, 0)); // 5 -- duplicate point with 2 + points.push_back(CGAL::make_array( 0, -2, 0)); // 6 -- unused point - CGAL_Polygon p; - p.push_back(0); p.push_back(1); p.push_back(2); - polygons.push_back(p); + // normal face + polygons.push_back({0,1,2}); // degenerate face - p.clear(); - p.push_back(0); p.push_back(0); p.push_back(0); - polygons.push_back(p); + polygons.push_back({0,0,0}); - p.clear(); - p.push_back(0); p.push_back(1); p.push_back(4); - polygons.push_back(p); + // duplicate faces with different orientations + polygons.push_back({0,1,4}); + polygons.push_back({0,4,1}); - // duplicate face with different orientation - p.clear(); - p.push_back(0); p.push_back(4); p.push_back(1); - polygons.push_back(p); - - p.clear(); - p.push_back(0); p.push_back(3); p.push_back(5); - polygons.push_back(p); + // normal face + polygons.push_back({0,3,5}); // degenerate face - p.clear(); - p.push_back(0); p.push_back(3); p.push_back(0); - polygons.push_back(p); + polygons.push_back({0,3,0}); - p.clear(); - p.push_back(0); p.push_back(3); p.push_back(4); - polygons.push_back(p); + // normal face + polygons.push_back({0,3,4}); +#ifndef CGAL_USE_ARRAY_POLYGONS_IN_EXAMPLE // pinched and degenerate face - p.clear(); - p.push_back(0); p.push_back(1); p.push_back(2); p.push_back(3); - p.push_back(4); p.push_back(3); p.push_back(2); p.push_back(1); - polygons.push_back(p); + polygons.push_back({0,1,2,3,4,3,2,1}); +#endif - std::cout << "Before reparation, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; + std::cout << "Before repairing, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; PMP::repair_polygon_soup(points, polygons, CGAL::parameters::geom_traits(Array_traits())); - std::cout << "After reparation, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; + std::cout << "After repairing, the soup has " << points.size() << " vertices and " << polygons.size() << " faces" << std::endl; Mesh mesh; PMP::orient_polygon_soup(points, polygons); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 580dccecb52..96e61d7bb67 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -21,7 +21,7 @@ #include #include -#include +#include namespace CGAL { @@ -179,6 +179,8 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_edge_descriptor(ed, pmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, pmesh)); @@ -234,6 +236,8 @@ namespace CGAL { using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(fd, pmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, pmesh)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h index 362d74025c2..c3a1581c80e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/border.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h index 3fed0d943cb..ee92e8e3640 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/clip.h @@ -285,10 +285,11 @@ clip_to_bbox(const Plane_3& plane, return ON_ORIENTED_BOUNDARY; } -template +template void split_along_edges(TriangleMesh& tm, Ecm ecm, - VPM vpm) + VPM vpm, + UserVisitor& user_visitor) { typedef boost::graph_traits GT; typedef typename GT::face_descriptor face_descriptor; @@ -337,8 +338,10 @@ void split_along_edges(TriangleMesh& tm, halfedge_descriptor h = halfedge(shared_edges[k], tm); face_descriptor fh = face(h, tm); //add edge + user_visitor.before_edge_duplicated(h, tm); halfedge_descriptor new_hedge = halfedge(add_edge(tm), tm), new_opp = opposite(new_hedge,tm); + user_visitor.after_edge_duplicated(h, new_hedge, tm); vertex_descriptor vt = target(h, tm); vertex_descriptor vs = source(h, tm); @@ -395,8 +398,11 @@ void split_along_edges(TriangleMesh& tm, for(const std::pair& p : vertices_to_duplicate) { + user_visitor.before_vertex_copy(p.second, tm, tm); vertex_descriptor nv = add_vertex(tm); put(vpm, nv, get(vpm, p.second)); + user_visitor.after_vertex_copy(p.second, tm, nv, tm); + for(halfedge_descriptor h : halfedges_around_target(p.first, tm)) set_target(h, nv, tm); set_halfedge(nv, p.first, tm); @@ -919,6 +925,14 @@ void split(TriangleMesh& tm, Ecm ecm = get(CGAL::dynamic_edge_property_t(), tm); + typedef typename internal_np::Lookup_named_param_def < + internal_np::visitor_t, + NamedParameters1, + Corefinement::Default_visitor//default + > ::type User_visitor; + User_visitor uv(choose_parameter(get_parameter(np_tm, internal_np::visitor))); + + // create a constrained edge map and corefine input mesh with the splitter, // and mark edges @@ -929,7 +943,7 @@ void split(TriangleMesh& tm, CGAL::parameters::vertex_point_map(vpm_s).do_not_modify(do_not_modify_splitter)); //split mesh along marked edges - internal::split_along_edges(tm, ecm, vpm_tm); + internal::split_along_edges(tm, ecm, vpm_tm, uv); } /** diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h index 2cd837e7bf8..47dd64b4f36 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/compute_normal.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -89,6 +89,8 @@ void sum_normals(const PM& pmesh, typedef typename boost::property_traits::reference Point_ref; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + halfedge_descriptor he = halfedge(f, pmesh); vertex_descriptor v = source(he, pmesh); vertex_descriptor the = target(he,pmesh); @@ -172,6 +174,8 @@ compute_face_normal(typename boost::graph_traits::face_descriptor f using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + typedef typename GetGeomTraits::type GT; GT traits = choose_parameter(get_parameter(np, internal_np::geom_traits)); @@ -665,6 +669,8 @@ compute_vertex_normal(typename boost::graph_traits::vertex_descript using parameters::is_default_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_vertex_descriptor(v, pmesh)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 1b0b7e2e791..525f020a342 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -32,9 +32,6 @@ #include #include -#include -#include - #include #include #include @@ -42,7 +39,7 @@ #include #include -#include +#include namespace CGAL { namespace Polygon_mesh_processing{ @@ -418,11 +415,12 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, // vector_property_map boost::vector_property_map face_cc(static_cast(num_faces(pmesh)), fimap); - std::size_t num = connected_components(pmesh, face_cc, np); // Even if we do not want to keep anything we need to first // calculate the number of existing connected_components to get the // correct return value. + const std::size_t num = connected_components(pmesh, face_cc, np); + if(nb_components_to_keep == 0) { CGAL::clear(pmesh); @@ -445,12 +443,12 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh, if(dry_run) { - std::vector is_to_be_removed(num, false); + std::vector is_to_be_kept(num, false); for(std::size_t i=0; i #include -#include +#include #include #include @@ -57,6 +57,8 @@ is_sharp(const typename boost::graph_traits::halfedge_descriptor h, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); + if(is_border_edge(h, pmesh)) return false; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index c4ab5aa0a1b..4237fa85b6f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 528f501d83c..d02ef3a9023 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #if defined(CGAL_EIGEN3_ENABLED) @@ -76,7 +76,7 @@ namespace internal { do not suffice to solve constructed linear system. Note that if the vertex range to which fairing is applied contains all the vertices of the triangle mesh, - fairing does not fail, but the mesh gets shrinked to `CGAL::ORIGIN`. + fairing does not fail, but the mesh gets shrunk to `CGAL::ORIGIN`. @tparam TriangleMesh a model of `FaceGraph` and `MutableFaceGraph` @tparam VertexRange a range of vertex descriptors of `TriangleMesh`, model of `Range`. diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h index f9595ef7358..79b7f260e69 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Face_graph_output_builder.h @@ -1037,12 +1037,69 @@ public: std::size_t patch_id_q1=tm2_patch_ids[ get(fids2, face(opposite(h2,tm2),tm2)) ]; std::size_t patch_id_q2=tm2_patch_ids[ get(fids2, face(h2,tm2)) ]; + // info on whether the patches were already classified + std::bitset<4> patch_status_was_not_already_set; + std::bitset<4> previous_bitvalue; + // info for tm1 + patch_status_was_not_already_set[0] = patch_status_not_set_tm1.test(patch_id_p1); + patch_status_was_not_already_set[1] = patch_status_not_set_tm1.test(patch_id_p2); + previous_bitvalue[0] = is_patch_inside_tm2.test(patch_id_p1); + previous_bitvalue[1] = is_patch_inside_tm2.test(patch_id_p2); + // info for tm2 + patch_status_was_not_already_set[2] = patch_status_not_set_tm2.test(patch_id_q1); + patch_status_was_not_already_set[3] = patch_status_not_set_tm2.test(patch_id_q2); + previous_bitvalue[2] = is_patch_inside_tm1.test(patch_id_q1); + previous_bitvalue[3] = is_patch_inside_tm1.test(patch_id_q2); + +#ifndef CGAL_NDEBUG + if (is_tm1_closed && is_tm2_closed) + { + if (!patch_status_was_not_already_set[0] && + !patch_status_was_not_already_set[1] && + !patch_status_was_not_already_set[2] && + !patch_status_was_not_already_set[3]) + continue; // all patches were already classified, no need to redo it + } +#endif + + // check incompatibility of patch classifications + auto inconsistent_classification = [&]() + { + if (!used_to_clip_a_surface && !used_to_classify_patches && (!is_tm1_closed || !is_tm2_closed)) + { + //make sure there is no ambiguity in tm1 + if( (!patch_status_was_not_already_set[0] && previous_bitvalue[0]!=is_patch_inside_tm2.test(patch_id_p1) ) || + (!patch_status_was_not_already_set[1] && previous_bitvalue[1]!=is_patch_inside_tm2.test(patch_id_p2) ) ) + { + impossible_operation.set(); + return true; + } + //make sure there is no ambiguity in tm2 + if( (!patch_status_was_not_already_set[2] && previous_bitvalue[2]!=is_patch_inside_tm1.test(patch_id_q1) ) || + (!patch_status_was_not_already_set[3] && previous_bitvalue[3]!=is_patch_inside_tm1.test(patch_id_q2) ) ) + { + impossible_operation.set(); + return true; + } + } + return false; + }; + //indicates that patch status will be updated patch_status_not_set_tm1.reset(patch_id_p1); patch_status_not_set_tm1.reset(patch_id_p2); patch_status_not_set_tm2.reset(patch_id_q1); patch_status_not_set_tm2.reset(patch_id_q2); + // restore initial state, needed when checking in `inconsistent_classification()` + if (!is_tm1_closed || !is_tm2_closed) + { + is_patch_inside_tm2.reset(patch_id_p1); + is_patch_inside_tm2.reset(patch_id_p2); + is_patch_inside_tm1.reset(patch_id_q1); + is_patch_inside_tm1.reset(patch_id_q2); + } + #ifdef CGAL_COREFINEMENT_POLYHEDRA_DEBUG #warning: Factorize the orientation predicates. #endif //CGAL_COREFINEMENT_POLYHEDRA_DEBUG @@ -1082,6 +1139,7 @@ public: if ( q2_is_between_p1p2 ) is_patch_inside_tm1.set(patch_id_q2); //case 1 else is_patch_inside_tm2.set(patch_id_p2); //case 2 + if (inconsistent_classification()) return; continue; } else{ @@ -1112,6 +1170,7 @@ public: is_patch_inside_tm1.set(patch_id_q1); is_patch_inside_tm2.set(patch_id_p2); } //else case 4 + if (inconsistent_classification()) return; continue; } else @@ -1142,6 +1201,7 @@ public: is_patch_inside_tm1.set(patch_id_q2); is_patch_inside_tm2.set(patch_id_p1); } // else case 6 + if (inconsistent_classification()) return; continue; } else{ @@ -1170,6 +1230,7 @@ public: if ( q1_is_between_p1p2 ) is_patch_inside_tm1.set(patch_id_q1); //case 7 else is_patch_inside_tm2.set(patch_id_p1); //case 8 + if (inconsistent_classification()) return; continue; } } @@ -1331,6 +1392,11 @@ public: } } } + if (inconsistent_classification()) return; + CGAL_assertion( patch_status_was_not_already_set[0] || previous_bitvalue[0]==is_patch_inside_tm2[patch_id_p1] ); + CGAL_assertion( patch_status_was_not_already_set[1] || previous_bitvalue[1]==is_patch_inside_tm2[patch_id_p2] ); + CGAL_assertion( patch_status_was_not_already_set[2] || previous_bitvalue[2]==is_patch_inside_tm1[patch_id_q1] ); + CGAL_assertion( patch_status_was_not_already_set[3] || previous_bitvalue[3]==is_patch_inside_tm1[patch_id_q2] ); } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h index bff8f35189f..edc7d892bab 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/face_graph_utils.h @@ -781,6 +781,7 @@ struct Patch_container{ Patch_description& patch=this->operator[](i); std::stringstream ss; + ss.precision(17); std::map vertexid; int id=0; for(vertex_descriptor vh : patch.interior_vertices) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 0dc2f54f2b4..beb20bef0a2 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -322,7 +322,7 @@ namespace internal { { halfedge_status_pmap_ = get(CGAL::dynamic_halfedge_property_t(), pmesh); - CGAL_assertion_code(input_mesh_is_valid_ = CGAL::is_valid_polygon_mesh(pmesh)); + CGAL_warning_code(input_mesh_is_valid_ = CGAL::is_valid_polygon_mesh(pmesh)); CGAL_warning_msg(input_mesh_is_valid_, "The input mesh is not a valid polygon mesh. " "It could lead PMP::isotropic_remeshing() to fail."); @@ -405,7 +405,9 @@ namespace internal { } //split long edges +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_splits = 0; +#endif while (!long_edges.empty()) { //the edge with longest length @@ -420,7 +422,9 @@ namespace internal { // propagate the constrained status put(ecmap_, edge(hnew, mesh_), get(ecmap_, edge(he, mesh_))); CGAL_assertion(he == next(hnew, mesh_)); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_splits; +#endif //move refinement point vertex_descriptor vnew = target(hnew, mesh_); @@ -497,7 +501,9 @@ namespace internal { } //split long edges +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_splits = 0; +#endif while (!long_edges.empty()) { //the edge with longest length @@ -524,8 +530,9 @@ namespace internal { halfedge_descriptor hnew = CGAL::Euler::split_edge(he, mesh_); CGAL_assertion(he == next(hnew, mesh_)); put(ecmap_, edge(hnew, mesh_), get(ecmap_, edge(he, mesh_)) ); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_splits; - +#endif //move refinement point vertex_descriptor vnew = target(hnew, mesh_); put(vpmap_, vnew, refinement_point); @@ -642,7 +649,9 @@ namespace internal { std::cout << "done." << std::endl; #endif +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_collapses = 0; +#endif while (!short_edges.empty()) { //the edge with shortest length @@ -779,8 +788,9 @@ namespace internal { vertex_descriptor vkept = CGAL::Euler::collapse_edge(e, mesh_, ecmap_); CGAL_assertion(is_valid(mesh_)); CGAL_assertion(vkept == vb);//is the constrained point still here +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_collapses; - +#endif //fix constrained case CGAL_assertion((is_constrained(vkept) || is_corner(vkept) || is_on_patch_border(vkept)) == (is_va_constrained || is_vb_constrained || is_va_on_constrained_polyline || is_vb_on_constrained_polyline)); @@ -842,7 +852,9 @@ namespace internal { const double cap_threshold = std::cos(160. / 180 * CGAL_PI); +#ifdef CGAL_PMP_REMESHING_VERBOSE unsigned int nb_flips = 0; +#endif for(edge_descriptor e : edges(mesh_)) { //only the patch edges are allowed to be flipped @@ -906,8 +918,9 @@ namespace internal { put(degree, vc, vvc); put(degree, vd, vvd); +#ifdef CGAL_PMP_REMESHING_VERBOSE ++nb_flips; - +#endif #ifdef CGAL_PMP_REMESHING_VERBOSE_PROGRESS std::cout << "\r\t(" << nb_flips << " flips)"; std::cout.flush(); @@ -956,8 +969,9 @@ namespace internal { put(degree, vc, vvc); put(degree, vd, vvd); +#ifdef CGAL_PMP_REMESHING_VERBOSE --nb_flips; - +#endif CGAL_assertion_code(Halfedge_status s3 = status(he)); CGAL_assertion(s1 == s3); CGAL_assertion(!is_border(he, mesh_)); @@ -1635,8 +1649,6 @@ private: const double& sq_low, const bool collapse_constraints) { - CGAL_assertion_code(std::size_t nb_done = 0); - std::unordered_set degenerate_faces; for(halfedge_descriptor h : halfedges_around_target(halfedge(v, mesh_), mesh_)) @@ -1695,7 +1707,6 @@ private: continue; CGAL::Euler::flip_edge(hf, mesh_); - CGAL_assertion_code(++nb_done); done = true; //update status @@ -1891,6 +1902,11 @@ private: else if(is_an_isolated_constraint(h)) nb_isolated++; else CGAL_assertion(false); } + CGAL_USE(nb_border); + CGAL_USE(nb_mesh); + CGAL_USE(nb_patch); + CGAL_USE(nb_patch_border); + CGAL_USE(nb_isolated); } #ifdef CGAL_PMP_REMESHING_DEBUG diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h index 66ecda4314e..3757f23f7d6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index 16f8de52d49..9f04800cea6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -161,8 +161,9 @@ public: put(marks, e, false); for(edge_descriptor e : edge_range) put(marks, e, true); - +#ifdef CGAL_PMP_SMOOTHING_DEBUG int flipped_n = 0; +#endif while(!edge_range.empty()) { edge_descriptor e = edge_range.back(); @@ -172,8 +173,9 @@ public: if(should_be_flipped(e)) { +#ifdef CGAL_PMP_SMOOTHING_DEBUG ++flipped_n; - +#endif halfedge_descriptor h = halfedge(e, mesh_); #ifdef CGAL_PMP_SMOOTHING_DEBUG_PP diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h index ce67cc83a84..20e95e59610 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/helper.h @@ -13,12 +13,12 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_INTERNAL_SNAPPING_HELPER_H #define CGAL_POLYGON_MESH_PROCESSING_INTERNAL_SNAPPING_HELPER_H -#include +#include #include #include #include -#include +#include namespace CGAL { namespace Polygon_mesh_processing { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h index 4520e825de5..1388ebaeb22 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap.h @@ -14,7 +14,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_SNAPPING_SNAP_H #define CGAL_POLYGON_MESH_PROCESSING_SNAPPING_SNAP_H -#include +#include #ifdef CGAL_PMP_SNAP_DEBUG_PP #ifndef CGAL_PMP_SNAP_DEBUG @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -1009,7 +1009,7 @@ std::size_t snap_non_conformal_one_way(const HalfedgeRange& halfedge_range_S, } } -// \ingroup PMP_repairing_grp +// \ingroup PMP_geometric_repair_grp // // Attempts to snap the vertices in `halfedge_range_A` onto edges of `halfedge_range_B`, and reciprocally. // A vertex from the first range is only snapped to an edge of the second range if the distance to diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h index 91f1a51952b..10043e346a8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Snapping/snap_vertices.h @@ -13,7 +13,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_SNAPPING_SNAP_VERTICES_H #define CGAL_POLYGON_MESH_PROCESSING_SNAPPING_SNAP_VERTICES_H -#include +#include #ifdef CGAL_PMP_SNAP_DEBUG_PP #ifndef CGAL_PMP_SNAP_DEBUG @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -1140,7 +1140,7 @@ std::size_t snap_vertices_two_way(const HalfedgeRange_A& halfedge_range_A, namespace experimental { -// \ingroup PMP_repairing_grp +// \ingroup PMP_geometric_repair_grp // // Attempts to snap the vertices in `halfedge_range_A` and `halfedge_range_B`. // A vertex from the first range and a vertex from the second range are only snapped diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h deleted file mode 100644 index 38d431e8005..00000000000 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h +++ /dev/null @@ -1,19 +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) : Jane Tournois - -#ifndef CGAL_NAMED_PARAMETERS_HELPERS_H -#define CGAL_NAMED_PARAMETERS_HELPERS_H - -#include - -#include - -#endif //CGAL_NAMED_PARAMETERS_HELPERS_H diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h index 727c5f50109..54369aee910 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/refine_impl.h @@ -103,7 +103,7 @@ private: { for(face_descriptor fd : faces) { - CGAL_assertion(fd != boost::graph_traits::null_face()); + CGAL_assertion(is_valid_face_descriptor(fd, pmesh)); vertex_descriptor vi = target(halfedge(fd,pmesh),pmesh); vertex_descriptor vj = target(next(halfedge(fd,pmesh),pmesh),pmesh); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/repair_extra.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/repair_extra.h index af22ed1df25..2e3b8a63d7a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/repair_extra.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/repair_extra.h @@ -14,7 +14,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_INTERNAL_REPAIR_EXTRA_H #define CGAL_POLYGON_MESH_PROCESSING_INTERNAL_REPAIR_EXTRA_H -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/simplify_polyline.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/simplify_polyline.h index 016dedea22d..74fc83d0ec8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/simplify_polyline.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/simplify_polyline.h @@ -13,7 +13,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_SIMPLIFY_POLYLINE_H #define CGAL_POLYGON_MESH_PROCESSING_SIMPLIFY_POLYLINE_H -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index b4c79ee345c..23256eb00b6 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 323c0fbb089..4bf778aca29 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -442,8 +442,8 @@ random_location_on_face(typename boost::graph_traits::face_descrip CGAL::Random& rnd = get_default_random()) { CGAL_USE(tm); - CGAL_precondition(CGAL::is_triangle_mesh(tm)); - CGAL_precondition(fd != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_face_descriptor(fd, tm)); + CGAL_precondition(is_triangle(halfedge(fd, tm), tm)); // calling 'rnd.uniform real' with double in case FT comes from an EPECK kernel (which doesn't seem to work too well) FT u(rnd.uniform_real(0., 1.)); @@ -523,8 +523,8 @@ get_descriptor_from_location(const std::pair::null_face()); + CGAL_precondition(is_valid_face_descriptor(fd, tm)); + CGAL_precondition(is_triangle(halfedge(fd, tm), tm)); CGAL_precondition(is_in_face(loc, tm)); // the first barycentric coordinate corresponds to source(halfedge(fd, tm), tm) @@ -942,11 +942,10 @@ locate_vertex(typename boost::graph_traits::vertex_descriptor vd, } } - CGAL_postcondition(!CGAL::is_border(hd, tm)); // must find a 'real' face incident to 'vd' + CGAL_postcondition(!is_border(hd, tm)); // must find a 'real' face incident to 'vd' + CGAL_assertion(target(hd, tm) == vd); face_descriptor fd = face(hd, tm); - - CGAL_assertion(target(hd, tm) == vd); CGAL_assertion(fd != boost::graph_traits::null_face()); // isolated vertex @@ -989,7 +988,7 @@ locate_vertex(const typename boost::graph_traits::vertex_descripto const typename boost::graph_traits::face_descriptor fd, const TriangleMesh& tm) { - CGAL_precondition(fd != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_vertex_descriptor(vd, tm) && is_valid_face_descriptor(fd, tm)); FT coords[3] = { FT(0), FT(0), FT(0) }; std::size_t vertex_local_index = vertex_index_in_face(vd, fd, tm); @@ -1121,14 +1120,14 @@ locate_in_face(const typename internal::Location_traits(get_parameter(np, internal_np::geom_traits)); FT snap_tolerance = choose_parameter(get_parameter(np, internal_np::snapping_tolerance), 0); - CGAL_precondition(fd != boost::graph_traits::null_face()); - vertex_descriptor vd0 = source(halfedge(fd, tm), tm); vertex_descriptor vd1 = target(halfedge(fd, tm), tm); vertex_descriptor vd2 = target(next(halfedge(fd, tm), tm), tm); @@ -1288,10 +1287,9 @@ locate_in_common_face(std::pair::face else if(const halfedge_descriptor* hd_ptr = boost::get(&dv)) { const halfedge_descriptor hd = *hd_ptr; - face_descriptor fd = face(hd, tm); - - if(fd != boost::graph_traits::null_face()) + if(!is_border(hd, tm)) { + face_descriptor fd = face(hd, tm); query_location = locate_in_face(query, fd, tm, np); internal::snap_location_to_border(query_location, tm, tolerance); // @tmp keep or not ? is_query_location_in_face = is_in_face(query_location, tm); @@ -1299,7 +1297,7 @@ locate_in_common_face(std::pair::face if(!is_query_location_in_face) { - fd = face(opposite(hd, tm), tm); + face_descriptor fd = face(opposite(hd, tm), tm); query_location = locate_in_face(query, fd, tm, np); is_query_location_in_face = is_in_face(query_location, tm); } @@ -1307,7 +1305,6 @@ locate_in_common_face(std::pair::face else { const face_descriptor fd = boost::get(dv); - CGAL_precondition(fd != boost::graph_traits::null_face()); query_location = locate_in_face(query, fd, tm, np); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h index 096cbd61ff5..de45ca3150e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/manifoldness.h @@ -13,10 +13,10 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_MANIFOLDNESS_H #define CGAL_POLYGON_MESH_PROCESSING_MANIFOLDNESS_H -#include +#include #include -#include +#include #include #include @@ -33,7 +33,7 @@ namespace CGAL { namespace Polygon_mesh_processing { -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// \brief returns whether a vertex of a polygon mesh is non-manifold. /// @@ -284,7 +284,7 @@ std::size_t make_umbrella_manifold(typename boost::graph_traits::ha } // end namespace internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// \brief collects the non-manifold vertices (if any) present in the mesh. /// @@ -394,7 +394,7 @@ OutputIterator non_manifold_vertices(const PolygonMesh& pm, return out; } -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// duplicates all the non-manifold vertices of the input mesh. /// 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 85b8dea7f29..2340993b99d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/measure.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include // needed for CGAL::exact(FT)/CGAL::exact(Lazy_exact_nt) @@ -112,7 +112,7 @@ edge_length(typename boost::graph_traits::halfedge_descriptor h, using parameters::choose_parameter; using parameters::get_parameter; - CGAL_precondition(boost::graph_traits::null_halfedge() != h); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -132,6 +132,8 @@ edge_length(typename boost::graph_traits::edge_descriptor e, const PolygonMesh& pmesh, const NamedParameters& np = parameters::default_values()) { + CGAL_precondition(is_valid_edge_descriptor(e, pmesh)); + return edge_length(halfedge(e, pmesh), pmesh, np); } @@ -187,7 +189,7 @@ squared_edge_length(typename boost::graph_traits::halfedge_descript using parameters::choose_parameter; using parameters::get_parameter; - CGAL_precondition(boost::graph_traits::null_halfedge() != h); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -208,6 +210,8 @@ squared_edge_length(typename boost::graph_traits::edge_descriptor e const PolygonMesh& pmesh, const NamedParameters& np = parameters::default_values()) { + CGAL_precondition(is_valid_edge_descriptor(e, pmesh)); + return squared_edge_length(halfedge(e, pmesh), pmesh, np); } @@ -415,7 +419,7 @@ face_area(typename boost::graph_traits::face_descriptor f, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - CGAL_precondition(boost::graph_traits::null_face() != f); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -486,7 +490,7 @@ squared_face_area(typename boost::graph_traits::face_descriptor f, typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; - CGAL_precondition(boost::graph_traits::null_face() != f); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -741,7 +745,7 @@ face_aspect_ratio(typename boost::graph_traits::face_descriptor f, const TriangleMesh& tmesh, const CGAL_NP_CLASS& np = parameters::default_values()) { - CGAL_precondition(f != boost::graph_traits::null_face()); + CGAL_precondition(is_valid_face_descriptor(f, tmesh)); CGAL_precondition(is_triangle(halfedge(f, tmesh), tmesh)); typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h index b0a97548d83..27bda80bc9c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/merge_border_vertices.h @@ -14,13 +14,13 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H #define CGAL_POLYGON_MESH_PROCESSING_MERGE_BORDER_VERTICES_H -#include +#include #include #include #include #include -#include +#include #include #include @@ -204,7 +204,7 @@ void detect_identical_mergeable_vertices( } } -// \ingroup PMP_repairing_grp +// \ingroup PMP_combinatorial_repair_grp // // merges target vertices of a list of halfedges. // Halfedges must be sorted in the list. @@ -259,7 +259,7 @@ void merge_vertices_in_range(const HalfedgeRange& sorted_hedges, } // end of internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// merges identical vertices around a cycle of boundary edges. /// @@ -292,6 +292,8 @@ void merge_duplicated_vertices_in_boundary_cycle(typename boost::graph_traitssecond.begin()); if(oriented[index]) continue; //nothing todo already processed and correctly oriented oriented[index] = true; - // "keep the orientation of polygon #index + // keep the orientation of polygon #index stack.push(index); } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h index 14defb6b29e..612620049a0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orient_polygon_soup_extension.h @@ -15,7 +15,7 @@ #ifndef CGAL_ORIENT_POLYGON_SOUP_EXTENSION_H #define CGAL_ORIENT_POLYGON_SOUP_EXTENSION_H -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h index 31595ae0213..2ea05b9a740 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/orientation.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -1646,6 +1646,12 @@ void merge_reversible_connected_components(PolygonMesh& pm, * \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` * should be available for the vertices of `pm`.} * \cgalParamNEnd + * \cgalParamNBegin{face_partition_id_map} + * \cgalParamDescription{a property map filled by this function and that will contain for each face + * the id of its surface component after reversal and stitching in the range `[0, n - 1]`, + * with `n` the number of such components.} + * \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` as key type and `std::size_t` as value type} + * \cgalParamNEnd * \cgalNamedParamsEnd * * \sa reverse_face_orientations() @@ -1667,6 +1673,15 @@ bool compatible_orientations(const PolygonMesh& pm, Vpm vpm = parameters::choose_parameter(parameters::get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, pm)); + typedef typename internal_np::Lookup_named_param_def < + internal_np::face_partition_id_t, + NamedParameters, + Constant_property_map // default + >::type Partition_map; + + // cc id map if compatible edges were stitched + Partition_map partition_map = parameters::choose_parameter(parameters::get_parameter(np, internal_np::face_partition_id)); + typedef std::size_t F_cc_id; // Face cc-id typedef std::size_t E_id; // Edge id @@ -1753,6 +1768,8 @@ bool compatible_orientations(const PolygonMesh& pm, sorted_ids.insert(cc_id); // consider largest CC first, default and set its bit to 0 + std::size_t partition_id = 0; + std::vector partition_ids(nb_cc); for(F_cc_id cc_id : sorted_ids) { if (cc_handled[cc_id]) continue; @@ -1821,6 +1838,8 @@ bool compatible_orientations(const PolygonMesh& pm, continue; } cc_handled[id]=true; + CGAL_assertion(cc_bits[id]==false); + partition_ids[id] = partition_id; } // set bit of incompatible patches @@ -1839,13 +1858,19 @@ bool compatible_orientations(const PolygonMesh& pm, continue; } cc_handled[id]=true; + partition_ids[id] = partition_id; cc_bits[id]=true; } + ++partition_id; } // set the bit per face for (face_descriptor f : faces(pm)) - put(fbm, f, cc_bits[get(f_cc_ids,f)]); + { + std::size_t f_cc_id = get(f_cc_ids,f); + put(fbm, f, cc_bits[f_cc_id]); + put(partition_map, f, partition_ids[f_cc_id]); + } return true; } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h index 5766b85593f..a0e4f6c178d 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_mesh_to_polygon_soup.h @@ -13,7 +13,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_POLYGON_MESH_TO_POLYGON_SOUP_H #define CGAL_POLYGON_MESH_PROCESSING_POLYGON_MESH_TO_POLYGON_SOUP_H -#include +#include #include #include @@ -55,7 +55,7 @@ struct PM_to_PS_point_converter > } // namespace internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// adds the vertices and faces of a mesh into a (possibly non-empty) polygon soup. /// diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h index 2360904b966..7f4878648ae 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h @@ -13,7 +13,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_POLYGON_SOUP_TO_POLYGON_MESH_H #define CGAL_POLYGON_MESH_PROCESSING_POLYGON_SOUP_TO_POLYGON_MESH_H -#include +#include #include @@ -127,9 +127,8 @@ public: for(std::size_t j = 0; j < size; ++j) vr[j] = vertices[polygon[j] ]; - typename boost::graph_traits::face_descriptor fd = - CGAL::Euler::add_face(vr, pmesh); - CGAL_assertion(fd != boost::graph_traits::null_face()); + typename boost::graph_traits::face_descriptor fd = CGAL::Euler::add_face(vr, pmesh); + CGAL_postcondition(is_valid_face_descriptor(fd, pmesh)); *i2f++ = std::make_pair(i, fd); } } @@ -154,7 +153,7 @@ private: } // namespace internal /** -* \ingroup PMP_repairing_grp +* \ingroup PMP_combinatorial_repair_grp * * \brief returns `true` if the soup of polygons defines a valid polygon * mesh that can be handled by @@ -232,7 +231,7 @@ bool is_polygon_soup_a_polygon_mesh(const PolygonRange& polygons) } /** -* \ingroup PMP_repairing_grp +* \ingroup PMP_combinatorial_repair_grp * * builds a polygon mesh from a soup of polygons. * diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h index ffde3e90d83..08875a0b9e8 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/random_perturbation.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h index 99dfd990136..38fe4ff0608 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/refine.h @@ -17,7 +17,7 @@ #include -#include +#include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h index 9b6b8c173c9..6b37ec946ea 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/remesh.h @@ -20,7 +20,7 @@ #include #include -#include +#include #ifdef CGAL_PMP_REMESHING_VERBOSE #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h index 68a3010f215..73828b33115 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h @@ -14,7 +14,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_REPAIR_H #define CGAL_POLYGON_MESH_PROCESSING_REPAIR_H -#include +#include #include #include @@ -29,7 +29,7 @@ namespace CGAL { namespace Polygon_mesh_processing { -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_geometric_repair_grp /// /// \brief removes the isolated vertices from any polygon mesh. /// @@ -60,7 +60,7 @@ std::size_t remove_isolated_vertices(PolygonMesh& pmesh) return nb_removed; } -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_geometric_repair_grp /// /// \brief removes connected components whose area or volume is under a certain threshold value. /// @@ -218,7 +218,7 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh, area_threshold = CGAL::square(threshold_value); if(is_default_volume_threshold) - volume_threshold = CGAL::square(threshold_value); + volume_threshold = CGAL::square(threshold_value) * threshold_value; const bool use_areas = (is_default_area_threshold || area_threshold > 0); const bool use_volumes = (is_default_volume_threshold || volume_threshold > 0); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index a553a07dcb1..22be1f47e8e 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -13,7 +13,7 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_REPAIR_DEGENERACIES_H #define CGAL_POLYGON_MESH_PROCESSING_REPAIR_DEGENERACIES_H -#include +#include #include #include @@ -535,7 +535,7 @@ struct Filter_wrapper_for_cap_needle_removalneedle
    @@ -809,9 +809,11 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, edges_to_collapse.erase(h); next_edges_to_collapse.erase(h); - halfedge_descriptor rm_h = prev(h, tmesh); + // By default, prev(h) is removed. If prev(h) is constrained, then next(h) is removed. + // Both cannot be constrained, otherwise we would not be collapsing `h`. + halfedge_descriptor rm_h = prev(h, tmesh), ot_h = next(h, tmesh); if(get(ecm, edge(rm_h, tmesh))) - rm_h = next(h, tmesh); + std::swap(rm_h, ot_h); edges_to_flip.erase(rm_h); edges_to_collapse.erase(rm_h); @@ -821,6 +823,16 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, edges_to_flip.erase(opp_rm_h); edges_to_collapse.erase(opp_rm_h); next_edges_to_collapse.erase(opp_rm_h); + + // If the third (i.e., non-removed) halfedge of the face becomes a border halfedge + // with the collapse, then it also needs to be removed. + // Pre-collapse, the corresponding halfedge is `opp_rm_h`. + if(is_border(opp_rm_h, tmesh)) + { + edges_to_flip.erase(ot_h); + edges_to_collapse.erase(ot_h); + next_edges_to_collapse.erase(ot_h); + } } h = opposite(h, tmesh); @@ -1022,7 +1034,7 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, return false; } -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_geometric_repair_grp /// removes all almost degenerate faces from a triangulated surface mesh. /// Equivalent to `remove_almost_degenerate_faces(faces(tmesh), tmesh, np)` template @@ -1314,7 +1326,7 @@ remove_a_border_edge(typename boost::graph_traits::edge_descriptor return remove_a_border_edge(ed, tm, input_range, edge_set, face_set); } -// \ingroup PMP_repairing_grp +// \ingroup PMP_geometric_repair_grp // // removes the degenerate edges from a triangulated surface mesh. // An edge is considered degenerate if its two extremities share the same location. @@ -1378,7 +1390,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, typedef typename GetGeomTraits::type Traits; - std::size_t nb_deg_faces = 0; bool all_removed = false; bool some_removed = true; bool preserve_genus = choose_parameter(get_parameter(np, internal_np::preserve_genus), true); @@ -1413,7 +1424,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, // remove edges that could also be set for removal if(face(h, tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_e = edge(prev(h, tmesh), tmesh); degenerate_edges_to_remove.erase(prev_e); local_edge_range.erase(prev_e); @@ -1422,7 +1432,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, if(face(opposite(h, tmesh), tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_opp_e = edge(prev(opposite(h, tmesh), tmesh), tmesh); degenerate_edges_to_remove.erase(prev_opp_e); local_edge_range.erase(prev_opp_e); @@ -1461,7 +1470,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, // remove edges that could also be set for removal if(face(h, tmesh) != GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_e = edge(prev(h, tmesh), tmesh); degenerate_edges_to_remove.erase(prev_e); local_edge_range.erase(prev_e); @@ -1470,7 +1478,6 @@ bool remove_degenerate_edges(const EdgeRange& edge_range, if(face(opposite(h, tmesh), tmesh)!=GT::null_face()) { - ++nb_deg_faces; const edge_descriptor prev_opp_e = edge(prev(opposite(h, tmesh), tmesh), tmesh); degenerate_edges_to_remove.erase(prev_opp_e); local_edge_range.erase(prev_opp_e); @@ -1873,7 +1880,7 @@ bool remove_degenerate_edges(TriangleMesh& tmesh, return remove_degenerate_edges(edges(tmesh), tmesh, face_set, np); } -// \ingroup PMP_repairing_grp +// \ingroup PMP_geometric_repair_grp // // removes the degenerate faces from a triangulated surface mesh. // A face is considered degenerate if two of its vertices share the same location, diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h index 219a4925c24..cb24ce8ae7c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h @@ -12,10 +12,10 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_REPAIR_POLYGON_SOUP #define CGAL_POLYGON_MESH_PROCESSING_REPAIR_POLYGON_SOUP -#include +#include #include -#include +#include #include #include @@ -140,7 +140,7 @@ bool simplify_polygon(PointRange& points, return (removed_points_n != 0); } -// \ingroup PMP_repairing_grp +// \ingroup PMP_combinatorial_repair_grp // // For each polygon of the soup, removes consecutive identical (in a geometric sense) points. // @@ -194,7 +194,7 @@ std::size_t simplify_polygons_in_polygon_soup(PointRange& points, return simplified_polygons_n; } -// \ingroup PMP_repairing_grp +// \ingroup PMP_combinatorial_repair_grp // // splits "pinched" polygons, that is polygons for which a point appears more than once, // into multiple non-pinched polygons. @@ -203,22 +203,12 @@ std::size_t simplify_polygons_in_polygon_soup(PointRange& points, // \tparam PolygonRange a model of the concept `SequenceContainer` // whose `value_type` is itself a model of the concepts `SequenceContainer` // and `Swappable` whose `value_type` is `std::size_t`. -// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" +// \tparam Traits a traits class providing `Equal_3` and `Less_xyz_3` for two 3D points // // \param points points of the soup of polygons // \param polygons a vector of polygons. Each element in the vector describes a polygon -// using the indices of the points in `points`. -// \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below -// -// \cgalNamedParamsBegin -// \cgalParamNBegin{geom_traits} -// \cgalParamDescription{an instance of a geometric traits class} -// \cgalParamType{The traits class must provide the nested functor `Less_xyz_3` -// to compare lexicographically two points a function `Less_xyz_3 less_xyz_3_object()`.} -// \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} -// \cgalParamExtra{The geometric traits class must be compatible with the vertex point type.} -// \cgalParamNEnd -// \cgalNamedParamsEnd +// using the indices of the points in `points`. +// \param traits an instance of traits // // \sa `repair_polygon_soup()` template @@ -301,7 +291,7 @@ std::size_t split_pinched_polygons_in_polygon_soup(PointRange& points, return new_polygons_n; } -// \ingroup PMP_repairing_grp +// \ingroup PMP_combinatorial_repair_grp // // removes polygons with fewer than 2 points from the soup. // @@ -309,11 +299,10 @@ std::size_t split_pinched_polygons_in_polygon_soup(PointRange& points, // \tparam PolygonRange a model of the concept `SequenceContainer` // whose `value_type` is itself a model of the concept `Container` // whose `value_type` is `std::size_t`. -// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" // // \param points points of the soup of polygons // \param polygons a vector of polygons. Each element in the vector describes a polygon -// using the indices of the points in `points`. +// using the indices of the points in `points`. // // \sa `repair_polygon_soup()` template @@ -345,9 +334,70 @@ std::size_t remove_invalid_polygons_in_polygon_soup(PointRange& /*points*/, return removed_polygons_n; } +// \ingroup PMP_combinatorial_repair_grp +// +// Removes invalid array-based polygons, i.e. polygons which have two equal consecutive points. +// +// \tparam PointRange a model of the concept `Container` whose value type is the point type. +// \tparam PolygonRange a model of the concept `SequenceContainer` +// whose value_type is `std::array` with `N`. +// \tparam Traits Traits class providing `Equal_3` for two points. +// +// \param points points of the soup of polygons. +// \param polygons a vector of polygons. Each element in the vector describes a polygon +// using the indices of the points in `points`. +// \param traits an instance of the traits clas +// +template +std::size_t remove_invalid_polygons_in_array_polygon_soup(PointRange& points, + PolygonRange& polygons, + const Traits& traits = Traits()) +{ + typedef typename internal::Polygon_types::Polygon_3 Polygon_3; + + std::vector to_remove; + const std::size_t ini_polygons_size = polygons.size(); + for(std::size_t polygon_index=0; polygon_index!=ini_polygons_size; ++polygon_index) + { + const Polygon_3& polygon = polygons[polygon_index]; + const std::size_t N = polygon.size(), last = N-1; + CGAL_assertion(N > 2); + + for(std::size_t i=0; i 0) + std::cout << "Removed " << removed_polygons_n << " invalid polygon(s)" << std::endl; +#endif + + return removed_polygons_n; +} + } // end namespace internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// removes the isolated points from a polygon soup. /// A point is considered isolated if it does not appear in any polygon of the soup. @@ -450,7 +500,7 @@ std::size_t remove_isolated_points_in_polygon_soup(PointRange& points, return removed_points_n; } -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// \brief merges the duplicate points in a polygon soup. /// @@ -673,14 +723,14 @@ Polygon construct_canonical_polygon(const PointRange& points, return construct_canonical_polygon(points, polygon, useless, traits); } -template +template struct Polygon_hash { typedef std::size_t result_type; typedef typename internal::Polygon_types::Polygon_3 Polygon_3; - Polygon_hash(const PointRange& points, const PolygonRange& canonical_polygons, const Traits& traits) - : points(points), canonical_polygons(canonical_polygons), traits(traits) + Polygon_hash(const PointRange& points, const PolygonRange& canonical_polygons) + : points(points), canonical_polygons(canonical_polygons) { } template @@ -698,7 +748,6 @@ struct Polygon_hash private: const PointRange& points; const PolygonRange& canonical_polygons; - const Traits& traits; }; template @@ -768,7 +817,7 @@ struct Duplicate_collector void dump(CGAL::Emptyset_iterator) { } }; -// \ingroup PMP_repairing_grp +// \ingroup PMP_combinatorial_repair_grp // // collects duplicate polygons in a polygon soup, that is polygons that share the same vertices in the same // order. @@ -779,12 +828,14 @@ struct Duplicate_collector // and `ReversibleContainer` whose `value_type` is `std::size_t`. // \tparam DuplicateOutputIterator a model of `OutputIterator` with value type // `std::vector >`. +// \tparam Traits a traits class providing `Less_xyz_3` for two 3D points // // \param points points of the soup of polygons // \param polygons a vector of polygons. Each element in the vector describes a polygon // using the indices of the points in `points`. // \param out the output iterator in which duplicate polygons are put. Each entry is a vector of // polygon ids `i0`, `i1`, etc. such that `polygons[i0] = polygons[i1] = ...` +// \param traits an instance of traits // \param same_orientation whether two polygons should have the same orientation to be duplicates. // // \sa `repair_polygon_soup()` @@ -797,11 +848,11 @@ DuplicateOutputIterator collect_duplicate_polygons(const PointRange& points, { typedef typename internal::Polygon_types::P_ID P_ID; - typedef internal::Polygon_hash Hasher; + typedef internal::Polygon_hash Hasher; typedef boost::dynamic_bitset<> Reversed_markers; typedef internal::Polygon_equality_tester Equality; - typedef std::unordered_set Unique_polygons; + typedef std::unordered_set Unique_polygons; const std::size_t polygons_n = polygons.size(); @@ -819,7 +870,7 @@ DuplicateOutputIterator collect_duplicate_polygons(const PointRange& points, is_reversed.set(polygon_index); } - Hasher hash(points, canonical_polygons, traits); + Hasher hash(points, canonical_polygons); Equality equal(points, canonical_polygons, is_reversed, traits, same_orientation); Unique_polygons unique_polygons(polygons_n /*bucket size*/, hash, equal); @@ -846,7 +897,7 @@ DuplicateOutputIterator collect_duplicate_polygons(const PointRange& points, } // end namespace internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// merges the duplicate polygons in a polygon soup. Two polygons are duplicate if they share the same /// vertices in the same order. Note that the first vertex of the polygon does not matter, that is @@ -1031,15 +1082,21 @@ struct Polygon_soup_fixer > PolygonRange& polygons, const NamedParameters& np) const { - #ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE + using parameters::get_parameter; + using parameters::choose_parameter; + + typedef typename GetPolygonGeomTraits::type Traits; + Traits traits = choose_parameter(get_parameter(np, internal_np::geom_traits), Traits()); + +#ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE std::cout << "Repairing soup with " << points.size() << " points and " << polygons.size() << " arrays" << std::endl; - #endif +#endif merge_duplicate_points_in_polygon_soup(points, polygons, np); // skipped steps: // simplify_polygons_in_polygon_soup(points, polygons, traits); // split_pinched_polygons_in_polygon_soup(points, polygons, traits); - remove_invalid_polygons_in_polygon_soup(points, polygons); + remove_invalid_polygons_in_array_polygon_soup(points, polygons, traits); merge_duplicate_polygons_in_polygon_soup(points, polygons, np); remove_isolated_points_in_polygon_soup(points, polygons); } @@ -1047,7 +1104,7 @@ struct Polygon_soup_fixer > } // namespace internal -/// \ingroup PMP_repairing_grp +/// \ingroup PMP_combinatorial_repair_grp /// /// \brief cleans a given polygon soup through various repairing operations. /// diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index bee807468a2..0406329d233 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -13,17 +13,17 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_REPAIR_SELF_INTERSECTIONS_H #define CGAL_POLYGON_MESH_PROCESSING_REPAIR_SELF_INTERSECTIONS_H -#include +#include #include #include #include #include #include -#include #include #include #include +#include #ifndef CGAL_PMP_REMOVE_SELF_INTERSECTION_NO_POLYHEDRAL_ENVELOPE_CHECK #include #endif @@ -251,7 +251,6 @@ FaceOutputIterator replace_faces_with_patch(const std::vector::null_face(); @@ -1581,7 +1579,6 @@ bool fill_hole_with_constraints(std::vector visited_faces; std::vector > patch; - int cc_counter = 0; for(face_descriptor f : cc_faces) { if(!visited_faces.insert(f).second) // already visited that face @@ -1593,7 +1590,6 @@ bool fill_hole_with_constraints(std::vector #include -#include +#include #include #include diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h index 63813d2186a..7f223ba578f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/shape_predicates.h @@ -14,10 +14,10 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H #define CGAL_POLYGON_MESH_PROCESSING_SHAPE_PREDICATES_H -#include +#include #include -#include +#include #include #include @@ -80,6 +80,8 @@ bool is_degenerate_edge(typename boost::graph_traits::edge_descript using parameters::get_parameter; using parameters::choose_parameter; + CGAL_precondition(is_valid_edge_descriptor(e, pm)); + typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, pm)); @@ -190,11 +192,12 @@ bool is_degenerate_triangle_face(typename boost::graph_traits::fac const TriangleMesh& tm, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); - using parameters::get_parameter; using parameters::choose_parameter; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(vertex_point, tm)); @@ -396,14 +399,14 @@ is_needle_triangle_face(typename boost::graph_traits::face_descrip const double threshold, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(threshold >= 1.); - CGAL_precondition(f != boost::graph_traits::null_face()); - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; using parameters::get_parameter; using parameters::choose_parameter; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + CGAL_precondition(threshold >= 1.); typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -545,15 +548,15 @@ is_cap_triangle_face(typename boost::graph_traits::face_descriptor const double threshold, const NamedParameters& np = parameters::default_values()) { - CGAL_precondition(f != boost::graph_traits::null_face()); - CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); - CGAL_precondition(threshold >= -1.); - CGAL_precondition(threshold <= 0.); + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; using parameters::get_parameter; using parameters::choose_parameter; - typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + CGAL_precondition(is_valid_face_descriptor(f, tm)); + CGAL_precondition(CGAL::is_triangle(halfedge(f, tm), tm)); + CGAL_precondition(threshold >= -1.); + CGAL_precondition(threshold <= 0.); typedef typename GetVertexPointMap::const_type VertexPointMap; VertexPointMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h index abe9160944c..e30f95fd289 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/stitch_borders.h @@ -14,13 +14,13 @@ #ifndef CGAL_POLYGON_MESH_PROCESSING_STITCH_BORDERS_H #define CGAL_POLYGON_MESH_PROCESSING_STITCH_BORDERS_H -#include +#include #include #include #include -#include +#include #include #include #include @@ -1063,7 +1063,7 @@ std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename std::pair halfedges_pair; - CGAL_precondition(h != boost::graph_traits::null_halfedge()); + CGAL_precondition(is_valid_halfedge_descriptor(h, pmesh)); CGAL_precondition(is_border(h, pmesh)); CGAL_precondition(is_valid(pmesh)); @@ -1119,7 +1119,7 @@ std::size_t stitch_boundary_cycle(const typename boost::graph_traits #include -#include +#include namespace CGAL{ namespace Polygon_mesh_processing{ diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h index 7a131523f37..2a99d78fe00 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangle.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -66,6 +66,8 @@ triangle(typename boost::graph_traits::face_descriptor fd, using CGAL::parameters::choose_parameter; using CGAL::parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(fd, tmesh)); + typename GetVertexPointMap::const_type vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, tmesh)); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h index 0b48967f273..2a268e7844c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_faces.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include @@ -474,6 +474,8 @@ bool triangulate_face(typename boost::graph_traits::face_descriptor using parameters::choose_parameter; using parameters::get_parameter; + CGAL_precondition(is_valid_face_descriptor(f, pmesh)); + //VertexPointMap typedef typename GetVertexPointMap::type VPMap; VPMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point), diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index 71351e37125..f246500b49a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -468,6 +468,8 @@ namespace Polygon_mesh_processing { using parameters::choose_parameter; using parameters::get_parameter_reference; + CGAL_precondition(is_valid_halfedge_descriptor(border_halfedge, pmesh)); + std::vector::vertex_descriptor> patch; face_out = triangulate_and_refine_hole (pmesh, border_halfedge, face_out, std::back_inserter(patch), np).first; diff --git a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h index d990d32b7a2..d2e95b0a795 100644 --- a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h +++ b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h @@ -176,6 +176,8 @@ public: : m_free_id(0) {} + Rigid_triangle_mesh_collision_detection(const Rigid_triangle_mesh_collision_detection&) = default; + //! move constructor Rigid_triangle_mesh_collision_detection(Rigid_triangle_mesh_collision_detection&& other) { @@ -191,6 +193,8 @@ public: } } + Rigid_triangle_mesh_collision_detection& operator=(Rigid_triangle_mesh_collision_detection& other) = default; + //! move assignment operator Rigid_triangle_mesh_collision_detection& operator=(Rigid_triangle_mesh_collision_detection&& other) { diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp index e0290c027be..ac1950acddf 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_polyhedron.cpp @@ -40,28 +40,53 @@ void mesh_with_id(const std::string argv1, const bool save_output) boost::property_map::type> fccmap(static_cast(num_faces(sm)), get(CGAL::face_index,sm)); - std::size_t num = PMP::connected_components(sm, fccmap); - if (argv1 == CGAL::data_file_path("meshes/blobby_3cc.off")) + const std::size_t num = PMP::connected_components(sm, fccmap); + + if(argv1 == CGAL::data_file_path("meshes/blobby_3cc.off")) + { assert(num == 3); + } std::cerr << "The graph has " << num << " connected components (face connectivity)" << std::endl; - std::size_t nb_faces = num_faces(sm); - std::vector faces_to_remove; // faces that would be removed but are not because we're doing a dry run - std::size_t nb_to_remove = PMP::keep_large_connected_components(sm, 1000, - CGAL::parameters::face_size_map( - CGAL::Constant_property_map(1)) - .dry_run(true) - .output_iterator(std::back_inserter(faces_to_remove))); - assert(!faces_to_remove.empty()); + const std::size_t nb_faces = num_faces(sm); + + std::vector faces_to_remove; + std::size_t nb_to_remove = PMP::keep_large_connected_components( + sm, 1000, + CGAL::parameters::face_size_map(CGAL::Constant_property_map(1)) + .dry_run(true) + .output_iterator(std::back_inserter(faces_to_remove))); + if (argv1 == CGAL::data_file_path("meshes/blobby_3cc.off")) { assert(nb_to_remove == 1); + assert(faces_to_remove.size() == 680); assert(num_faces(sm) == nb_faces); } - PMP::keep_largest_connected_components(sm, 2, - CGAL::parameters::face_size_map( - CGAL::Constant_property_map(1))); + faces_to_remove.clear(); + nb_to_remove = PMP::keep_largest_connected_components( + sm, 2, + CGAL::parameters::face_size_map(CGAL::Constant_property_map(1)) + .dry_run(true) + .output_iterator(std::back_inserter(faces_to_remove))); + + if (argv1 == CGAL::data_file_path("meshes/blobby_3cc.off")) + { + assert(nb_to_remove == 1); + assert(faces_to_remove.size() == 680); + assert(num_faces(sm) == nb_faces); + } + + nb_to_remove = PMP::keep_largest_connected_components( + sm, 2, + CGAL::parameters::face_size_map(CGAL::Constant_property_map(1))); + + if (argv1 == CGAL::data_file_path("meshes/blobby_3cc.off")) + { + assert(nb_to_remove == 1); + assert(faces(sm).size() == 2737); + } if (!save_output) return; @@ -188,7 +213,7 @@ void keep_nothing(const std::string argv1) int main(int argc, char* argv[]) { const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/blobby_3cc.off"); - const bool save_output = (argc > 2) ? true : false; + const bool save_output = (argc > 2); mesh_with_id(filename, save_output); mesh_no_id(filename, save_output); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp index ec64f753d63..f521e933e3d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/connected_component_surface_mesh.cpp @@ -180,6 +180,7 @@ void test_CC_with_area_size_map(Mesh sm, // didn't actually remove anything assert(PMP::internal::number_of_connected_components(sm) == num); assert(num_vertices(sm) == nv); + assert(faces_to_remove.size() == 680); if(num > 2) { diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off new file mode 100644 index 00000000000..86709d5e8ac --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/floating_squares.off @@ -0,0 +1,16 @@ +OFF +8 4 0 + +0 0 1 +1 0 1 +1 1 1 +0 1 1 +0 0 0 +1 0 0 +1 1 0 +0 1 0 +3 0 1 2 +3 2 3 0 +3 6 5 4 +3 4 7 6 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off new file mode 100644 index 00000000000..4bbb30354ec --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/hexa.off @@ -0,0 +1,24 @@ +OFF +8 12 0 + +0.75 0.75 -1 +0.25 0.75 -1 +0.25 0.25 -1 +0.75 0.25 -1 +0.75 0.25 1 +0.75 0.75 1 +0.25 0.75 1 +0.25 0.25 1 +3 4 5 6 +3 0 3 2 +3 1 2 7 +3 0 1 6 +3 3 0 5 +3 2 3 4 +3 6 7 4 +3 2 1 0 +3 7 6 1 +3 6 5 0 +3 5 4 3 +3 4 7 2 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/incompatible_with_open_cube.off b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/incompatible_with_open_cube.off new file mode 100644 index 00000000000..87267990f22 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/data-coref/incompatible_with_open_cube.off @@ -0,0 +1,96 @@ +OFF +32 60 0 + +30 120 60 +30 120 30 +70 60 30 +60 120 60 +70 60 60 +60 120 30 +70 40 30 +130 60 30 +70 40 60 +30 -20 60 +60 -20 60 +30 -40 60 +30 -40 30 +130 60 60 +60 -20 30 +30 -20 30 +160 60 60 +160 -20 60 +60 -40 60 +60 -40 30 +130 -20 60 +130 -20 30 +160 -20 30 +130 40 60 +130 40 30 +160 -40 30 +160 40 30 +130 -40 30 +160 40 60 +130 -40 60 +160 -40 60 +160 60 30 +3 1 0 5 +3 0 9 3 +3 10 14 3 +3 5 0 3 +3 0 15 9 +3 3 14 5 +3 5 15 1 +3 14 15 5 +3 1 15 0 +3 3 9 10 +3 19 18 11 +3 9 18 10 +3 12 11 15 +3 12 19 11 +3 14 19 15 +3 19 12 15 +3 15 11 9 +3 11 18 9 +3 10 21 14 +3 19 29 18 +3 23 8 24 +3 19 27 29 +3 6 24 8 +3 18 29 10 +3 2 4 13 +3 29 20 10 +3 27 19 21 +3 14 21 19 +3 29 30 17 +3 22 25 21 +3 25 22 17 +3 21 25 27 +3 29 17 20 +3 30 25 17 +3 25 30 29 +3 27 25 29 +3 22 28 17 +3 4 2 8 +3 17 28 20 +3 20 23 24 +3 26 28 22 +3 21 24 22 +3 23 20 28 +3 24 26 22 +3 28 16 23 +3 31 26 7 +3 26 31 16 +3 24 7 26 +3 13 23 16 +3 31 7 16 +3 26 16 28 +3 7 13 16 +3 13 8 23 +3 24 2 7 +3 2 6 8 +3 24 6 2 +3 4 8 13 +3 7 2 13 +3 20 24 21 +3 21 10 20 + diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp index 93bdd0fbd01..e0696004418 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_do_intersect_test.cpp @@ -39,10 +39,8 @@ template int load_polylines(std::ifstream& input, std::vector >& points) { - int counter = 0; std::size_t n; while(input >> n) { - ++counter; std::vector new_polyline; points.push_back(new_polyline); std::vector&polyline = points.back(); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp index 889a92636bf..1eec758737e 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp @@ -176,8 +176,8 @@ void test_bool_op_no_copy( params::edge_is_constrained_map(ecm2), std::make_tuple(params::edge_is_constrained_map(ecm_out_union), params::edge_is_constrained_map(ecm_out_inter), - params::no_parameters(params::edge_is_constrained_map(ecm_out_union)), - params::no_parameters(params::edge_is_constrained_map(ecm_out_union)))); + params::default_values(), + params::default_values())); // dump_constrained_edges(*(*output[0]), ecm_out_union, "out_cst_union.cgal"); // dump_constrained_edges(*(*output[1]), ecm_out_inter, "out_cst_inter.cgal"); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd index d154ad0157d..c11009e6559 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cmd @@ -1 +1,3 @@ ${CGAL_DATA_DIR}/meshes/elephant.off ${CGAL_DATA_DIR}/meshes/sphere.off ALL 1 1 1 1 +${CGAL_DATA_DIR}/meshes/open_cube.off data-coref/incompatible_with_open_cube.off ALL 0 0 0 0 +data-coref/floating_squares.off data-coref/hexa.off ALL 1 1 1 1 diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp index 4822f03a76a..cc012385996 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp @@ -272,22 +272,43 @@ int main(int argc,char** argv) return 1; } - Result_checking rc; - - if (argc==8) + if (argc>8 && (argc-1)%7==0) { - rc.check=true; - rc.union_res = atoi(argv[4])!=0; - rc.inter_res = atoi(argv[5])!=0; - rc.P_minus_Q_res = atoi(argv[6])!=0; - rc.Q_minus_P_res = atoi(argv[7])!=0; + // cmd mode + for (int i=0;i(argv[i+1], argv[i+2], scenario, rc); + } } + else + { + Result_checking rc; - int scenario = -1; - if (argc>=5 && std::string(argv[3])!=std::string("ALL")) - scenario = atoi(argv[4]); + if (argc==8) + { + rc.check=true; + rc.union_res = atoi(argv[4])!=0; + rc.inter_res = atoi(argv[5])!=0; + rc.P_minus_Q_res = atoi(argv[6])!=0; + rc.Q_minus_P_res = atoi(argv[7])!=0; + } - run(argv[1], argv[2], scenario, rc); + int scenario = -1; + if (argc>=5 && std::string(argv[3])!=std::string("ALL")) + scenario = atoi(argv[3]); + + run(argv[1], argv[2], scenario, rc); + } return 0; } diff --git a/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/Polygonal_surface_reconstruction.txt b/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/Polygonal_surface_reconstruction.txt index cbaf4f3e5a1..1f6d1200192 100644 --- a/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/Polygonal_surface_reconstruction.txt +++ b/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/Polygonal_surface_reconstruction.txt @@ -182,7 +182,7 @@ The following example shows how to control the model complexity by tuning the we \remark This example also shows how to reuse the intermediate results from the candidate generation step. -\cgalExample{Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp} +\cgalExample{Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp} \section secPerformances Performance diff --git a/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/examples.txt b/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/examples.txt index 0b1b37d6a26..24a2ab456cc 100644 --- a/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/examples.txt +++ b/Polygonal_surface_reconstruction/doc/Polygonal_surface_reconstruction/examples.txt @@ -1,6 +1,6 @@ /*! \example Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp \example Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp -\example Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp +\example Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp \example Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp */ diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt index 32d10eb1480..bc49569944f 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -project(Polygonal_surface_reconstruction_Examples) - cmake_minimum_required(VERSION 3.1...3.23) +project(Polygonal_surface_reconstruction_Examples) + # CGAL and its components find_package(CGAL REQUIRED) @@ -28,13 +28,13 @@ endif() create_single_source_cgal_program("polyfit_example_without_input_planes.cpp") create_single_source_cgal_program("polyfit_example_user_provided_planes.cpp") -create_single_source_cgal_program("polyfit_example_model_complexty_control.cpp") +create_single_source_cgal_program("polyfit_example_model_complexity_control.cpp") create_single_source_cgal_program("polyfit_example_with_region_growing.cpp") foreach( target polyfit_example_without_input_planes polyfit_example_user_provided_planes - polyfit_example_model_complexty_control polyfit_example_with_region_growing) + polyfit_example_model_complexity_control polyfit_example_with_region_growing) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) if(TARGET CGAL::SCIP_support) target_link_libraries(${target} PUBLIC CGAL::SCIP_support) diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp similarity index 96% rename from Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp rename to Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp index 64fd9a9784a..e132d62975d 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexity_control.cpp @@ -90,7 +90,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.05.off"; + const std::string& output_file = "building_result-0.05.off"; if (CGAL::IO::write_OFF(output_file, model)) { std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } @@ -108,7 +108,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.5.off"; + const std::string& output_file = "building_result-0.5.off"; if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { @@ -125,7 +125,7 @@ int main() return EXIT_FAILURE; } else { - const std::string& output_file = "data/building_result-0.7.off"; + const std::string& output_file = "building_result-0.7.off"; if (CGAL::IO::write_OFF(output_file, model)){ std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp index 733f0113749..2f2ed2df2c9 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp @@ -89,7 +89,7 @@ int main() } // Saves the mesh model - const std::string& output_file("data/ball_result.off"); + const std::string& output_file("user_provided_planes_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index 8dc81bd3c1e..493c8c138aa 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -172,7 +172,7 @@ int main() std::cout << "Saving..."; t.reset(); - const std::string& output_file("data/cube_result.off"); + const std::string& output_file("with_region_growing_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index 85e474d99d7..4b2ed8f91a4 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -125,7 +125,7 @@ int main() return EXIT_FAILURE; } - const std::string& output_file("data/cube_result.off"); + const std::string& output_file("without_input_planes_result.off"); if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { @@ -138,7 +138,7 @@ int main() // Also stores the candidate faces as a surface mesh to a file Surface_mesh candidate_faces; algo.output_candidate_faces(candidate_faces); - const std::string& candidate_faces_file("data/cube_candidate_faces.off"); + const std::string& candidate_faces_file("without_input_planes_cube_candidate_faces.off"); std::ofstream candidate_stream(candidate_faces_file.c_str()); if (CGAL::IO::write_OFF(candidate_stream, candidate_faces)) std::cout << "Candidate faces saved to " << candidate_faces_file << "." << std::endl; diff --git a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt index 790da0f2757..91848e4bdcd 100644 --- a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -project(Polygonal_surface_reconstruction_Tests) - cmake_minimum_required(VERSION 3.1...3.23) +project(Polygonal_surface_reconstruction_Tests) + # CGAL and its components find_package(CGAL REQUIRED) diff --git a/Polyhedron/demo/Polyhedron/C3t3_type.h b/Polyhedron/demo/Polyhedron/C3t3_type.h index d666f6546b5..fe815264335 100644 --- a/Polyhedron/demo/Polyhedron/C3t3_type.h +++ b/Polyhedron/demo/Polyhedron/C3t3_type.h @@ -3,10 +3,7 @@ #include "config.h" #include "Plugins/Mesh_3/config_mesh_3.h" - -// include this to get #define BOOST_PARAMETER_MAX_ARITY 12 // as otherwise it gets set via inclusion of Polyhedron_3.h -#include #include #include "SMesh_type.h" diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index e1520ae5590..6457e785e94 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1806,7 +1806,7 @@ void MainWindow::updateInfo() { QString item_filename = item->property("source filename").toString(); CGAL::Bbox_3 bbox = item->bbox(); if(bbox !=CGAL::Bbox_3()) - item_text += QString("
    Bounding box: min (%1,%2,%3), max (%4,%5,%6), dimensions (%7, %8, %9)
    ") + item_text += QString("
    Bounding box:
     min (%1, %2, %3),
     max (%4, %5, %6),
     dimensions (%7, %8, %9)
    ") .arg(bbox.xmin(),0, 'g', 17) .arg(bbox.ymin(),0, 'g', 17) .arg(bbox.zmin(),0, 'g', 17) diff --git a/Polyhedron/demo/Polyhedron/Mainpage.md b/Polyhedron/demo/Polyhedron/Mainpage.md index 0e8322a8f70..444a5ee8b98 100644 --- a/Polyhedron/demo/Polyhedron/Mainpage.md +++ b/Polyhedron/demo/Polyhedron/Mainpage.md @@ -197,7 +197,7 @@ class Polyhedron_demo_example_plugin : public : // To silent a warning -Woverloaded-virtual - // See http://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings + // See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings using Polyhedron_demo_plugin_helper::init; void init(QMainWindow* mainWindow, diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp index 4fd2bad9af2..96051a607c4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Scene_movable_sm_item.cpp @@ -203,7 +203,7 @@ void Scene_movable_sm_item::invalidateOpenGLBuffers() CGAL::Three::Scene_item::ManipulatedFrame* Scene_movable_sm_item::manipulatedFrame() { return d->frame; } const CGAL::qglviewer::Vec& Scene_movable_sm_item::center() const { return d->center_; } Scene_movable_sm_item::~Scene_movable_sm_item() { delete d; Q_EMIT killed(); } -void Scene_movable_sm_item::setFMatrix(const GLdouble matrix[]) +void Scene_movable_sm_item::setFMatrix(const GLdouble matrix[16]) { for (int i=0; i<16; ++i) d->f_matrix.data()[i] = (float)matrix[i]; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/Alpha_wrap_3_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/Alpha_wrap_3_plugin.cpp index 8a190360c42..bb686a60f98 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/Alpha_wrap_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/Alpha_wrap_3_plugin.cpp @@ -216,7 +216,19 @@ class Polyhedron_demo_alpha_wrap_3_plugin Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface) Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") + using Triangles = std::vector; + using Segments = std::vector; + using Points = std::vector; + + using TS_Oracle = CGAL::Alpha_wraps_3::internal::Triangle_soup_oracle; + using SS_Oracle = CGAL::Alpha_wraps_3::internal::Segment_soup_oracle; + using Oracle = CGAL::Alpha_wraps_3::internal::Point_set_oracle; + private: + CGAL::Bbox_3 wrap_bbox; + double wrap_bbox_diag_length; + + QAction* actionAlpha_wrap_3_; Ui::alpha_wrap_3_dialog ui; public: @@ -262,33 +274,29 @@ private: CGAL::Three::Three::information(message); } - Ui::alpha_wrap_3_dialog create_dialog(QDialog* dialog) - { - ui.setupUi(dialog); - - connect(ui.wrapEdges, SIGNAL(clicked(bool)), this, SLOT(toggle_wrap_faces())); - connect(ui.wrapFaces, SIGNAL(clicked(bool)), this, SLOT(toggle_wrap_edges())); - - connect(ui.visualizeIterations, SIGNAL(clicked(bool)), - this, SLOT(update_iteration_snapshot_checkbox())); - - connect(ui.buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); - connect(ui.buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); - - return ui; - } - public Q_SLOTS: - void toggle_wrap_faces() + void on_alphaValue_changed(double) { - if(!ui.wrapEdges->isChecked()) // if edges are disabled, so are faces - ui.wrapFaces->setChecked(false); + QSignalBlocker block(ui.relativeAlphaValue); + ui.relativeAlphaValue->setValue(wrap_bbox_diag_length / ui.alphaValue->value()); } - void toggle_wrap_edges() + void on_relativeAlphaValue_changed(double) { - if(ui.wrapFaces->isChecked()) // if faces are enabled, so are edges - ui.wrapEdges->setChecked(true); + QSignalBlocker block(ui.alphaValue); + ui.alphaValue->setValue(wrap_bbox_diag_length / ui.relativeAlphaValue->value()); + } + + void on_offsetValue_changed(double) + { + QSignalBlocker block(ui.relativeOffsetValue); + ui.relativeOffsetValue->setValue(wrap_bbox_diag_length / ui.offsetValue->value()); + } + + void on_relativeOffsetValue_changed(double) + { + QSignalBlocker block(ui.offsetValue); + ui.offsetValue->setValue(wrap_bbox_diag_length / ui.relativeOffsetValue->value()); } void update_iteration_snapshot_checkbox() @@ -298,47 +306,30 @@ public Q_SLOTS: void on_actionAlpha_wrap_3_triggered() { - using Triangles = std::vector; - using Segments = std::vector; - using Points = std::vector; - - using TS_Oracle = CGAL::Alpha_wraps_3::internal::Triangle_soup_oracle; - using SS_Oracle = CGAL::Alpha_wraps_3::internal::Segment_soup_oracle; - using Oracle = CGAL::Alpha_wraps_3::internal::Point_set_oracle; - QDialog dialog(mw); - ui = create_dialog(&dialog); + + ui.setupUi(&dialog); + + connect(ui.alphaValue, SIGNAL(valueChanged(double)), this, SLOT(on_alphaValue_changed(double))); + connect(ui.relativeAlphaValue, SIGNAL(valueChanged(double)), this, SLOT(on_relativeAlphaValue_changed(double))); + connect(ui.offsetValue, SIGNAL(valueChanged(double)), this, SLOT(on_offsetValue_changed(double))); + connect(ui.relativeOffsetValue, SIGNAL(valueChanged(double)), this, SLOT(on_relativeOffsetValue_changed(double))); + + connect(ui.visualizeIterations, SIGNAL(clicked(bool)), this, SLOT(update_iteration_snapshot_checkbox())); + + connect(ui.buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); + connect(ui.buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); + dialog.setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint|Qt::WindowCloseButtonHint); - int i = dialog.exec(); - if(i == QDialog::Rejected) - return; - - const bool is_relative_alpha = ui.relativeAlpha->isChecked(); - const bool is_relative_offset = ui.relativeOffset->isChecked(); - const bool enforce_manifoldness = ui.runManifoldness->isChecked(); - double alpha = ui.alphaValue->value(); - double offset = ui.offsetValue->value(); - const bool visualize_iterations = ui.visualizeIterations->isChecked(); - const bool do_snapshot_iterations = ui.snapshotIterations->isChecked(); - - if(alpha <= 0. || offset <= 0.) - return; - - QApplication::setOverrideCursor(Qt::WaitCursor); - - TS_Oracle ts_oracle; - SS_Oracle ss_oracle(ts_oracle); - Oracle oracle(ss_oracle); - Triangles triangles; Segments segments; Points points; - Q_FOREACH(int index, scene->selectionIndices()) + Q_FOREACH(int index, this->scene->selectionIndices()) { // --- - Scene_surface_mesh_item* sm_item = qobject_cast(scene->item(index)); + Scene_surface_mesh_item* sm_item = qobject_cast(this->scene->item(index)); if(sm_item != nullptr) { SMesh* pMesh = sm_item->polyhedron(); @@ -357,9 +348,9 @@ public Q_SLOTS: triangles.emplace_back(get(vpm, target(h, *pMesh)), get(vpm, target(next(h, *pMesh), *pMesh)), get(vpm, source(h, *pMesh))); - } - sm_item->setRenderingMode(Flat); + wrap_bbox += triangles.back().bbox(); + } continue; } @@ -381,9 +372,9 @@ public Q_SLOTS: triangles.emplace_back(soup_item->points()[p[0]], soup_item->points()[p[1]], soup_item->points()[p[2]]); - } - soup_item->setRenderingMode(Flat); + wrap_bbox += triangles.back().bbox(); + } continue; } @@ -409,6 +400,8 @@ public Q_SLOTS: triangles.emplace_back(get(vpm, target(h, *pMesh)), get(vpm, target(next(h, *pMesh), *pMesh)), get(vpm, source(h, *pMesh))); + + wrap_bbox += triangles.back().bbox(); } segments.reserve(segments.size() + selection_item->selected_edges.size()); @@ -416,12 +409,16 @@ public Q_SLOTS: { segments.emplace_back(get(vpm, target(halfedge(e, *pMesh), *pMesh)), get(vpm, target(opposite(halfedge(e, *pMesh), *pMesh), *pMesh))); + + wrap_bbox += segments.back().bbox(); } points.reserve(points.size() + selection_item->selected_vertices.size()); for(const auto& v : selection_item->selected_vertices) { points.push_back(get(vpm, v)); + + wrap_bbox += points.back().bbox(); } continue; @@ -456,40 +453,92 @@ public Q_SLOTS: } } - const bool wrap_triangles = ui.wrapFaces->isChecked(); - const bool wrap_segments = ui.wrapEdges->isChecked(); - - if(!wrap_triangles) - { - segments.reserve(segments.size() + 3 * triangles.size()); - for(const auto& tr : triangles) - { - segments.emplace_back(tr[0], tr[1]); - segments.emplace_back(tr[1], tr[2]); - segments.emplace_back(tr[2], tr[0]); - } - } - - if(!wrap_segments) - { - points.reserve(points.size() + 2 * segments.size()); - for(const auto& s : segments) - { - points.push_back(s[0]); - points.push_back(s[1]); - } - } - std::cout << triangles.size() << " triangles" << std::endl; std::cout << segments.size() << " edges" << std::endl; std::cout << points.size() << " points" << std::endl; + + // The relative value uses the bbox of the full scene and not that of selected items to wrap + // This is intentional, both because it's tedious to make it otherwise, and because it seems + // to be simpler to compare between "all wrapped" / "some wrapped" + wrap_bbox_diag_length = std::sqrt(CGAL::square(wrap_bbox.xmax() - wrap_bbox.xmin()) + + CGAL::square(wrap_bbox.ymax() - wrap_bbox.ymin()) + + CGAL::square(wrap_bbox.zmax() - wrap_bbox.zmin())); + + ui.relativeAlphaValue->setValue(20.); + ui.relativeOffsetValue->setValue(600.); + ui.alphaValue->setValue(wrap_bbox_diag_length / ui.relativeAlphaValue->value()); + ui.offsetValue->setValue(wrap_bbox_diag_length / ui.relativeOffsetValue->value()); + + // EXECUTION + int i = dialog.exec(); + if(i == QDialog::Rejected) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + + Q_FOREACH(int index, this->scene->selectionIndices()) + { + Scene_surface_mesh_item* sm_item = qobject_cast(this->scene->item(index)); + if(sm_item != nullptr) + sm_item->setRenderingMode(Flat); + Scene_polygon_soup_item* soup_item = qobject_cast(scene->item(index)); + if(soup_item != nullptr) + soup_item->setRenderingMode(Flat); + } + + const bool wrap_triangles = ui.wrapTriangles->isChecked(); + const bool wrap_segments = ui.wrapSegments->isChecked(); + const bool wrap_points = ui.wrapPoints->isChecked(); + + double alpha = ui.alphaValue->value(); + double offset = ui.offsetValue->value(); + + const bool enforce_manifoldness = ui.runManifoldness->isChecked(); + const bool visualize_iterations = ui.visualizeIterations->isChecked(); + const bool do_snapshot_iterations = ui.snapshotIterations->isChecked(); + std::cout << "do wrap edges/faces: " << wrap_segments << " " << wrap_triangles << std::endl; + if(!wrap_triangles) + { + if(wrap_segments) // add faces' edges + { + segments.reserve(segments.size() + 3 * triangles.size()); + for(const auto& tr : triangles) + { + segments.emplace_back(tr[0], tr[1]); + segments.emplace_back(tr[1], tr[2]); + segments.emplace_back(tr[2], tr[0]); + } + } + else // triangles & segments are not wrapped, but points are -> add faces' vertices + { + points.reserve(points.size() + 2 * segments.size() + 3 * triangles.size()); + for(const auto& s : segments) + { + points.push_back(s[0]); + points.push_back(s[1]); + } + + for(const auto& tr : triangles) + { + points.push_back(tr[0]); + points.push_back(tr[1]); + points.push_back(tr[2]); + } + } + } + + TS_Oracle ts_oracle; + SS_Oracle ss_oracle(ts_oracle); + Oracle oracle(ss_oracle); + if(wrap_triangles) oracle.add_triangle_soup(triangles); if(wrap_segments) oracle.add_segment_soup(segments); - oracle.add_point_set(points); + if(wrap_points) + oracle.add_point_set(points); if(!oracle.do_call()) { @@ -498,18 +547,14 @@ public Q_SLOTS: return; } - // Oracles set up, time to wrap - - CGAL::Bbox_3 bbox = oracle.bbox(); - const double diag_length = std::sqrt(CGAL::square(bbox.xmax() - bbox.xmin()) + - CGAL::square(bbox.ymax() - bbox.ymin()) + - CGAL::square(bbox.zmax() - bbox.zmin())); - - if(is_relative_alpha) - alpha = diag_length / alpha; - if(is_relative_offset) - offset = diag_length / offset; + if(alpha <= 0. || offset <= 0.) + { + print_message("Warning: alpha/offset must be strictly positive - nothing to wrap"); + QApplication::restoreOverrideCursor(); + return; + } + // Oracles are now set up, main function call CGAL::Alpha_wraps_3::internal::Alpha_wrap_3 aw3(oracle); Iterative_AW3_visualization_visitor visitor(scene, @@ -528,9 +573,6 @@ public Q_SLOTS: QApplication::restoreOverrideCursor(); } - -private: - QAction* actionAlpha_wrap_3_; }; #include "Alpha_wrap_3_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/alpha_wrap_3_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/alpha_wrap_3_dialog.ui index bbf25c4b345..cc6cce92722 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/alpha_wrap_3_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Alpha_wrap_3/alpha_wrap_3_dialog.ui @@ -23,20 +23,24 @@ 3D Alpha Wrapping - - + + - + Offset value (absolute): - - true + + + + + + <html><head/><body><p>Offset value (relative):<br/><span style=" font-size:9pt;">As ratio of the length of the bbox's diagonal<br/>(i.e., value </span><span style=" font-size:9pt; font-style:italic;">x </span><span style=" font-size:9pt;">means </span><span style=" font-size:9pt; font-style:italic;">offset := bbox_diag_l / x)</span></p></body></html> - 5 + 10 0.000000000000000 @@ -45,90 +49,14 @@ 100000000.000000000000000 - 0.000001000000000 + 1.000000000000000 - 20.000000000000000 + 0.000000000000000 - - - - true - - - <html><head/><body><p>Enforce 2-manifold output</p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Alpha value: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Visualize iterations - - - - - - - <html><head/><body><p>Use relative-to-bbox offset<br/><span style=" font-size:9pt;">As ratio of the length of the bbox's diagonal<br/>(i.e., value </span><span style=" font-size:9pt; font-style:italic;">x </span><span style=" font-size:9pt;">means </span><span style=" font-size:9pt; font-style:italic;">offset := bbox_diag_l / x)</span></p></body></html> - - - - + Qt::Vertical @@ -141,58 +69,41 @@ - - + + - 5 + 10 0.000000000000000 - 100000000.000000000000000 + 10000000.000000000000000 - 0.000001000000000 + 1.000000000000000 - 600.000000000000000 + 0.000000000000000 - - + + + + <html><head/><body><p>Snapshot iterations<br/><span style=" font-size:9pt;">For each iteration, save a snapshot of the viewer <br/>to a file named </span><span style=" font-size:9pt; font-style:italic;">Wrap-iteration_i.png</span></p></body></html> + + + + + Qt::Horizontal - - - - <html><head/><body><p>Wrap faces<br/><span style=" font-size:9pt;">If deactivated, only edges of the faces are taken into account</span></p></body></html> - - - - - - - <html><head/><body><p>Wrap edges<br/><span style=" font-size:9pt;">If deactivated, only extremities of the edges are taken into account</span></p></body></html> - - - - - - - - - - true - - - - - + + Qt::Vertical @@ -204,29 +115,22 @@ - - + + - <html><head/><body><p>Use relative-to-bbox alpha<br/><span style=" font-size:9pt;">As ratio of the length of the bbox's diagonal<br/>(i.e., value </span><span style=" font-size:9pt; font-style:italic;">x </span><span style=" font-size:9pt;">means alpha</span><span style=" font-size:9pt; font-style:italic;"> := bbox_diag_l / x)</span></p></body></html> + Visualize iterations - - - - Qt::Vertical - - - - - + + - + <html><head/><body><p>Alpha value (absolute):</p></body></html> - - + + @@ -235,7 +139,7 @@ - + Qt::Vertical @@ -248,38 +152,7 @@ - - - - - - - true - - - - - - - Qt::Horizontal - - - - - - - Offset value: - - - - - - - Qt::Horizontal - - - - + @@ -289,7 +162,66 @@ - + + + + Qt::Horizontal + + + + + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 10 + + + 0.000000000000000 + + + 10000000.000000000000000 + + + 1.000000000000000 + + + 0.000000000000000 + + + + + + + + + + false + + + + Qt::Vertical @@ -302,27 +234,123 @@ - - + + - <html><head/><body><p>Snapshot iterations<br/><span style=" font-size:9pt;">For each iteration, save a snapshot of the viewer <br/>to a file named </span><span style=" font-size:9pt; font-style:italic;">Wrap-iteration_i.png</span></p></body></html> + Wrap points / vertices - - + + + + Qt::Horizontal + + + + + + + true + + + <html><head/><body><p>Enforce 2-manifold output</p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + - - false + + + + + + <html><head/><body><p>Wrap faces / triangles</p></body></html> + + + + + + + true + + + + + + + 10 + + + 0.000000000000000 + + + 100000000.000000000000000 + + + 1.000000000000000 + + + 0.000000000000000 + + + + + + + <html><head/><body><p>Alpha value (relative):<br/><span style=" font-size:9pt;">As the ratio of the length of the bbox's diagonal<br/>(i.e., value </span><span style=" font-size:9pt; font-style:italic;">x </span><span style=" font-size:9pt;">means alpha</span><span style=" font-size:9pt; font-style:italic;"> := bbox_diag_l / x)</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + <html><head/><body><p>Wrap edges / segments</p></body></html> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - + Qt::Horizontal @@ -332,10 +360,31 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + - buttonBox + alphaValue + relativeAlphaValue + offsetValue + relativeOffsetValue + wrapTriangles + wrapSegments + runManifoldness + visualizeIterations + snapshotIterations @@ -346,8 +395,8 @@ accept() - 388 - 288 + 394 + 666 157 @@ -362,8 +411,8 @@ reject() - 388 - 288 + 394 + 666 286 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index 0d8687bd635..af1eef9e115 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -1694,7 +1694,7 @@ private: /*========================================================================= Copyright (c) 2006 Sandia Corporation. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + See Copyright.txt or https://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp index 4063d2107ed..db0d99bdb57 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp @@ -27,7 +27,7 @@ class Polyhedron_demo_polylines_io_plugin : public: // To silent a warning -Woverloaded-virtual - // See http://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings + // See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings using Polyhedron_demo_io_plugin_interface::init; //! Configures the widget diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp index e990ee9d6e1..c939b1fb086 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp @@ -79,7 +79,7 @@ CGAL::Three::Scene_item* Surf_io_plugin::actual_load(QFileInfo fileinfo) return item; } std::vector patches; - std::vector material_data; + std::vector material_data; CGAL::Bbox_3 grid_box; std::array grid_size = {{1, 1, 1}}; boost::container::flat_set duplicated_points; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index 28a0be5359e..e35576fc98f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -60,15 +60,13 @@ #include #include #include -#include #include #include #include #include -#include #include -#include +#include typedef Scene_surface_mesh_item Scene_facegraph_item; typedef Scene_facegraph_item::Face_graph FaceGraph; typedef boost::property_traits @@ -326,7 +325,7 @@ private: ltime.restart(); std::cout << " Running lloyd_optimize_mesh_2..." << std::flush; CGAL::lloyd_optimize_mesh_2(cdt, - CGAL::parameters::max_iteration_number = nb_iter); + CGAL::parameters::number_of_iterations(nb_iter)); std::cout << " done (" << ltime.elapsed() << " ms)" << std::endl; } 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 3f2b08782fb..7a889e4da14 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -19,9 +19,11 @@ class Polyhedron_demo_c3t3_binary_io_plugin : public: QString name() const override { return "C3t3_io_plugin"; } - QString nameFilters() const override { return "binary files (*.cgal);;ascii (*.mesh);;maya (*.ma)"; } - QString saveNameFilters() const override { return "binary files (*.cgal);;ascii (*.mesh);;maya (*.ma);;avizo (*.am);;OFF files (*.off)"; } - QString loadNameFilters() const override { return "binary files (*.cgal);;ascii (*.mesh)"; } + QString nameFilters() const override { return "binary files (*.cgal);;ascii (*.mesh);;maya (*.ma);;avizo (*.tetra.am)"; } + QString saveNameFilters() const override{ + return "binary files (*.cgal);;ascii (*.mesh);;maya (*.ma);;avizo (*.tetra.am);;OFF files (*.off)"; } + QString loadNameFilters() const override { + return "binary files (*.cgal);;ascii (*.mesh);;avizo (*.tetra.am)"; } bool canLoad(QFileInfo) const override; QList load(QFileInfo fileinfo, bool& ok, bool add_to_scene=true) override; @@ -36,6 +38,7 @@ public: private: bool try_load_other_binary_format(std::istream& in, C3t3& c3t3); bool try_load_a_cdt_3(std::istream& in, C3t3& c3t3); + void update_c3t3(C3t3& c3t3); }; @@ -49,14 +52,21 @@ bool Polyhedron_demo_c3t3_binary_io_plugin::canLoad(QFileInfo fi) const { << (const char*)fi.filePath().toUtf8() << std::endl; return false; } - std::string line; - std::istringstream iss; - std::getline (in,line); - iss.str(line); - std::string keyword; - if (iss >> keyword) - if (keyword == "binary") - return true; + if (fi.suffix().toLower() == "cgal") + { + std::string line; + std::istringstream iss; + std::getline(in, line); + iss.str(line); + std::string keyword; + if (iss >> keyword) + if (keyword == "binary") + return true; + } + else if (fi.suffix().toLower() == "am") + { + return true; + } return false; } @@ -88,7 +98,6 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( { item->setName(fileinfo.baseName()); - if(item->load_binary(in)) { if(add_to_scene){ item->resetCutPlane(); @@ -125,47 +134,13 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( in.open(fileinfo.filePath().toUtf8(), std::ios_base::in);//not binary CGAL_assertion(!(!in)); - Scene_c3t3_item* item = new Scene_c3t3_item(); item->setName(fileinfo.baseName()); 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)) { - item->c3t3().rescan_after_load_of_triangulation(); //fix counters for facets and cells - for( C3t3::Cell_handle cit : item->c3t3().triangulation().finite_cell_handles()) - { - CGAL_assertion(cit->subdomain_index() >= 0); - if(cit->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index()) - item->c3t3().add_to_complex(cit, cit->subdomain_index()); - for(int i=0; i < 4; ++i) - { - if(cit->surface_patch_index(i)>0) - { - item->c3t3().add_to_complex(cit, i, cit->surface_patch_index(i)); - } - } - } - - //if there is no facet in the complex, we add the border facets. - if(item->c3t3().number_of_facets_in_complex() == 0) - { - for( C3t3::Facet fit : item->c3t3().triangulation().finite_facets()) - { - typedef C3t3::Triangulation::Cell_handle Cell_handle; - - Cell_handle c = fit.first; - Cell_handle nc = c->neighbor(fit.second); - - // By definition, Subdomain_index() is supposed to be the id of the exterior - if(c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() && - nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index()) - { - // Color the border facet with the index of its cell - item->c3t3().add_to_complex(c, fit.second, c->subdomain_index()); - } - } - } + update_c3t3(item->c3t3()); item->resetCutPlane(); item->c3t3_changed(); @@ -181,7 +156,28 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( QMessageBox::Ok); } } + else if (fileinfo.suffix().toLower() == "am") + { + if (CGAL::IO::internal::is_avizo_tetra_format(in, "ascii")) + { + in.close(); + in.open(fileinfo.filePath().toUtf8(), std::ios_base::in);//not binary + CGAL_assertion(!(!in)); + } + item->setName(fileinfo.baseName()); + + if (CGAL::IO::read_AVIZO_TETRA(in, item->c3t3().triangulation())) + { + update_c3t3(item->c3t3()); + + item->resetCutPlane(); + item->c3t3_changed(); + if (add_to_scene) + CGAL::Three::Three::scene()->addItem(item); + return QList() << item; + } + } // if all loading failed... delete item; @@ -341,9 +337,9 @@ struct Fake_CDT_3_cell_base : public Cb int constrained_facet[4]; bool _restoring[6]; int to_edge_index( int li, int lj ) const { - CGAL_triangulation_precondition( li >= 0 && li < 4 ); - CGAL_triangulation_precondition( lj >= 0 && lj < 4 ); - CGAL_triangulation_precondition( li != lj ); + CGAL_precondition( li >= 0 && li < 4 ); + CGAL_precondition( lj >= 0 && lj < 4 ); + CGAL_precondition( li != lj ); return ( li==0 || lj==0 ) ? li+lj-1 : li+lj; } @@ -524,6 +520,47 @@ try_load_a_cdt_3(std::istream& is, C3t3& c3t3) return false; } } + +void +Polyhedron_demo_c3t3_binary_io_plugin:: +update_c3t3(C3t3& c3t3) +{ + using Cell_handle = C3t3::Triangulation::Cell_handle; + + c3t3.rescan_after_load_of_triangulation(); //fix counters for facets and cells + for (Cell_handle cit : c3t3.triangulation().finite_cell_handles()) + { + CGAL_assertion(cit->subdomain_index() >= 0); + if (cit->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index()) + c3t3.add_to_complex(cit, cit->subdomain_index()); + + for (int i = 0; i < 4; ++i) + { + if (cit->surface_patch_index(i) > 0) + c3t3.add_to_complex(cit, i, cit->surface_patch_index(i)); + } + } + + //if there is no facet in the complex, we add the border facets. + if (c3t3.number_of_facets_in_complex() == 0) + { + for (C3t3::Facet fit : c3t3.triangulation().finite_facets()) + { + Cell_handle c = fit.first; + Cell_handle nc = c->neighbor(fit.second); + + // By definition, Subdomain_index() is supposed to be the id of the exterior + if (c->subdomain_index() != C3t3::Triangulation::Cell::Subdomain_index() && + nc->subdomain_index() == C3t3::Triangulation::Cell::Subdomain_index()) + { + // Color the border facet with the index of its cell + c3t3.add_to_complex(c, fit.second, c->subdomain_index()); + } + } + } + +} + //Generates a compilation error. bool Polyhedron_demo_c3t3_binary_io_plugin:: 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 72ef02c7c4c..f74562e6e58 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -65,7 +65,9 @@ #include #include #include +#include #endif + #include // Covariant return types don't work for scalar types and we cannot @@ -978,7 +980,8 @@ private Q_SLOTS: QString Io_image_plugin::nameFilters() const { return QString("Inrimage files (*.inr *.inr.gz) ;; " "Analyze files (*.hdr *.img *img.gz) ;; " - "Stanford Exploration Project files (*.H *.HH)"); + "Stanford Exploration Project files (*.H *.HH) ;; " + "NRRD image files (*.nrrd)"); } @@ -1011,7 +1014,33 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) ok = true; QApplication::restoreOverrideCursor(); Image* image = new Image; - if(fileinfo.suffix() != "H" && fileinfo.suffix() != "HH" && + + //read a nrrd file + if (fileinfo.suffix() == "nrrd") + { +#ifdef CGAL_USE_VTK + vtkNew reader; + reader->SetFileName(fileinfo.filePath().toUtf8()); + reader->Update(); + auto vtk_image = reader->GetOutput(); + vtk_image->Print(std::cerr); + *image = CGAL::IO::read_vtk_image_data(vtk_image); // copy the image data +#else + CGAL::Three::Three::warning("You need VTK to read a NRRD file"); + delete image; + return QList(); +#endif + } + + //read a sep file + else if (fileinfo.suffix() == "H" || fileinfo.suffix() == "HH") + { + CGAL::SEP_to_ImageIO reader(fileinfo.filePath().toUtf8().data()); + *image = *reader.cgal_image(); + is_gray = true; + } + + else if(fileinfo.suffix() != "H" && fileinfo.suffix() != "HH" && !image->read(fileinfo.filePath().toUtf8())) { QMessageBox qmb(QMessageBox::NoIcon, @@ -1100,13 +1129,7 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) return QList(); } } - //read a sep file - else if(fileinfo.suffix() == "H" || fileinfo.suffix() == "HH") - { - CGAL::SEP_to_ImageIO reader(fileinfo.filePath().toUtf8().data()); - *image = *reader.cgal_image(); - is_gray = true; - } + // Get display precision QDialog dialog; ui.setupUi(&dialog); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp index 6aa0571c8b9..e1b3770c225 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin.cpp @@ -374,27 +374,6 @@ boost::optional Mesh_3_plugin::get_items_or_return_error_string() const auto& image_item = image_mesh_items->image_item; item = image_item; features_protection_available = true; - - bool fit_wrdtp = true; - std::size_t img_wdim = image_item->image()->image()->wdim; - WORD_KIND img_wordKind = image_item->image()->image()->wordKind; - // check if the word type fits the hardcoded values in the plugin - if (image_item->isGray()) { - if (img_wordKind != WK_FLOAT) - fit_wrdtp = false; - else if (img_wdim != 4) - fit_wrdtp = false; - } else { - if (img_wordKind != WK_FIXED) - fit_wrdtp = false; - else if (img_wdim != 1) - fit_wrdtp = false; - } - if (!fit_wrdtp) { - return tr( - "Selected object can't be meshed because the image's word type is " - "not supported by this plugin."); - } } # endif @@ -543,6 +522,9 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, .arg(bbox.ymax() - bbox.ymin(),0,'g',3) .arg(bbox.zmax() - bbox.zmin(),0,'g',3) ); + const bool input_is_labeled_img = (image_item != nullptr && !image_item->isGray()); + const bool input_is_gray_img = (image_item != nullptr && image_item->isGray()); + set_defaults(); double diag = CGAL::sqrt((bbox.xmax()-bbox.xmin())*(bbox.xmax()-bbox.xmin()) + (bbox.ymax()-bbox.ymin())*(bbox.ymax()-bbox.ymin()) + (bbox.zmax()-bbox.zmin())*(bbox.zmax()-bbox.zmin())); ui.facetSizing->setRange(diag * 10e-6, // min @@ -561,11 +543,13 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, ui.protect->setEnabled(features_protection_available); ui.protect->setChecked(features_protection_available); ui.protectEdges->setEnabled(features_protection_available); + if(input_is_gray_img) + ui.sharpFeaturesGroup->setEnabled(false); ui.facegraphCheckBox->setVisible(mesh_type == Mesh_type::SURFACE_ONLY); - ui.initializationGroup->setVisible(image_item != nullptr && - !image_item->isGray()); - ui.grayImgGroup->setVisible(image_item != nullptr && image_item->isGray()); + ui.initializationGroup->setVisible(input_is_labeled_img); + ui.grayImgGroup->setVisible(input_is_gray_img); + if (items->which() == POLYHEDRAL_MESH_ITEMS) ui.volumeGroup->setVisible(mesh_type == Mesh_type::VOLUME && nullptr != bounding_sm_item); @@ -609,7 +593,6 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type, connect(ui.useWeights_checkbox, SIGNAL(toggled(bool)), ui.weightsSigma_label, SLOT(setEnabled(bool))); ui.weightsSigma->setValue(1.); - bool input_is_labeled_img = (image_item != nullptr && !image_item->isGray()); ui.labeledImgGroup->setVisible(input_is_labeled_img); #ifndef CGAL_USE_ITK diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index fecc73c41ea..c4f59578610 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -248,7 +248,7 @@ Meshing_thread* cgal_code_mesh_3(const Implicit_function_interface* pfunction, pfunction->bbox().zmax()); namespace p = CGAL::parameters; Function_mesh_domain* p_domain = - new Function_mesh_domain(Function_wrapper(*pfunction), domain_bbox, 1e-7, + new Function_mesh_domain(p::function = Function_wrapper(*pfunction), p::bounding_object = domain_bbox, p::relative_error_bound = 1e-7, p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); } ); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h index d5249e256b9..8a7c309017c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_function.h @@ -226,13 +226,13 @@ initialize(const Mesh_criteria& criteria, Mesh_fnt::Domain_tag) C3t3, Domain, Mesh_criteria, - CGAL::Mesh_3::internal::has_Has_features::value >() + CGAL::internal::has_Has_features::value >() (c3t3_, *domain_, criteria, p_.protect_features, p::mesh_3_options(p::pointer_to_stop_atomic_boolean = &stop_, - p::nonlinear_growth_of_balls = true)); + p::nonlinear_growth_of_balls = true).v); } template < typename D_, typename Tag > diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp index 627afb7577b..0ceb091a78a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Optimization_plugin_cgal_code.cpp @@ -171,7 +171,7 @@ Optimizer_thread* cgal_code_optimization(Scene_c3t3_item& c3t3_item, p_function->bbox().zmax()); Function_mesh_domain* p_domain = - new Function_mesh_domain(Function_wrapper(*p_function), dom_bbox, 1e-7, + new Function_mesh_domain(CGAL::parameters::function = Function_wrapper(*p_function), CGAL::parameters::bounding_object = dom_bbox, CGAL::parameters::relative_error_bound = 1e-7, CGAL::parameters::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); } ); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h index 50aa90773b8..482e1f323fc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/config_mesh_3.h @@ -1,8 +1,6 @@ #ifndef CGAL_DEMO_MESH_3_CONFIG_H #define CGAL_DEMO_MESH_3_CONFIG_H -#define BOOST_PARAMETER_MAX_ARITY 12 - // CGAL_MESH_3_PROTECTION_DEBUG: // - 1 : display debug messages // - 2 : dump file `polylines_graph.polylines.txt` and diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui index 91f3b989f8a..9b8b669d72b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/PartitionDialog.ui @@ -62,7 +62,7 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "https://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui index 5d276e0149d..f2839e20f06 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_widget.ui @@ -934,7 +934,7 @@ QGroupBox::title { - 0 0 0 1 1 1 + 0 0 0 1 1 0 @@ -1046,7 +1046,7 @@ QGroupBox::title { - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "https://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> @@ -1094,7 +1094,7 @@ p, li { white-space: pre-wrap; } - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "https://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp index f32c322c16d..f3be698c5ad 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Point_inside_polyhedron_plugin.cpp @@ -192,7 +192,7 @@ public Q_SLOTS: boost::optional bbox = boost::make_optional(false, CGAL::Three::Scene_interface::Bbox()); // Workaround a bug in g++-4.8.3: - // http://stackoverflow.com/a/21755207/1728537 + // https://stackoverflow.com/a/21755207/1728537 // Using boost::make_optional to copy-initialize 'bbox' hides the // warning about '*bbox' not being initialized. // -- Laurent Rineau, 2014/10/30 diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp index a806f73e76f..1cae60b9a70 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Repair_polyhedron_plugin.cpp @@ -299,12 +299,10 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() std::vector remaining_cycles; CGAL::Polygon_mesh_processing::extract_boundary_cycles(tm, std::back_inserter(remaining_cycles)); - int tested=0, done=0; for (halfedge_descriptor hc : remaining_cycles) { if (next(next(hc,tm),tm)==prev(hc,tm)) { - ++tested; //get smallest halfedge halfedge_descriptor hm = hc; double min_l = CGAL::Polygon_mesh_processing::edge_length(hc, tm); @@ -335,7 +333,6 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionSnapBorders_triggered() std::array vr = { source(hm, tm), target(hm, tm), target(next(hm, tm), tm) }; CGAL::Euler::add_face(vr, tm); CGAL::Euler::collapse_edge(edge(hm, tm), tm); - ++done; } } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index c2150d90688..4c2dcc1702a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -753,7 +753,6 @@ public Q_SLOTS: return; } std::unordered_map is_selected_map; - int index = 0; for(fg_face_descriptor fh : faces(*selection_item->polyhedron())) { if(selection_item->selected_facets.find(fh) @@ -763,7 +762,6 @@ public Q_SLOTS: { is_selected_map[fh]=true; } - ++index; } CGAL::expand_face_selection_for_removal(selection_item->selected_facets, *selection_item->polyhedron(), @@ -1069,7 +1067,7 @@ public Q_SLOTS: selection_item->set_is_insert(is_insert); selection_item->set_k_ring(k_ring); selection_item->setRenderingMode(Flat); - if(selection_item->name() == "unamed") { + if(selection_item->name() == "unnamed") { selection_item->setName(tr("%1 (selection)").arg(poly_item->name())); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Register_point_sets_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Register_point_sets_plugin.ui index 9cc5d979842..e527115cd2b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Register_point_sets_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Register_point_sets_plugin.ui @@ -187,7 +187,7 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "https://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:normal;"> diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp index c8913412da2..31f46ffc2fb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_simplification_plugin.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -25,7 +25,7 @@ typedef Scene_facegraph_item::Face_graph FaceGraph; class Custom_stop_predicate { bool m_and; - CGAL::Surface_mesh_simplification::Count_stop_predicate m_count_stop; + CGAL::Surface_mesh_simplification::Edge_count_stop_predicate m_count_stop; CGAL::Surface_mesh_simplification::Edge_length_stop_predicate m_length_stop; public: diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index 2f0c22a1d97..860cc2d66e9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -286,8 +286,8 @@ SMesh* cgal_off_meshing(QWidget*, Mesh_domain domain = Mesh_domain::create_implicit_mesh_domain - (offset_function(tm_ptr, offset_value), - Sphere_3(center, sqrad), + (p::function = offset_function(tm_ptr, offset_value), + p::bounding_object = Sphere_3(center, sqrad), p::relative_error_bound = 1e-7, p::construct_surface_patch_index = [](int i, int j) { return (i * 1000 + j); }); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp index 03259d7e6eb..d6be0d38c6a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Shortest_path_plugin.cpp @@ -222,7 +222,7 @@ void Polyhedron_demo_shortest_path_plugin::new_item(int itemIndex) item->setRenderingMode(Flat); - if(item->name() == "unamed") + if(item->name() == "unnamed") { item->setName(tr("%1 (shortest path computation item)").arg(item->polyhedron_item()->name())); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index 05337f34adf..a3b77b8e452 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -16,7 +16,7 @@ find_package(Qt5 QUIET COMPONENTS OpenGL Script Svg OPTIONAL_COMPONENTS ScriptTools WebSockets) -if(RUNNING_CGAL_AUTO_TEST) +if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) if(Qt5_FOUND) include(${CGAL_USE_FILE}) endif() diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc b/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc index dc9a43a0d81..8b31d1ee17d 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc +++ b/Polyhedron/demo/Polyhedron/Polyhedron_3.qrc @@ -50,6 +50,7 @@ resources/shader_instanced.vert resources/shader_no_light_no_selection.frag resources/shader_c3t3_spheres.vert + resources/shader_c3t3_spheres.frag resources/shader_c3t3_edges.vert resources/shader_c3t3_edges.frag resources/shader_c3t3.vert @@ -84,6 +85,7 @@ resources/compatibility_shaders/shader_c3t3_edges.frag resources/compatibility_shaders/shader_c3t3_edges.vert resources/compatibility_shaders/shader_c3t3_spheres.vert + resources/compatibility_shaders/shader_c3t3_spheres.frag resources/compatibility_shaders/shader_c3t3.frag resources/compatibility_shaders/shader_c3t3.vert resources/compatibility_shaders/shader_instanced.vert diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo.cpp index 4a1ec1d8a6d..7b6e5225dfe 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo.cpp @@ -104,7 +104,7 @@ Polyhedron_demo::Polyhedron_demo(int& argc, char **argv, // On Apple, the first time the application is launched, the menus are unclicable, and // the only way you can fix it is to unfocus and re-focus the application. // This is a hack that makes the application lose the focus after it is started, to force the user - // to re-focus it. (source : http://www.alecjacobson.com/weblog/?p=3910) + // to re-focus it. (source: https://www.alecjacobson.com/weblog/?p=3910) #ifdef __APPLE__ system("osascript -e 'tell application \"System Events\" " "to keystroke tab using {command down, shift down}'"); diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp index 27ec846f35c..4e2294cdaa6 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp @@ -189,7 +189,6 @@ Scene_nef_polyhedron_item_priv::mark_domains(CDT& ct, void Scene_nef_polyhedron_item_priv::compute_normals_and_vertices(void) const { QApplication::setOverrideCursor(Qt::WaitCursor); - int count = 0; positions_facets.resize(0); positions_points.resize(0); normals.resize(0); @@ -205,7 +204,6 @@ void Scene_nef_polyhedron_item_priv::compute_normals_and_vertices(void) const { if(f->is_twin()) continue; bool incident_volume_marked = f->incident_volume()->mark(); - count++; Nef_polyhedron::Vector_3 v = (incident_volume_marked? -1:1) * f->plane().orthogonal_vector(); P_traits cdt_traits(v); CDT cdt(cdt_traits); diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index 0d353f554cf..d704582ece1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -911,32 +911,34 @@ void Scene_polygon_soup_item::repair(bool erase_dup, bool req_same_orientation) CGAL::Three::Scene_item::Header_data Scene_polygon_soup_item::header() const { CGAL::Three::Scene_item::Header_data data; - //categories + //categories + data.categories.append(std::pair(QString("Properties"),2)); data.categories.append(std::pair(QString("Vertices"),1)); - data.categories.append(std::pair(QString("Polygons"),4)); + data.categories.append(std::pair(QString("Polygons"),2)); data.categories.append(std::pair(QString("Edges"),6)); data.categories.append(std::pair(QString("Angles"),3)); - //titles + data.titles.append(QString("Pure Triangle")); + data.titles.append(QString("Pure Quad")); + data.titles.append(QString("#Points")); data.titles.append(QString("#Polygons")); - data.titles.append(QString("Pure Triangle")); - data.titles.append(QString("Pure Quad")); data.titles.append(QString("#Degenerate Polygons")); data.titles.append(QString("#Edges")); + data.titles.append(QString("#Degenerate Edges")); data.titles.append(QString("Minimum Length")); data.titles.append(QString("Maximum Length")); data.titles.append(QString("Median Length")); data.titles.append(QString("Mean Length")); - data.titles.append(QString("#Degenerate Edges")); data.titles.append(QString("Minimum")); data.titles.append(QString("Maximum")); data.titles.append(QString("Average")); + return data; } @@ -954,7 +956,7 @@ QString Scene_polygon_soup_item::computeStats(int type) case NB_EDGES: return QString::number(d->nb_lines/6); - case NB_DEGENERATED_FACES: + case NB_DEGENERATE_FACES: { if(d->is_triangle) { @@ -968,11 +970,11 @@ QString Scene_polygon_soup_item::computeStats(int type) return QString::number(d->minl); case MAX_LENGTH: return QString::number(d->maxl); - case MID_LENGTH: + case MED_LENGTH: return QString::number(d->midl); case MEAN_LENGTH: return QString::number(d->meanl); - case NB_NULL_LENGTH: + case NB_DEGENERATE_EDGES: return QString::number(d->nb_null_edges); case MIN_ANGLE: diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h index ab292ea6505..5dea8c11f02 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h @@ -154,19 +154,25 @@ public: const Edges& non_manifold_edges() const; void initializeBuffers(CGAL::Three::Viewer_interface *) const Q_DECL_OVERRIDE; void computeElements() const Q_DECL_OVERRIDE; + //statistics - enum STATS { - NB_VERTICES = 0, - NB_FACETS, - IS_PURE_TRIANGLE, + enum STATS + { + IS_PURE_TRIANGLE = 0, IS_PURE_QUAD, - NB_DEGENERATED_FACES, + + NB_VERTICES, + + NB_FACETS, + NB_DEGENERATE_FACES, + NB_EDGES, + NB_DEGENERATE_EDGES, MIN_LENGTH, MAX_LENGTH, - MID_LENGTH, + MED_LENGTH, MEAN_LENGTH, - NB_NULL_LENGTH, + MIN_ANGLE, MAX_ANGLE, MEAN_ANGLE diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index 404c38adde7..ea21767f2da 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -461,7 +461,6 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const const CGAL::qglviewer::Vec offset = Three::mainViewer()->offset(); color_fixed_points.clear(); positions_fixed_points.clear(); - int i=0; constVPmap vpm = get(CGAL::vertex_point,*polyhedron()); @@ -487,7 +486,6 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const color_fixed_points.push_back(0.0); color_fixed_points.push_back(0.0); } - i++; } } @@ -509,10 +507,10 @@ void Scene_polyhedron_selection_item_priv::compute_temp_elements()const positions_temp_points.data(), static_cast(positions_temp_points.size()*sizeof(float))); -item->getPointContainer(Fixed_points)->allocate( - Pc::Vertices, - positions_fixed_points.data(), - static_cast(positions_fixed_points.size()*sizeof(float))); + item->getPointContainer(Fixed_points)->allocate( + Pc::Vertices, + positions_fixed_points.data(), + static_cast(positions_fixed_points.size()*sizeof(float))); item->getPointContainer(Fixed_points)->allocate( Pc::Colors, @@ -2360,9 +2358,9 @@ QString Scene_polyhedron_selection_item::computeStats(int type) { case MIN_LENGTH: case MAX_LENGTH: - case MID_LENGTH: + case MED_LENGTH: case MEAN_LENGTH: - case NB_NULL_LENGTH: + case NB_DEGENERATE_EDGES: if(selected_edges.size() == 0) return QString("n/a"); else @@ -2488,7 +2486,7 @@ QString Scene_polyhedron_selection_item::computeStats(int type) case GENUS: return QString("n/a"); break; - case NB_DEGENERATED_FACES: + case NB_DEGENERATE_FACES: { if(is_triangle_mesh(*d->poly)) { @@ -2529,11 +2527,11 @@ QString Scene_polyhedron_selection_item::computeStats(int type) return QString::number(minl); case MAX_LENGTH: return QString::number(maxl); - case MID_LENGTH: + case MED_LENGTH: return QString::number(midl); case MEAN_LENGTH: return QString::number(meanl); - case NB_NULL_LENGTH: + case NB_DEGENERATE_EDGES: return QString::number(number_of_null_length_edges); case MIN_ANGLE: @@ -2542,7 +2540,7 @@ QString Scene_polyhedron_selection_item::computeStats(int type) return QString::number(maxi); case MEAN_ANGLE: return QString::number(ave); - case HOLES: + case NB_HOLES: { return QString("n/a"); } @@ -2592,24 +2590,26 @@ CGAL::Three::Scene_item::Header_data Scene_polyhedron_selection_item::header() c CGAL::Three::Scene_item::Header_data data; //categories - data.categories.append(std::pair(QString("Properties"),10)); + data.categories.append(std::pair(QString("Properties"),8)); + data.categories.append(std::pair(QString("Vertices"),1)); data.categories.append(std::pair(QString("Faces"),10)); data.categories.append(std::pair(QString("Edges"),7)); - data.categories.append(std::pair(QString("Angles"),2)); - + data.categories.append(std::pair(QString("Angles"),3)); //titles - data.titles.append(QString("#Vertices")); data.titles.append(QString("#Connected Components")); - data.titles.append(QString("#Border Edges")); + data.titles.append(QString("#Connected Components of the Boundary")); + data.titles.append(QString("Genus")); data.titles.append(QString("Pure Triangle")); data.titles.append(QString("Pure Quad")); - data.titles.append(QString("#Degenerate Faces")); - data.titles.append(QString("Connected Components of the Boundary")); data.titles.append(QString("Area")); data.titles.append(QString("Volume")); data.titles.append(QString("Self-Intersecting")); + + data.titles.append(QString("#Vertices")); + data.titles.append(QString("#Faces")); + data.titles.append(QString("#Degenerate Faces")); data.titles.append(QString("Min Area")); data.titles.append(QString("Max Area")); data.titles.append(QString("Median Area")); @@ -2618,16 +2618,19 @@ CGAL::Three::Scene_item::Header_data Scene_polyhedron_selection_item::header() c data.titles.append(QString("Min Aspect-Ratio")); data.titles.append(QString("Max Aspect-Ratio")); data.titles.append(QString("Mean Aspect-Ratio")); - data.titles.append(QString("Genus")); + data.titles.append(QString("#Edges")); + data.titles.append(QString("#Border Edges")); + data.titles.append(QString("#Degenerate Edges")); data.titles.append(QString("Minimum Length")); data.titles.append(QString("Maximum Length")); data.titles.append(QString("Median Length")); data.titles.append(QString("Mean Length")); - data.titles.append(QString("#Degenerate Edges")); + data.titles.append(QString("Minimum")); data.titles.append(QString("Maximum")); data.titles.append(QString("Average")); + return data; } diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index 09342bda810..8164cdacf8f 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -288,7 +288,7 @@ public: void compute_bbox() const { // Workaround a bug in g++-4.8.3: - // http://stackoverflow.com/a/21755207/1728537 + // https://stackoverflow.com/a/21755207/1728537 // Using boost::make_optional to copy-initialize 'item_bbox' hides the // warning about '*item_bbox' not being initialized. // -- Laurent Rineau, 2014/10/30 @@ -1085,18 +1085,24 @@ protected : public: //statistics - enum STATS { - NB_VERTICES = 0, - NB_CONNECTED_COMPOS, - NB_BORDER_EDGES, + enum STATS + { + // Properties + NB_CONNECTED_COMPOS = 0, + NB_HOLES, + GENUS, IS_PURE_TRIANGLE, IS_PURE_QUAD, - NB_DEGENERATED_FACES, - HOLES, AREA, VOLUME, SELFINTER, + + // Vertices + NB_VERTICES, + + // Facets NB_FACETS, + NB_DEGENERATE_FACES, MIN_AREA, MAX_AREA, MED_AREA, @@ -1105,13 +1111,17 @@ public: MIN_ASPECT_RATIO, MAX_ASPECT_RATIO, MEAN_ASPECT_RATIO, - GENUS, + + // Edges NB_EDGES, + NB_BORDER_EDGES, + NB_DEGENERATE_EDGES, MIN_LENGTH, MAX_LENGTH, - MID_LENGTH, + MED_LENGTH, MEAN_LENGTH, - NB_NULL_LENGTH, + + // Angles MIN_ANGLE, MAX_ANGLE, MEAN_ANGLE diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index 7dfc1825da6..966acaf34e4 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -602,12 +602,11 @@ void Scene_polylines_item::split_at_sharp_angles() typedef Polyline Bare_polyline; Polylines_container& bare_polylines = polylines; - int counter = 0; for(Bare_polyline_container::iterator bare_polyline_it = bare_polylines.begin(); bare_polyline_it != bare_polylines.end(); // the end changes - // during the loop - ++counter /* bare_polyline_it is incremented in the loop */) + // during the loop + /* bare_polyline_it is incremented in the loop */) { Bare_polyline_container::iterator current_polyline_it = bare_polyline_it; diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index bf2ceccb0f7..75db7480aaa 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -889,7 +889,7 @@ QString Scene_surface_mesh_item::toolTip() const .arg(num_faces(*d->smesh_)) .arg(this->renderingModeName()) .arg(this->color().name()); - str += QString("
    Number of isolated vertices: %1
    ").arg(getNbIsolatedvertices()); + return str; } @@ -1625,9 +1625,9 @@ QString Scene_surface_mesh_item::computeStats(int type) { case MIN_LENGTH: case MAX_LENGTH: - case MID_LENGTH: + case MED_LENGTH: case MEAN_LENGTH: - case NB_NULL_LENGTH: + case NB_DEGENERATE_EDGES: edges_length(d->smesh_, minl, maxl, meanl, midl, d->number_of_null_length_edges); } @@ -1683,6 +1683,8 @@ QString Scene_surface_mesh_item::computeStats(int type) { case NB_VERTICES: return QString::number(num_vertices(*d->smesh_)); + case NB_ISOLATED_VERTICES: + return QString::number(this->getNbIsolatedvertices()); case HAS_NM_VERTICES: { if(d->has_nm_vertices) @@ -1714,7 +1716,7 @@ QString Scene_surface_mesh_item::computeStats(int type) case NB_EDGES: return QString::number(num_halfedges(*d->smesh_) / 2); - case NB_DEGENERATED_FACES: + case NB_DEGENERATE_FACES: { if(is_triangle_mesh(*d->smesh_)) { @@ -1786,11 +1788,11 @@ QString Scene_surface_mesh_item::computeStats(int type) return QString::number(minl); case MAX_LENGTH: return QString::number(maxl); - case MID_LENGTH: + case MED_LENGTH: return QString::number(midl); case MEAN_LENGTH: return QString::number(meanl); - case NB_NULL_LENGTH: + case NB_DEGENERATE_EDGES: return QString::number(d->number_of_null_length_edges); case MIN_ANGLE: @@ -1799,7 +1801,7 @@ QString Scene_surface_mesh_item::computeStats(int type) return QString::number(maxi); case MEAN_ANGLE: return QString::number(ave); - case HOLES: + case NB_HOLES: return QString::number(nb_holes(d->smesh_)); case MIN_AREA: @@ -1837,25 +1839,29 @@ CGAL::Three::Scene_item::Header_data Scene_surface_mesh_item::header() const CGAL::Three::Scene_item::Header_data data; //categories - data.categories.append(std::pair(QString("Properties"),11)); + data.categories.append(std::pair(QString("Properties"),9)); + data.categories.append(std::pair(QString("Vertices"),2)); data.categories.append(std::pair(QString("Faces"),10)); - data.categories.append(std::pair(QString("Edges"),6)); + data.categories.append(std::pair(QString("Edges"),7)); data.categories.append(std::pair(QString("Angles"),3)); //titles - data.titles.append(QString("#Vertices")); - data.titles.append(QString("Has Non-manifold Vertices")); data.titles.append(QString("#Connected Components")); - data.titles.append(QString("#Border Edges")); + data.titles.append(QString("#Connected Components of the Boundary")); + data.titles.append(QString("Genus")); data.titles.append(QString("Pure Triangle")); data.titles.append(QString("Pure Quad")); - data.titles.append(QString("#Degenerate Faces")); - data.titles.append(QString("Connected Components of the Boundary")); data.titles.append(QString("Area")); data.titles.append(QString("Volume")); data.titles.append(QString("Self-Intersecting")); + data.titles.append(QString("Has Non-manifold Vertices")); + + data.titles.append(QString("#Vertices")); + data.titles.append(QString("#Isolated Vertices")); + data.titles.append(QString("#Faces")); + data.titles.append(QString("#Degenerate Faces")); data.titles.append(QString("Min Area")); data.titles.append(QString("Max Area")); data.titles.append(QString("Median Area")); @@ -1864,16 +1870,19 @@ CGAL::Three::Scene_item::Header_data Scene_surface_mesh_item::header() const data.titles.append(QString("Min Aspect-Ratio")); data.titles.append(QString("Max Aspect-Ratio")); data.titles.append(QString("Mean Aspect-Ratio")); - data.titles.append(QString("Genus")); + data.titles.append(QString("#Edges")); + data.titles.append(QString("#Border Edges")); + data.titles.append(QString("#Degenerate Edges")); data.titles.append(QString("Minimum Length")); data.titles.append(QString("Maximum Length")); data.titles.append(QString("Median Length")); data.titles.append(QString("Mean Length")); - data.titles.append(QString("#Degenerate Edges")); + data.titles.append(QString("Minimum")); data.titles.append(QString("Maximum")); data.titles.append(QString("Average")); + return data; } diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h index 68ffb958dfb..eadae28b8eb 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.h @@ -104,20 +104,28 @@ public: bool save(std::ostream& out) const; bool save_obj(std::ostream& out) const; bool load_obj(std::istream& in); + //statistics - enum STATS { - NB_VERTICES = 0, - HAS_NM_VERTICES, - NB_CONNECTED_COMPOS, - NB_BORDER_EDGES, + enum STATS + { + // Properties + NB_CONNECTED_COMPOS = 0, + NB_HOLES, + GENUS, IS_PURE_TRIANGLE, IS_PURE_QUAD, - NB_DEGENERATED_FACES, - HOLES, AREA, VOLUME, SELFINTER, + HAS_NM_VERTICES, + + // Vertices + NB_VERTICES, + NB_ISOLATED_VERTICES, + + // Facets NB_FACETS, + NB_DEGENERATE_FACES, MIN_AREA, MAX_AREA, MED_AREA, @@ -126,13 +134,17 @@ public: MIN_ASPECT_RATIO, MAX_ASPECT_RATIO, MEAN_ASPECT_RATIO, - GENUS, + + // Edges NB_EDGES, + NB_BORDER_EDGES, + NB_DEGENERATE_EDGES, MIN_LENGTH, MAX_LENGTH, - MID_LENGTH, + MED_LENGTH, MEAN_LENGTH, - NB_NULL_LENGTH, + + // Angles MIN_ANGLE, MAX_ANGLE, MEAN_ANGLE diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.ui b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui index bbe92b716a9..1816683d2fe 100644 --- a/Polyhedron/demo/Polyhedron/Show_point_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.ui @@ -43,7 +43,7 @@
    - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "https://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu LGC Sans'; font-size:11pt; font-weight:400; font-style:normal;"> diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index 4b58030049f..ee0f20745ec 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -1359,9 +1359,9 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const case PROGRAM_CUTPLANE_SPHERES: { QOpenGLShaderProgram* program = isOpenGL_4_3() - ? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_spheres.vert" , ":/cgal/Polyhedron_3/resources/shader_c3t3.frag") + ? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_spheres.vert" , ":/cgal/Polyhedron_3/resources/shader_c3t3_spheres.frag") : declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_spheres.vert" , - ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.frag"); + ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_spheres.frag"); program->setProperty("hasLight", true); program->setProperty("hasNormals", true); program->setProperty("hasCenter", true); diff --git a/Polyhedron/demo/Polyhedron/Viewer.h b/Polyhedron/demo/Polyhedron/Viewer.h index 40af99fc098..357e8d52ec5 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.h +++ b/Polyhedron/demo/Polyhedron/Viewer.h @@ -84,7 +84,7 @@ public: TextRenderer* textRenderer() Q_DECL_OVERRIDE; - void enableClippingBox(QVector4D box[]) Q_DECL_OVERRIDE; + void enableClippingBox(QVector4D box[6]) Q_DECL_OVERRIDE; void disableClippingBox() Q_DECL_OVERRIDE; void set2DSelectionMode(bool) Q_DECL_OVERRIDE; void setStaticImage(QImage image) Q_DECL_OVERRIDE; diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h b/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h index f2bd4e37871..e864092c327 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h @@ -1,24 +1,32 @@ +// Copyright (c) 2015 GeometryFactory Sarl (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) : Laurent Rineau, Jane Tournois + #include #include #include +#include -#include #include #include #include #include +#include + #include -#include +#include -//a material is composed of an material Id and a material name. -typedef std::pair material; +namespace CGAL { -struct MaterialData -{ - material innerRegion; - material outerRegion; -}; std::string to_lower_case(const std::string& str) { @@ -27,44 +35,6 @@ std::string to_lower_case(const std::string& str) return r; } -bool get_material_metadata(std::istream& input, - std::string& line, - material& _material, - int material_id) -{ - std::istringstream iss; - iss.str(line); - - iss >> _material.second;//name - - while (std::getline(input, line)) - { - std::string prop; //property - iss.clear(); - iss.str(line); - iss >> prop; - - if (prop.compare("Id") == 0) - { - int tmp_id; - iss >> tmp_id; - _material.first = material_id; - - if ((0 == to_lower_case(_material.second).compare("exterior")) - && _material.first != 0) - { - std::cerr << "Exterior should have index 0. "; - std::cerr << "In this file it has index " << _material.first << "." << std::endl; - std::cerr << "Reader failed, because Meshing will fail to terminate." << std::endl; - return false; - } - } - else if (prop.compare("}") == 0) - return true; //end of this material - } - return false; -} - bool line_starts_with(const std::string& line, const char* cstr) { const std::size_t fnws = line.find_first_not_of(" \t"); @@ -76,26 +46,6 @@ bool line_starts_with(const std::string& line, const char* cstr) namespace IO{ namespace internal{ -bool treat_surf_materials(std::istream& input, - std::vector& materials, - int& material_id) -{ - std::string line; - while(std::getline(input, line)) - { - if(line_starts_with(line, "}")) - break; - else - { - material _material; - if (!get_material_metadata(input, line, _material, material_id++)) - return false; - materials.push_back(_material); - } - } - return true; -} - void treat_surf_grid_box(const std::string& line, CGAL::Bbox_3& grid_box) { @@ -390,7 +340,7 @@ bool build_binary_surf_patch(DuplicatedPointsOutIterator& out, */ template bool read_surf(std::istream& input, std::vector& output, - std::vector& metadata, + std::vector& metadata, CGAL::Bbox_3& grid_box, std::array& grid_size, DuplicatedPointsOutIterator out, @@ -402,7 +352,7 @@ bool read_surf(std::istream& input, std::vector& output, std::vector points; std::string line; std::size_t nb_vertices(0); - std::vector materials; + std::vector < CGAL::IO::internal::material > materials; //ignore header int material_id = 0; int nb_patches = 0; @@ -571,3 +521,5 @@ bool read_surf(std::istream& input, std::vector& output, } return true; } + +}//end namespace CGAL \ No newline at end of file diff --git a/Polyhedron/demo/Polyhedron/resources/about.html b/Polyhedron/demo/Polyhedron/resources/about.html index 3089144f7a1..b881e30bab7 100644 --- a/Polyhedron/demo/Polyhedron/resources/about.html +++ b/Polyhedron/demo/Polyhedron/resources/about.html @@ -1,9 +1,9 @@

    3D Polyhedral Surfaces

    -

    Copyright ©2008-2009 - GeometryFactory - and INRIA Sophia Antipolis - Mediterranee

    +

    Copyright ©2008-2009 + GeometryFactory + and INRIA Sophia Antipolis - Mediterranee

    This application illustrates the data structures of CGAL, and operations and algorithms that can be applied to.

    diff --git a/Polyhedron/demo/Polyhedron/resources/compatibility_shaders/shader_c3t3_spheres.frag b/Polyhedron/demo/Polyhedron/resources/compatibility_shaders/shader_c3t3_spheres.frag new file mode 100644 index 00000000000..26eb7b16578 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/resources/compatibility_shaders/shader_c3t3_spheres.frag @@ -0,0 +1,69 @@ + +varying highp vec4 color; +varying highp vec4 fP; +varying highp vec3 fN; +uniform highp vec4 light_pos; +uniform highp vec4 light_diff; +uniform highp vec4 light_spec; +uniform highp vec4 light_amb; +uniform highp float spec_power ; +uniform int is_two_side; +uniform bool is_selected; +uniform highp float near; +uniform highp float far; +uniform highp float width; +uniform highp float height; +uniform bool comparing; +uniform bool writing; +uniform sampler2D sampler; +uniform highp float alpha; + +highp float depth(float z) +{ + return (2 * near) / (far + near - z * (far - near)); +} + +void main(void) { + float d = depth(gl_FragCoord.z); + float test = texture2D(sampler, vec2(gl_FragCoord.x/width, gl_FragCoord.y/height)).r; + if(comparing && d <= test) + discard; + if(writing) + gl_FragColor = vec4(d,d,d,1.0); + else + { + if(color.w<0.) + { + + highp vec4 my_color = vec4(color.xyz, 1.); + highp vec3 L = light_pos.xyz - fP.xyz; + highp vec3 V = -fP.xyz; + highp vec3 N; + if(fN == vec3(0.0,0.0,0.0)) + { + gl_FragColor = my_color; + return; + } + else + N = normalize(fN); + L = normalize(L); + V = normalize(V); + highp vec3 R = reflect(-L, N); + highp vec4 diffuse; + if(is_two_side == 1) + diffuse = abs(dot(N,L)) * light_diff * my_color; + else + diffuse = max(dot(N,L), 0.0) * light_diff * my_color; + highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; + highp vec4 ret_color = vec4((my_color*light_amb).xyz + diffuse.xyz + specular.xyz,1); + if(is_selected) + gl_FragColor = vec4(ret_color.r+70.0/255.0, ret_color.g+70.0/255.0, ret_color.b+70.0/255.0, alpha); + else + gl_FragColor = vec4(ret_color.xyz, alpha); + } + else + discard; + } +} + + diff --git a/Polyhedron/demo/Polyhedron/resources/shader_c3t3_spheres.frag b/Polyhedron/demo/Polyhedron/resources/shader_c3t3_spheres.frag new file mode 100644 index 00000000000..9a40fe3dd2d --- /dev/null +++ b/Polyhedron/demo/Polyhedron/resources/shader_c3t3_spheres.frag @@ -0,0 +1,72 @@ +#version 150 +in vec4 color; +in vec4 fP; +in vec3 fN; +uniform vec4 light_pos; +uniform vec4 light_diff; +uniform vec4 light_spec; +uniform vec4 light_amb; +uniform float spec_power ; +uniform int is_two_side; +uniform bool is_selected; +uniform float near; +uniform float far; +uniform float width; +uniform float height; +uniform bool comparing; +uniform bool writing; +uniform sampler2D sampler; +uniform float alpha; +uniform bool is_surface; +uniform vec4 is_visible_bitset; +uniform bool is_filterable; +out vec4 out_color; + +float depth(float z) +{ + return (2 * near) / (far + near - z * (far - near)); +} + +void main(void) { + float d = depth(gl_FragCoord.z); + float test = texture(sampler, vec2(gl_FragCoord.x/width, gl_FragCoord.y/height)).r; + if(comparing && d <= test) + discard; + if(writing) + out_color = vec4(d,d,d,1.0); + else + { + if(color.w<0 || is_surface) + { + vec4 my_color = vec4(color.xyz, 1.); + vec3 L = light_pos.xyz - fP.xyz; + vec3 V = -fP.xyz; + vec3 N; + if(fN == vec3(0.0,0.0,0.0)) + { + out_color = my_color; + return; + } + else + N = normalize(fN); + L = normalize(L); + V = normalize(V); + vec3 R = reflect(-L, N); + vec4 diffuse; + if(is_two_side == 1) + diffuse = abs(dot(N,L)) * light_diff * my_color; + else + diffuse = max(dot(N,L), 0.0) * light_diff * my_color; + vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; + vec4 ret_color = vec4((my_color*light_amb).xyz + diffuse.xyz + specular.xyz,1); + if(is_selected) + out_color = vec4(ret_color.r+70.0/255.0, ret_color.g+70.0/255.0, ret_color.b+70.0/255.0, alpha); + else + out_color = vec4(ret_color.xyz, alpha); + } + else + discard; + } +} + + diff --git a/Polyhedron/include/CGAL/Polyhedron_3.h b/Polyhedron/include/CGAL/Polyhedron_3.h index 6505e960139..255bb786289 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_3.h @@ -855,6 +855,10 @@ public: Facet_iterator facets_end() { return hds_.faces_end();} + // added for convenience + Facet_iterator faces_begin() { return hds_.faces_begin();} + Facet_iterator faces_end() { return hds_.faces_end();} + Facet_handles facet_handles() { return make_prevent_deref_range(facets_begin(), facets_end()); } @@ -886,6 +890,10 @@ public: Facet_const_iterator facets_begin() const { return hds_.faces_begin();} Facet_const_iterator facets_end() const { return hds_.faces_end();} + // added for convenience + Facet_const_iterator faces_begin() const { return hds_.faces_begin();} + Facet_const_iterator faces_end() const { return hds_.faces_end();} + Facet_const_handles facet_handles() const { return make_prevent_deref_range(facets_begin(), facets_end()); } diff --git a/Polynomial/doc/Polynomial/CGAL/Polynomial.h b/Polynomial/doc/Polynomial/CGAL/Polynomial.h index c908c8dd2d0..15c657b628d 100644 --- a/Polynomial/doc/Polynomial/CGAL/Polynomial.h +++ b/Polynomial/doc/Polynomial/CGAL/Polynomial.h @@ -12,11 +12,11 @@ The template argument `Coeff` must be at least a model of `IntegralDomainWithoutDivision`. For all operations naturally involving division, an `IntegralDomain` is required. -`Polynomial` offers a full set of algebraic operators, i.e.\ +`Polynomial` offers a full set of algebraic operators, i.e. binary +, -, *, / as well as +=, -=, *=, /=; not only for polynomials but also for a polynomial and a number of the coefficient type. -(The / operator must only be used for integral divisions, i.e.\ +(The / operator must only be used for integral divisions, i.e. those with remainder zero.) The operations are implemented naively: + and - need a number of `Coeff` operations which is linear in the degree while * is quadratic. diff --git a/Polynomial/doc/Polynomial/CGAL/polynomial_utils.h b/Polynomial/doc/Polynomial/CGAL/polynomial_utils.h index 2fc219ffd44..fa60a32a8a1 100644 --- a/Polynomial/doc/Polynomial/CGAL/polynomial_utils.h +++ b/Polynomial/doc/Polynomial/CGAL/polynomial_utils.h @@ -494,8 +494,7 @@ For a sequence \f$ I:=(a_0,\ldots,a_n)\f$ of real numbers with \f$ a_0\neq 0\f$, \f[ C(I)=\ccSum{i=1}{s}\epsilon_i \f] where \f$ s\f$ is the number of subsequences of \f$ I\f$ of the form -\image html underbrace.png -\image latex underbrace.png +\f[ (a,\underbrace{0, \dots,0}_{k},b) \f] with \f$ a\neq 0,b\neq 0, k\geq 0\f$. @@ -546,8 +545,7 @@ For a sequence \f$ I:=(a_0,\ldots,a_n)\f$ of real numbers with \f$ a_0\neq 0\f$, \f[ C(I)=\ccSum{i=1}{s}\epsilon_i \f] where \f$ s\f$ is the number of subsequences of \f$ I\f$ of the form -\image html underbrace.png -\image latex underbrace.png +\f[ (a,\underbrace{0, \dots,0}_{k},b) \f] with \f$ a\neq 0,b\neq 0, k\geq 0\f$. diff --git a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--PolynomialSubresultants.h b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--PolynomialSubresultants.h index 85d45c187ce..3418ef03626 100644 --- a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--PolynomialSubresultants.h +++ b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--PolynomialSubresultants.h @@ -11,8 +11,17 @@ Let is the outermost variable. The \f$ i\f$-th subresultant (with \f$ i=0,\ldots,\min\{n,m\}\f$) is defined by -\image html subresultant_def.png -\image latex subresultant_def.png +\f[ +\mathrm{Sres}_{i}(p,q) = \det +\begin{pmatrix} + p_{n} & \dots & & \dots & p_{2i-m+2} & x^{m-i-1}p \\ + & \ddots & & & \vdots & \vdots\\ + & & p_{n} & \dots & p_{i+1} & p \\ + q_{m} & \dots & & \dots & q_{2i-n+2} & x^{n-i-1}q \\ + & \ddots & & & \vdots & \vdots\\ + & & q_{m} & \dots & q_{i+1} & q +\end{pmatrix} +\f] where \f$ p_i\f$ and \f$ q_i\f$ are set to zero if \f$ i<0\f$. In the case that \f$ n=m\f$, \f$ \mathrm{Sres_n}\f$ is set to \f$ q\f$. diff --git a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--Resultant.h b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--Resultant.h index 5df1182a4b0..e337487c90d 100644 --- a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--Resultant.h +++ b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--Resultant.h @@ -17,8 +17,18 @@ where \f[ g = g_nx^n + \dots + g_0. \f] The resultant of \f$ f\f$ and \f$ g\f$ is defined as the determinant of the Sylvester matrix: -\image html sylvester_matrix.png -\image latex sylvester_matrix.png +\f[ +\begin{pmatrix} + f_{m} & \dots & f_{0} \\ + & f_{m} & \dots & f_{0} \\ + & & \ddots & & \ddots \\ + & & & f_{m} & \dots & f_{0} \\ + g_{n} & \dots & g_{0} \\ + & g_{n} & \dots & g_{0} \\ + & & \ddots & & \ddots \\ + & & & g_{n} & \dots & g_{0} +\end{pmatrix} +\f] Note that this is a \f$ (n+m)\times(n+m)\f$ matrix as there are \f$ n\f$ rows for \f$ f\f$ and \f$ m\f$ rows that are used for \f$ g\f$. The blank spaces are supposed to be diff --git a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--SturmHabichtSequence.h b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--SturmHabichtSequence.h index 5390c1b9e5d..c314610f9ee 100644 --- a/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--SturmHabichtSequence.h +++ b/Polynomial/doc/Polynomial/Concepts/PolynomialTraits_d--SturmHabichtSequence.h @@ -15,8 +15,15 @@ Let \f$ n:=\deg f\f$ and \f$ \delta_k:=(-1)^{k(k+1)/2}\f$. For \f$ k\in\{0,\ldots,n\}\f$, the \f$ k\f$-th Sturm-Habicht polynomial of \f$ f\f$ is defined as: -\image html sturm_habicht_def.png -\image latex sturm_habicht_def.png +\f[ +\mathrm{Stha}_{k}(f) = \left \{ +\begin{array}{cll} +f & \text{if} & k = n \\ +f' & \text{if} & k = n - 1 \\ +\delta_{n - k - 1}\mathrm{Sres}_{k}(f,f') & \text{if} & 0 \leq k \leq n - 2 +\end{array} +\right . +\f] where \f$ \mathrm{Sres}_k(f,f')\f$ is defined as in the concept `PolynomialTraits_d::PolynomialSubresultants`. diff --git a/Polynomial/doc/Polynomial/fig/sturm_habicht_def.png b/Polynomial/doc/Polynomial/fig/sturm_habicht_def.png deleted file mode 100644 index a0aace84a66..00000000000 Binary files a/Polynomial/doc/Polynomial/fig/sturm_habicht_def.png and /dev/null differ diff --git a/Polynomial/doc/Polynomial/fig/subresultant_def.png b/Polynomial/doc/Polynomial/fig/subresultant_def.png deleted file mode 100644 index 88309188129..00000000000 Binary files a/Polynomial/doc/Polynomial/fig/subresultant_def.png and /dev/null differ diff --git a/Polynomial/doc/Polynomial/fig/sylvester_matrix.png b/Polynomial/doc/Polynomial/fig/sylvester_matrix.png deleted file mode 100644 index 30b13c4f1b3..00000000000 Binary files a/Polynomial/doc/Polynomial/fig/sylvester_matrix.png and /dev/null differ diff --git a/Polynomial/doc/Polynomial/fig/underbrace.png b/Polynomial/doc/Polynomial/fig/underbrace.png deleted file mode 100644 index 6c0065d4f89..00000000000 Binary files a/Polynomial/doc/Polynomial/fig/underbrace.png and /dev/null differ diff --git a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h index cb34903e50a..6f882dd1280 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h +++ b/Polytope_distance_d/doc/Polytope_distance_d/Concepts/WidthTraits_3.h @@ -27,7 +27,7 @@ public: /*! The point type. The (in)equality tests must be -available. Access to the point coordinates is done via the `get_.()` +available. Access to the point coordinates is done via the `get_...()` functions. Constructing a point is done with the `make_point( )` operation. */ @@ -35,7 +35,7 @@ typedef unspecified_type Point_3; /*! The plane type. Access to the coefficients of the -plane is made via the `get_.()` functions. Constructing a plane is +plane is made via the `get_...()` functions. Constructing a plane is done with the `make_plane()` operation. */ typedef unspecified_type Plane_3; diff --git a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt index 0b4088ce277..aaecb2b37da 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt +++ b/Polytope_distance_d/doc/Polytope_distance_d/PackageDescription.txt @@ -19,17 +19,12 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalCRPSection{Assertions} -The optimization code uses infix `OPTIMISATION` in the assertions, -e.g. defining the compiler flag -`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition -checking off, cf. Section \ref secchecks. \cgalClassifedRefPages \cgalCRPSection{All Furthest Neighbors} -- `CGAL::all_furthest_neighbors_2` +- `CGAL::all_furthest_neighbors_2()` - `AllFurthestNeighborsTraits_2` \cgalCRPSection{Width} @@ -48,4 +43,3 @@ checking off, cf. Section \ref secchecks. */ - diff --git a/Polytope_distance_d/doc/Polytope_distance_d/dependencies b/Polytope_distance_d/doc/Polytope_distance_d/dependencies index a4d5f76715e..bceaab7e2f1 100644 --- a/Polytope_distance_d/doc/Polytope_distance_d/dependencies +++ b/Polytope_distance_d/doc/Polytope_distance_d/dependencies @@ -4,3 +4,4 @@ STL_Extension Algebraic_foundations Circulator Stream_support +Matrix_search diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h index ede3b47aa92..e58d94539f9 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h @@ -473,7 +473,7 @@ public: // NOTE: an implicit conversion from ET to RT must be available! Point realizing_point_p( ) const - { CGAL_optimisation_precondition( is_finite()); + { CGAL_precondition( is_finite()); return tco.construct_point_d_object() ( ambient_dimension(), realizing_point_p_coordinates_begin(), @@ -481,7 +481,7 @@ public: Point realizing_point_q( ) const - { CGAL_optimisation_precondition( is_finite()); + { CGAL_precondition( is_finite()); return tco.construct_point_d_object() ( ambient_dimension(), realizing_point_q_coordinates_begin(), @@ -512,7 +512,7 @@ public: std::copy( p_first, p_last, std::back_inserter( p_points)); std::copy( q_first, q_last, std::back_inserter( q_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin(), p_points.end()) && check_dimension( q_points.begin(), q_points.end()), "Not all points have the same dimension."); @@ -527,7 +527,7 @@ public: p_points.clear(); std::copy( p_first, p_last, std::back_inserter( p_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin(), p_points.end()), "Not all points have the same dimension."); @@ -541,7 +541,7 @@ public: q_points.clear(); std::copy( q_first, q_last, std::back_inserter( q_points)); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( q_points.begin(), q_points.end()), "Not all points have the same dimension."); @@ -551,7 +551,7 @@ public: void insert_p( const Point& p) { - CGAL_optimisation_precondition + CGAL_precondition ( ( ! is_finite()) || ( tco.access_dimension_d_object()( p) == d)); p_points.push_back( p); @@ -562,7 +562,7 @@ public: void insert_q( const Point& q) { - CGAL_optimisation_precondition + CGAL_precondition ( ( ! is_finite()) || ( tco.access_dimension_d_object()( q) == d)); q_points.push_back( q); @@ -575,12 +575,12 @@ public: insert( InputIterator1 p_first, InputIterator1 p_last, InputIterator2 q_first, InputIterator2 q_last) { - CGAL_optimisation_precondition_code(int old_r = static_cast(p_points.size())); - CGAL_optimisation_precondition_code(int old_s = static_cast(q_points.size())); + CGAL_precondition_code(int old_r = static_cast(p_points.size())); + CGAL_precondition_code(int old_s = static_cast(q_points.size())); p_points.insert( p_points.end(), p_first, p_last); q_points.insert( q_points.end(), q_first, q_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin()+old_r, p_points.end()) && check_dimension( q_points.begin()+old_s, q_points.end()), "Not all points have the same dimension."); @@ -591,10 +591,10 @@ public: void insert_p( InputIterator p_first, InputIterator p_last) { - CGAL_optimisation_precondition_code(int old_r = static_cast(p_points.size())); + CGAL_precondition_code(int old_r = static_cast(p_points.size())); p_points.insert( p_points.end(), p_first, p_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( p_points.begin()+old_r, p_points.end()), "Not all points have the same dimension."); compute_distance(); @@ -604,10 +604,10 @@ public: void insert_q( InputIterator q_first, InputIterator q_last) { - CGAL_optimisation_precondition_code( int old_s = static_cast(q_points.size())); + CGAL_precondition_code( int old_s = static_cast(q_points.size())); q_points.insert( q_points.end(), q_first, q_last); set_dimension(); - CGAL_optimisation_precondition_msg + CGAL_precondition_msg (check_dimension( q_points.begin()+old_s, q_points.end()), "Not all points have the same dimension."); compute_distance(); @@ -681,7 +681,7 @@ private: // construct program int n = 2 * d + static_cast(p_points.size() + q_points.size()); int m = d + 2; - CGAL_optimisation_precondition (p_points.size() > 0); + CGAL_precondition (p_points.size() > 0); QP qp (n, m, A_iterator (boost::counting_iterator(0), @@ -696,7 +696,7 @@ private: Quadratic_program_options options; options.set_pricing_strategy(pricing_strategy(NT())); solver = new Solver(qp, options); - CGAL_optimisation_assertion(solver->status() == QP_OPTIMAL); + CGAL_assertion(solver->status() == QP_OPTIMAL); // compute support and realizing points ET et_0 = 0; int r = static_cast(p_points.size()); @@ -773,8 +773,8 @@ is_valid( bool verbose, int level) const // compute normal vector ET_vector normal( d), diff( d); ET et_0 = 0, den = p_coords[d]; - CGAL_optimisation_assertion (den > et_0); - CGAL_optimisation_assertion (den == q_coords[d]); + CGAL_assertion (den > et_0); + CGAL_assertion (den == q_coords[d]); int i, j; for ( j = 0; j < d; ++j) normal[ j] = p_coords[ j] - q_coords[ j]; @@ -917,7 +917,7 @@ operator << ( std::ostream& os, break; default: - CGAL_optimisation_assertion_msg( false, + CGAL_assertion_msg( false, "CGAL::IO::get_mode( os) invalid!"); break; } diff --git a/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h b/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h index d2927f43d6b..4c2b6ae4039 100644 --- a/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h +++ b/Polytope_distance_d/include/CGAL/all_furthest_neighbors_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -53,8 +53,8 @@ public: Value operator()( int r, int c) const { - CGAL_optimisation_precondition(r >= 0 && r < number_of_rows()); - CGAL_optimisation_precondition(c >= 0 && c < number_of_columns()); + CGAL_precondition(r >= 0 && r < number_of_rows()); + CGAL_precondition(c >= 0 && c < number_of_columns()); if (c <= r) return Value(c - r); else if (c >= r + number_of_rows()) @@ -93,8 +93,8 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, // check preconditions: int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points > 0); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); // prepare random access container: @@ -125,7 +125,7 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, RandomAccessIC points_end, OutputIterator o, const Traits& - CGAL_optimisation_expensive_precondition_code(t), + CGAL_expensive_precondition_code(t), std::random_access_iterator_tag) { typedef All_furthest_neighbor_matrix< @@ -135,8 +135,8 @@ all_furthest_neighbors_2( RandomAccessIC points_begin, // check preconditions: int number_of_points( static_cast(iterator_distance( points_begin, points_end))); - CGAL_optimisation_precondition( number_of_points > 0); - CGAL_optimisation_expensive_precondition( + CGAL_precondition( number_of_points > 0); + CGAL_expensive_precondition( is_convex_2( points_begin, points_end, t)); // compute maxima: diff --git a/Principal_component_analysis/demo/Principal_component_analysis/resources/about.html b/Principal_component_analysis/demo/Principal_component_analysis/resources/about.html index 8d2c41d1ea0..d6b327c3558 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/resources/about.html +++ b/Principal_component_analysis/demo/Principal_component_analysis/resources/about.html @@ -2,8 +2,8 @@

    AABB Tree Demo

    Copyright ©2009 - INRIA Sophia Antipolis - Mediterranee

    -

    This application illustrates the AABB tree component + INRIA Sophia Antipolis - Mediterranee

    +

    This application illustrates the AABB tree component of CGAL, applied to polyhedron facets and edges.

    See also the following chapters of the manual: diff --git a/Profiling_tools/include/CGAL/Memory_sizer.h b/Profiling_tools/include/CGAL/Memory_sizer.h index 4bf90350f2e..6d0551ef7f9 100644 --- a/Profiling_tools/include/CGAL/Memory_sizer.h +++ b/Profiling_tools/include/CGAL/Memory_sizer.h @@ -125,7 +125,7 @@ private: #else // __APPLE__ is defined - // http://miknight.blogspot.com/2005/11/resident-set-size-in-mac-os-x.html + // https://miknight.blogspot.com/2005/11/resident-set-size-in-mac-os-x.html // This is highly experimental. But still better than returning 0. // It appears that we might need certain 'rights' to get access to the kernel // task... It works if you have admin rights apparently diff --git a/QP_solver/doc/QP_solver/CGAL/QP_models.h b/QP_solver/doc/QP_solver/CGAL/QP_models.h index a16d6b9a22d..892d0027947 100644 --- a/QP_solver/doc/QP_solver/CGAL/QP_models.h +++ b/QP_solver/doc/QP_solver/CGAL/QP_models.h @@ -54,7 +54,7 @@ namespace CGAL { should give you a flavor of the use of this model in practice. - `QP_solver/solve_convex_hull_containment_lp.h` + \ref QP_solver/solve_convex_hull_containment_lp.h \ref QP_solver/convex_hull_containment.cpp @@ -305,7 +305,7 @@ make_quadratic_program_from_iterators ( \ref QP_solver/first_nonnegative_lp_from_iterators.cpp - `QP_solver/solve_convex_hull_containment_lp.h` + \ref QP_solver/solve_convex_hull_containment_lp.h \ref QP_solver/convex_hull_containment.cpp @@ -390,7 +390,7 @@ public: should give you a flavor of the use of this model in practice. - `QP_solver/solve_convex_hull_containment_lp.h` + \ref QP_solver/solve_convex_hull_containment_lp.h \ref QP_solver/convex_hull_containment.cpp @@ -478,7 +478,7 @@ public: should give you a flavor of the use of this model in practice. - `QP_solver/solve_convex_hull_containment_lp.h` + \ref QP_solver/solve_convex_hull_containment_lp.h \ref QP_solver/convex_hull_containment.cpp diff --git a/QP_solver/doc/QP_solver/QP_solver.txt b/QP_solver/doc/QP_solver/QP_solver.txt index dbdf2bcbeeb..993dc2174bd 100644 --- a/QP_solver/doc/QP_solver/QP_solver.txt +++ b/QP_solver/doc/QP_solver/QP_solver.txt @@ -559,7 +559,7 @@ You can avoid the explicit construction of the type `Nonnegative_linear_program_from_iterators` if you only need an expression of it, e.g. to pass it directly as an argument to the solving function. Here is an alternative -version of `QP_solver/solve_convex_hull_containment_lp.h` +version of \ref QP_solver/solve_convex_hull_containment_lp.h that shows how this works. In effect, you get shorter and more readable code. diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QBORE3D.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QBORE3D.mps index be23f7d172f..966b92282a6 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QBORE3D.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QBORE3D.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: QBORE3D http://www.doc.ic.ac.uk/~im/ -* Generated-by: http://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP +* Description: QBORE3D https://www.doc.ic.ac.uk/~im/ +* Generated-by: https://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP * Derivatives: none NAME BORE3D ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QCAPRI.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QCAPRI.mps index bdf64319be2..cecd01701f7 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QCAPRI.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QCAPRI.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: QCAPRI http://www.doc.ic.ac.uk/~im/ -* Generated-by: http://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP +* Description: QCAPRI https://www.doc.ic.ac.uk/~im/ +* Generated-by: https://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP * Derivatives: none NAME CAPRI ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QRECIPE.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QRECIPE.mps index b38a5944b85..81306a3cfc8 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/QRECIPE.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/QRECIPE.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: QRECIPE http://www.doc.ic.ac.uk/~im/ -* Generated-by: http://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP +* Description: QRECIPE https://www.doc.ic.ac.uk/~im/ +* Generated-by: https://www.doc.ic.ac.uk/%7Eim/QPDATA2.ZIP * Derivatives: none NAME RECIPE ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit1d.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit1d.mps index 65e0935866b..dee88708b9a 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit1d.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit1d.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: http://www.netlib.org/lp/data/ -* Generated-by: +* Description: https://www.netlib.org/lp/data/ +* Generated-by: * Derivatives: none NAME FIT1D ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit2d.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit2d.mps index aeacd42c629..c63185ec865 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit2d.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/fit2d.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: http://www.netlib.org/lp/data/ -* Generated-by: +* Description: https://www.netlib.org/lp/data/ +* Generated-by: * Derivatives: none NAME FIT2D ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/additional/scsd1.mps b/QP_solver/test/QP_solver/test_solver_data/masters/additional/scsd1.mps index 5766d6427fe..83cc8430687 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/additional/scsd1.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/additional/scsd1.mps @@ -1,6 +1,6 @@ * Number-type: floating-point -* Description: http://www.netlib.org/lp/data/ -* Generated-by: +* Description: https://www.netlib.org/lp/data/ +* Generated-by: * Derivatives: none NAME SCSD1 ROWS diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/HS118.mps b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/HS118.mps index 875d0b3c931..4f6af9720da 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/HS118.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/HS118.mps @@ -1,5 +1,5 @@ -* Description: from the benchmarks at http://www.doc.ic.ac.uk/~im/ -NAME HS118 +* Description: from the benchmarks at https://www.doc.ic.ac.uk/~im/ +NAME HS118 ROWS N OBJ.FUNC G R------1 diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/PRIMALC1.mps b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/PRIMALC1.mps index f0846c3402f..24aca9bb682 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/PRIMALC1.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/PRIMALC1.mps @@ -1,6 +1,6 @@ -* Description: from the benchmarks at http://www.doc.ic.ac.uk/~im/ +* Description: from the benchmarks at https://www.doc.ic.ac.uk/~im/ * Derivatives: none -NAME PRIMALC1 +NAME PRIMALC1 ROWS N OBJ.FUNC L R------1 diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/QPTEST.mps b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/QPTEST.mps index fb89b43794b..3b8f8bc546c 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/QPTEST.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/QPTEST.mps @@ -1,4 +1,4 @@ -* Description: from the benchmarks at http://www.doc.ic.ac.uk/~im/ +* Description: from the benchmarks at https://www.doc.ic.ac.uk/~im/ NAME QP example ROWS N obj diff --git a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/ZECEVIC2.mps b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/ZECEVIC2.mps index 2d2e36a96e6..a42199f6137 100644 --- a/QP_solver/test/QP_solver/test_solver_data/masters/cgal/ZECEVIC2.mps +++ b/QP_solver/test/QP_solver/test_solver_data/masters/cgal/ZECEVIC2.mps @@ -1,5 +1,5 @@ -* Description: from the benchmarks at http://www.doc.ic.ac.uk/~im/ -NAME ZECEVIC2 +* Description: from the benchmarks at https://www.doc.ic.ac.uk/~im/ +NAME ZECEVIC2 ROWS N OBJ.FUNC L R------1 diff --git a/SMDS_3/include/CGAL/IO/File_avizo.h b/SMDS_3/include/CGAL/IO/File_avizo.h index 6ad6530ceaa..674b9c1d9cd 100644 --- a/SMDS_3/include/CGAL/IO/File_avizo.h +++ b/SMDS_3/include/CGAL/IO/File_avizo.h @@ -15,17 +15,112 @@ #include - #include +#include + #include #include +#include +#include +#include +#include + +#include + #include #include namespace CGAL { +// --------------------------------- +// Output C3t3 to Avizo tetra file format +// --------------------------------- + namespace IO { +namespace internal { + + //a material is composed of an material Id and a material name. + typedef std::pair material; + + struct MaterialData + { + material innerRegion; + material outerRegion; + }; + + template + bool get_material_metadata(std::istream& input, + std::string& line, + material& _material, + MaterialIdType material_id) + { + std::istringstream iss; + iss.str(line); + + iss >> _material.second;//name + + while (std::getline(input, line)) + { + std::string prop; //property + iss.clear(); + iss.str(line); + iss >> prop; + + if (prop.compare("Id") == 0) + { + int tmp_id; + iss >> tmp_id; + _material.first = material_id; + + std::string mat = _material.second; + boost::algorithm::to_lower(mat); + if ((0 == mat.compare("exterior")) + && _material.first != 0) + { + std::cerr << "Exterior should have index 0. "; + std::cerr << "In this file it has index " << _material.first << "." << std::endl; + std::cerr << "Reader failed, because Meshing will fail to terminate." << std::endl; + return false; + } + } + else if (prop.compare("}") == 0) + return true; //end of this material + } + return false; + } + + bool line_starts_with(const std::string& line, const char* cstr) + { + const std::size_t fnws = line.find_first_not_of(" \t"); + if (fnws != std::string::npos) + return (line.compare(fnws, strlen(cstr), cstr) == 0); + return false; + } + + template + bool treat_surf_materials(std::istream& input, + std::vector& materials, + IdType& material_id) + { + std::string line; + while (std::getline(input, line)) + { + if (line_starts_with(line, "}")) + break; + else + { + material _material; + if (!get_material_metadata(input, line, _material, material_id++)) + return false; + materials.push_back(_material); + } + } + return true; + } + +} + /** * @ingroup PkgSMDS3ExportFunctions * @brief exports a mesh complex to the Avizo (`.am`) file format @@ -144,12 +239,297 @@ output_to_avizo(std::ostream& os, } // end output_to_avizo(...) -} // end namespace IO #ifndef CGAL_NO_DEPRECATED_CODE using IO::output_to_avizo; #endif +// --------------------------------- +// Read C3t3 from Avizo file format +// --------------------------------- + +namespace internal { + template + void read_points(std::istream& input, + std::vector& points, + const int& nb_points, + const bool binary) + { + points.clear(); + points.reserve(nb_points); + + if (binary) + { + std::vector data(3 * nb_points); + input.read(reinterpret_cast(&data[0]), + 3 * nb_points * sizeof(float)); + for (int i = 0; i < nb_points; ++i) + points.push_back(Point_3(data[3 * i], data[3 * i + 1], data[3 * i + 2])); + } + else + { + for (int i = 0; i < nb_points; ++i) + { + float x, y, z; + input >> x >> y >> z; + points.push_back(Point_3(x, y, z)); + } + } + } + + void read_tetrahedra(std::istream& input, + std::vector >& tetrahedra, + const int& nb_tets, + const bool binary) + { + tetrahedra.clear(); + tetrahedra.reserve(nb_tets); + + if (binary) + { + std::vector data(4 * nb_tets); + input.read(reinterpret_cast(&data[0]), + 4 * nb_tets * sizeof(int)); + for (int i = 0; i < nb_tets; ++i) + { + tetrahedra.push_back({ data[4 * i] - 1, + data[4 * i + 1] - 1, + data[4 * i + 2] - 1, + data[4 * i + 3] - 1 }); + } + } + else + { + for (int n = 0; n < nb_tets; ++n) + { + int i, j, k, l; + input >> i >> j >> k >> l; + tetrahedra.push_back({ {i - 1, + j - 1, + k - 1, + l - 1} }); + } + } + } + + template + void read_materials(std::istream& input, + std::vector& materials, + const int& nb_tets, + const bool binary) + { + materials.clear(); + materials.reserve(nb_tets); + + if (binary) + { + std::vector data(nb_tets); + input.read(reinterpret_cast(&data[0]), + nb_tets * sizeof(Material_type)); + for (int i = 0; i < nb_tets; ++i) + materials.push_back(data[i]); + } + else + { + for (int i = 0; i < nb_tets; ++i) + { + Material_type m; + input >> m; + materials.push_back(m); + } + } + } + + + struct Data_def + { + std::string name; + std::string type; + std::string description; + std::string at_label; + }; + + void go_to_at_label(std::istream& input, + std::string& line, + const char* at_label)// "@1" + { + if (line_starts_with(line, at_label)) + return; + + while (std::getline(input, line)) + { + if (line_starts_with(line, at_label)) + return; + } + } + + bool is_avizo_tetra_format(std::istream& in, const char* binary_or_ascii) + { + std::string format(binary_or_ascii); + boost::algorithm::to_lower(format); + + std::string line; + while (std::getline(in, line)) + { + if (line.find("# AmiraMesh") != std::string::npos + || line.find("# Avizo 3D") != std::string::npos) + { + std::cout << "Amira format : " << line << std::endl; + boost::algorithm::to_lower(line); + + return line.find(format.c_str()) != std::string::npos; + } + } + return false; + } + + template + bool read_tetra_am(std::istream& input, Tr& tr) + { + using Material_type = unsigned char; + using Point_3 = typename Tr::Geom_traits::Point_3; + + int n_nodes, n_tets, n_edges; + std::vector data; + std::vector materials; //material = std::pair + + Material_type material_id = 0;//byte + bool materials_done = false; + + std::vector points; + std::vector > tetrahedra; + std::vector labels; + + bool binary = true; + + std::string line; + while (std::getline(input, line)) + { + if (line.find("# AmiraMesh") != std::string::npos + || line.find("# Avizo 3D") != std::string::npos) + { + std::cout << "Amira format : " << line << std::endl; + boost::algorithm::to_lower(line); + if (line.find("ascii") != std::string::npos) + binary = false; + + continue; + } + if (line_starts_with(line, "nNodes")) + { + std::string nnodes; + std::istringstream iss; + iss.str(line); + iss >> nnodes >> n_nodes; + } + else if (line_starts_with(line, "nTetrahedra")) + { + std::string ntetra; + std::istringstream iss; + iss.str(line); + iss >> ntetra >> n_tets; + } + else if (line_starts_with(line, "nEdges")) + { + std::string nedges; + std::istringstream iss; + iss.str(line); + iss >> nedges >> n_edges; + } + else if (!materials_done && line.find("Materials") != std::string::npos) + { + if (!IO::internal::treat_surf_materials(input, materials, material_id)) + return false; + materials_done = true; + } + else if (line_starts_with(line, "Nodes")) + { + //Nodes { float[3] Coordinates } @1 + Data_def d; + d.name = "Nodes"; + d.type = "float[3]"; + d.description = "Coordinates"; + + std::size_t i = line.find("@"); + d.at_label = line.substr(i); + + data.push_back(d); + } + else if (line_starts_with(line, "Tetrahedra")) + { + //Tetrahedra{ int[4] Nodes } @3 + Data_def d; + d.name = "Tetrahedra"; + d.type = "int[4]"; + d.description = "Nodes"; + + std::size_t i = line.find("@"); + d.at_label = line.substr(i); + + data.push_back(d); + } + else if (line_starts_with(line, "TetrahedronData")) + { + //TetrahedronData{ byte Materials } @4 + Data_def d; + d.name = "TetrahedronData"; + d.type = "byte"; + d.description = "Materials"; + + std::size_t i = line.find("@"); + d.at_label = line.substr(i); + + data.push_back(d); + } + else if (line.find("Data section follows") != std::string::npos) + { + std::getline(input, line); + for (auto d : data) + { + go_to_at_label(input, line, d.at_label.c_str()); + CGAL_assertion(line_starts_with(line, d.at_label.c_str())); + + if (d.name.compare("Nodes") == 0) + read_points(input, points, n_nodes, binary); + else if (d.name.compare("Tetrahedra") == 0) + read_tetrahedra(input, tetrahedra, n_tets, binary); + else if (d.name.compare("TetrahedronData") == 0) + read_materials(input, labels, n_tets, binary); + } + } + } + + boost::unordered_map, + typename Tr::Cell::Surface_patch_index> empty_facets_map; + + CGAL::SMDS_3::build_triangulation_with_subdomains_range(tr, + points, + tetrahedra, + labels, + empty_facets_map, + true,//verbose + false,//replace subdomain 0 + true);//allow non manifold + + return true; + } + +}// end namespace internal + + + template + bool read_AVIZO_TETRA(std::istream& in, T3& tr) + { + if (!in) + { + std::cerr << "Cannot open file " << std::endl; + return false; + } + return CGAL::IO::internal::read_tetra_am(in, tr); + } + +} // end namespace IO + } // end namespace CGAL #endif // CGAL_IO_FILE_AVIZO_H diff --git a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h index 3ab95555707..4bbe0d3caf0 100644 --- a/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h +++ b/SMDS_3/include/CGAL/Mesh_complex_3_in_triangulation_3.h @@ -1461,7 +1461,7 @@ public: private: // Sequential: non-atomic // "dummy" is here to allow the specialization (see below) - // See http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/285ab1eec49e1cb6 + // See https://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/285ab1eec49e1cb6 template struct Number_of_elements { diff --git a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h index c5e450289a1..0e4e8901ce5 100644 --- a/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h +++ b/SMDS_3/include/CGAL/SMDS_3/internal/indices_management.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ struct Index_generator typedef Index type; }; -template ::value> +template ::value> struct Indices_tuple_generator { using type = std::tuple const T& get_index(const T& x) { return x; } template ::value> + bool has_feature = ::CGAL::internal::Has_features::value> struct Read_mesh_domain_index { // here we have has_feature==true @@ -180,7 +180,7 @@ struct Read_mesh_domain_index { // Read_mesh_domain_index template ::value> + bool has_feature = ::CGAL::internal::Has_features::value> struct Write_mesh_domain_index { // here we have has_feature==true 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 812bc87214c..17d9759018b 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 @@ -50,7 +50,7 @@ void build_vertices(Tr& tr, std::vector& vertex_handle_vector) { typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Point Point; + typedef typename Tr::Point Point; vertex_handle_vector[0] = tr.tds().create_vertex(); // creates the infinite vertex tr.set_infinite_vertex(vertex_handle_vector[0]); @@ -398,6 +398,8 @@ bool build_triangulation_impl(Tr& tr, const bool replace_domain_0,// = false, const bool allow_non_manifold) // = false { + if (verbose) + std::cout << "build_triangulation_impl()..." << std::endl; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; typedef std::array Facet_vvv; @@ -430,22 +432,28 @@ bool build_triangulation_impl(Tr& tr, if (!finite_cells.empty()) { if (!CGAL::SMDS_3::build_finite_cells(tr, finite_cells, subdomains, vertex_handle_vector, incident_cells_map, - border_facets, verbose, replace_domain_0)) + border_facets, verbose, replace_domain_0)) { - if(verbose) std::cout << "build_finite_cells went wrong" << std::endl; + if (verbose) std::cout << "build_finite_cells went wrong" << std::endl; success = false; } + else + std::cout << "build finite cells done" << std::endl; if (!CGAL::SMDS_3::build_infinite_cells(tr, incident_cells_map, verbose, allow_non_manifold)) { if(verbose) std::cout << "build_infinite_cells went wrong" << std::endl; success = false; } + else + std::cout << "build infinite cells done" << std::endl; tr.tds().set_dimension(3); if (!CGAL::SMDS_3::assign_neighbors(tr, incident_cells_map, allow_non_manifold)) { if(verbose) std::cout << "assign_neighbors went wrong" << std::endl; success = false; } + else + std::cout << "assign neighbors done" << std::endl; if (verbose) { std::cout << "built triangulation : " << std::endl; diff --git a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h index 15a4b1fd3eb..ee49f572236 100644 --- a/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h +++ b/SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -94,7 +93,7 @@ public: // ACCESS FUNCTIONS Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); return V[i]; } @@ -117,13 +116,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -146,15 +145,15 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } // SETTING void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -166,10 +165,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; @@ -197,7 +196,7 @@ public: // but there's not much we can do for this now. void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } diff --git a/SMDS_3/package_info/SMDS_3/dependencies b/SMDS_3/package_info/SMDS_3/dependencies index 41ea78306d3..bebf22165bb 100644 --- a/SMDS_3/package_info/SMDS_3/dependencies +++ b/SMDS_3/package_info/SMDS_3/dependencies @@ -20,10 +20,10 @@ Polygon_mesh_processing Profiling_tools Property_map Random_numbers +SMDS_3 STL_Extension Spatial_sorting Stream_support -SMDS_3 TDS_3 Triangulation_3 Union_find diff --git a/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp b/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp index 54c31079acf..851e8fe38c6 100644 --- a/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp +++ b/SMDS_3/test/SMDS_3/test_c3t3_extract_subdomains_boundaries.cpp @@ -68,7 +68,7 @@ int main() v.push_back(f1); v.push_back(f2); // Domain (Warning: Sphere_3 constructor uses square radius !) - Mesh_domain domain(Function_wrapper(v), K::Sphere_3(CGAL::ORIGIN, 5.*5.), 1e-6); + Mesh_domain domain(CGAL::parameters::function = Function_wrapper(v), CGAL::parameters::bounding_object = K::Sphere_3(CGAL::ORIGIN, 5.*5.), relative_error_bound = 1e-6); // Set mesh criteria Facet_criteria facet_criteria(30, 0.2, 0.02); // angle, size, approximation diff --git a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h index 98a1af5ceb6..dd409ee8f02 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h @@ -672,7 +672,7 @@ bool owns(const_iterator pos); /*! * returns whether `pos` is in the range `[cc.begin(), cc`.end())` (`cc.end()` excluded). */ -bool owns_dereferencable(const_iterator pos); +bool owns_dereferenceable(const_iterator pos); /// @} diff --git a/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h b/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h index 65e853f489a..306595daf1e 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Concurrent_compact_container.h @@ -293,8 +293,8 @@ complexity. No exception is thrown. /// @{ /// returns whether `pos` is in the range `[ccc.begin(), ccc.end()]` (`ccc.end()` included). bool owns(const_iterator pos); - /// returns whether `pos` is in the range `[ccc.begin(), ccc`.end())` (`ccc.end()` excluded). - bool owns_dereferencable(const_iterator pos); + /// returns whether `pos` is in the range `[ccc.begin(), ccc.end())` (`ccc.end()` excluded). + bool owns_dereferenceable(const_iterator pos); /// @} diff --git a/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h b/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h index 6ce33c5bd9d..d5dc49c9d13 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h +++ b/STL_Extension/doc/STL_Extension/CGAL/In_place_list.h @@ -723,7 +723,7 @@ void unique(); /*! merges the list `ipl2` into the list `ipl` and `ipl2` becomes empty. It is stable. -\pre Both lists are increasingly sorted. A suitable `operator<` for the type `T`. +\pre Both lists are sorted in increasing order by means of a suitable `operator<` for the type `T`. */ void merge(In_place_list& ipl2); diff --git a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h index a892f2f7702..a81cabb29ea 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Multiset.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Multiset.h @@ -69,12 +69,6 @@ less-than operator (`operator<`). \tparam Allocator the allocator type. `CGAL_ALLOCATOR` is used by default. -\cgalHeading{Assertions} - -The assertion and precondition flags for the `Multiset` class -use `MULTISET` in their names (i.e., `CGAL_MULTISET_NO_ASSERTIONS` and -`CGAL_MULTISET_NO_PRECONDITIONS`). - \cgalHeading{Implementation} `Multiset` uses a proprietary implementation of a red-black tree diff --git a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h index 7536f029c71..2250a4a3e93 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/algorithm.h +++ b/STL_Extension/doc/STL_Extension/CGAL/algorithm.h @@ -2,32 +2,6 @@ /// \ingroup PkgSTLExtensionRef -namespace CGAL { - -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated, std::copy_n should be -used instead. - -Copies the first `n` items from `first` to `result`. - -\returns the value of `result` after inserting the `n` items. - -\note The \stl release June 13, 1997, from SGI contains an equivalent -function, but it is not part of the ISO standard. - -\sa `CGAL::Counting_iterator` - -copies - -*/ -template OutputIterator copy_n(InputIterator first, Size n, -OutputIterator result); - -} /* namespace CGAL */ - namespace CGAL { /*! @@ -35,16 +9,17 @@ namespace CGAL { Computes the minimal and the -maximal element of a range. It is modeled after the STL functions -`std::min_element` and `std::max_element`. The advantage of -`min_max_element` compared to calling both STL functions is that +maximal element of a range. It is modeled after the \stl functions +`std::min_element` +and `std::max_element`. +The advantage of `min_max_element()` compared to calling both \stl functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. \cgalHeading{Example} The following example program computes the minimal and -maximal element of the sequence ` (3,\,6,\,5)`. Hence the output is +maximal element of the sequence `(3,\,6,\,5)`. Hence the output is `min = 3, max = 6`. \cgalExample{STL_Extension/min_max_element_example.cpp} @@ -64,9 +39,11 @@ first, ForwardIterator last); \ingroup STLAlgos Computes the minimal and the -maximal element of a range. It is modeled after the STL functions -`std::min_element` and `std::max_element`. The advantage of -`min_max_element` compared to calling both STL functions is that +maximal element of a range. It is modeled after the \stl functions +`std::min_element` +and `std::max_element`. +The advantage of `min_max_element()` compared to calling both \stl functions is that one only iterates once over the sequence. This is more efficient especially for large and/or complex sequences. @@ -90,54 +67,18 @@ CompareMin comp_min, CompareMax comp_max); } /* namespace CGAL */ -namespace CGAL { - -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated. `std::prev` should be used -instead. - -Returns the previous iterator, -i.e.\ the result of `operator--` on a bidirectional iterator. - -\sa `CGAL::successor()` - -\returns `--it`. -*/ -template -BidirectionalIterator predecessor(BidirectionalIterator it); - -} /* namespace CGAL */ namespace CGAL { -/*! -\ingroup STLAlgos - -\deprecated This function is deprecated. `std::next` should be used -instead. - - -Returns the next iterator, i.e. -the result of `operator++` on a forward iterator. - - -\sa `CGAL::predecessor()` - -\returns `++it`. -*/ -template -ForwardIterator successor(ForwardIterator it); namespace cpp98 { /*! \ingroup STLAlgos -Replacement for `std::random_shuffle()` +Replacement for `std::random_shuffle` which was deprecated in C++14, and removed by C++17. -In the \stl it was replaced by `std::shuffle()`. +In the \stl it was replaced by `std::shuffle`. \note The implementation in \cgal produces the same order on all platforms. */ @@ -149,9 +90,9 @@ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end, /*! \ingroup STLAlgos -Replacement for `std::random_shuffle()` +Replacement for `std::random_shuffle` which was deprecated in C++14, and removed by C++17. -In the \stl it was replaced by `std::shuffle()`. +In the \stl it was replaced by `std::shuffle`. \note The implementation in \cgal produces the same order on all platforms. */ @@ -161,4 +102,3 @@ random_shuffle(RandomAccessIterator begin, RandomAccessIterator end); } // namespace cpp98 } /* namespace CGAL */ - diff --git a/STL_Extension/doc/STL_Extension/CGAL/iterator.h b/STL_Extension/doc/STL_Extension/CGAL/iterator.h index feab1826f47..fdc82bb1ffd 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/iterator.h +++ b/STL_Extension/doc/STL_Extension/CGAL/iterator.h @@ -61,8 +61,6 @@ from input iterators. `Iterator` is a model for `InputIterator`. -\sa `CGAL::copy_n()` - */ template< typename Iterator, typename Value > @@ -120,7 +118,7 @@ must be a subset of the parameters of `V`. Should the \cgalModels `OutputIterator` -cgalExample{STL_Extension/Dispatch_output_iterator.cpp} +\cgalExample{STL_Extension/Dispatch_output_iterator.cpp} \sa `CGAL::Dispatch_output_iterator` */ diff --git a/STL_Extension/doc/STL_Extension/PackageDescription.txt b/STL_Extension/doc/STL_Extension/PackageDescription.txt index a4df6c9b0bb..552378e03e6 100644 --- a/STL_Extension/doc/STL_Extension/PackageDescription.txt +++ b/STL_Extension/doc/STL_Extension/PackageDescription.txt @@ -41,10 +41,8 @@ - `CGAL::Multiset` \cgalCRPSection{Generic Algorithms} -- `CGAL::copy_n` - `CGAL::min_max_element` -- `CGAL::predecessor` -- `CGAL::successor` +- `CGAL::cpp98::random_shuffle` \cgalCRPSection{Iterators and Iterator/Circulator Adaptors} - `CGAL::Dispatch_output_iterator` diff --git a/STL_Extension/doc/STL_Extension/STL_Extension.txt b/STL_Extension/doc/STL_Extension/STL_Extension.txt index 584f04e4bec..947faab8ba2 100644 --- a/STL_Extension/doc/STL_Extension/STL_Extension.txt +++ b/STL_Extension/doc/STL_Extension/STL_Extension.txt @@ -393,3 +393,35 @@ void foo() */ } /* namespace CGAL */ +/*! +\page FromBoostNPtoCGALNP Upgrading Code using \boost Parameters to \cgal Named Function Parameters + +Prior to \cgal 5.6, some packages were using Boost parameters to provide a user friendly +way to set parameters of classes and functions. In an attempt to remove a dependency and +to get a more uniform API accross packages, these packages have been updated to now use +\cgal \ref bgl_namedparameters inspired by the function named parameters from +the \boost graph library. In practice this means that the following call: +\code +Mesh_criteria criteria(edge_size = 8, + facet_angle = 25, + facet_size = 8, + facet_distance = 0.2, + cell_radius_edge_ratio = 3, + cell_size = 10); +\endcode +should now be written as follows: +\code +Mesh_criteria criteria(edge_size(8). + facet_angle(25). + facet_size(8). + facet_distance(0.2). + cell_radius_edge_ratio(3). + cell_size(10)); +\endcode + +Note that we have tried to preserve the backward compatibility by allowing previous API +to remain valid. However, if new parameters are introduced for those functions, there is +no guarantee that they will be ported to the old API. So we strongly encourage users to +upgrade to the new API. Additionally, passing parameters without names is deprecated +and even removed for some functions. +*/ \ No newline at end of file diff --git a/STL_Extension/doc/STL_Extension/dependencies b/STL_Extension/doc/STL_Extension/dependencies index cf8c5e176f3..e3e3864ed1f 100644 --- a/STL_Extension/doc/STL_Extension/dependencies +++ b/STL_Extension/doc/STL_Extension/dependencies @@ -4,3 +4,4 @@ Number_types Kernel_23 Miscellany Surface_mesh +BGL diff --git a/STL_Extension/doc/STL_Extension/examples.txt b/STL_Extension/doc/STL_Extension/examples.txt index f26952e7154..fa7b81093ef 100644 --- a/STL_Extension/doc/STL_Extension/examples.txt +++ b/STL_Extension/doc/STL_Extension/examples.txt @@ -1,5 +1,6 @@ /*! \example STL_Extension/Default.cpp +\example STL_Extension/Dispatch_output_iterator.cpp \example STL_Extension/in_place_list_prog.cpp \example STL_Extension/min_element_if_example.cpp \example STL_Extension/min_max_element_example.cpp diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 93a6debd770..b8c1cb0769c 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -537,11 +537,17 @@ public: return false; } - bool owns_dereferencable(const_iterator cit) const + bool owns_dereferenceable(const_iterator cit) const { return cit != end() && owns(cit); } + + CGAL_DEPRECATED bool owns_dereferencable(const_iterator cit) const + { + return owns_dereferenceable(cit); + } + /** Reserve method to ensure that the capacity of the Compact_container be * greater or equal than a given value n. */ diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 6bbdeee9176..395f8a483f4 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -542,11 +542,16 @@ public: return false; } - bool owns_dereferencable(const_iterator cit) const + bool owns_dereferenceable(const_iterator cit) const { return cit != end() && owns(cit); } + CGAL_DEPRECATED bool owns_dereferencable(const_iterator cit) const + { + return owns_dereferenceable(cit); + } + /** Reserve method to ensure that the capacity of the Concurrent_compact_container be * greater or equal than a given value n. */ diff --git a/STL_Extension/include/CGAL/Handle.h b/STL_Extension/include/CGAL/Handle.h index 4fa3a17286b..55634481044 100644 --- a/STL_Extension/include/CGAL/Handle.h +++ b/STL_Extension/include/CGAL/Handle.h @@ -122,7 +122,7 @@ class Handle int refs() const noexcept { return PTR->count.load(std::memory_order_relaxed); } - Id_type id() const noexcept { return PTR - static_cast(0); } + Id_type id() const noexcept { return static_cast(reinterpret_cast(static_cast(PTR)) / sizeof(Rep)); } bool identical(const Handle& h) const noexcept { return PTR == h.PTR; } diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index 2a93662e69b..2f05c6be1ce 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -30,7 +30,7 @@ #if defined(BOOST_MSVC) # pragma warning(push) -# pragma warning(disable:4345) // Avoid warning http://msdn.microsoft.com/en-us/library/wewb47ee(VS.80).aspx +# pragma warning(disable:4345) // Avoid warning https://learn.microsoft.com/en-us/previous-versions/wewb47ee(v=vs.120) #endif namespace CGAL { diff --git a/STL_Extension/include/CGAL/In_place_list.h b/STL_Extension/include/CGAL/In_place_list.h index 9c99f2e9a8f..246453abeab 100644 --- a/STL_Extension/include/CGAL/In_place_list.h +++ b/STL_Extension/include/CGAL/In_place_list.h @@ -575,14 +575,14 @@ public: void merge(Self& x); // merges the list x into the list `l' and x becomes empty. It is - // stable. Precondition: Both lists are increasingly sorted. A - // suitable `operator<' for the type T. + // stable. Precondition: Both lists are sorted in increasing order + // by means of a suitable `operator<` for the type `T`. template < class StrictWeakOrdering > void merge(Self& x, StrictWeakOrdering ord) // merges the list x into the list `l' and x becomes empty. // It is stable. - // Precondition: Both lists are increasingly sorted wrt. ord. + // Precondition: Both lists are sorted in increasing order wrt. `ord`. { iterator first1 = begin(); iterator last1 = end(); diff --git a/STL_Extension/include/CGAL/Multiset.h b/STL_Extension/include/CGAL/Multiset.h index 96b6bcc612b..9382923dbc6 100644 --- a/STL_Extension/include/CGAL/Multiset.h +++ b/STL_Extension/include/CGAL/Multiset.h @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -168,7 +167,7 @@ protected: Node* predecessor () const { // The DUMMY_BEGIN node has no predecessor. - CGAL_multiset_assertion (color != DUMMY_BEGIN); + CGAL_assertion (color != DUMMY_BEGIN); Node *predP; @@ -203,7 +202,7 @@ protected: Node* successor () const { // The DUMMY_END node has no successor. - CGAL_multiset_assertion (color != DUMMY_END); + CGAL_assertion (color != DUMMY_END); Node *succP; @@ -346,7 +345,7 @@ public: /*! Increment operator (prefix notation). */ iterator& operator++ () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -355,7 +354,7 @@ public: /*! Increment operator (postfix notation). */ iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); iterator temp = *this; @@ -366,7 +365,7 @@ public: /*! Decrement operator (prefix notation). */ iterator& operator-- () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -375,7 +374,7 @@ public: /*! Decrement operator (postfix notation). */ iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); iterator temp = *this; @@ -388,7 +387,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -398,7 +397,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -461,7 +460,7 @@ public: /*! Increment operator (prefix notation). */ const_iterator& operator++ () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -470,7 +469,7 @@ public: /*! Increment operator (postfix notation). */ const_iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -481,7 +480,7 @@ public: /*! Decrement operator (prefix notation). */ const_iterator& operator-- () { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -490,7 +489,7 @@ public: /*! Decrement operator (postfix notation). */ const_iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != nullptr); + CGAL_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -503,7 +502,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -513,7 +512,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); + CGAL_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -1956,7 +1955,7 @@ Multiset::insert (iterator positi { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); // Compare the object to the one stored at the given node in order to decide // in which direction to proceed. @@ -2033,7 +2032,7 @@ Multiset::insert_after (iterator Node *nodeP = position.nodeP; // In case we are given a nullptr node, object should be the tree minimum. - CGAL_multiset_assertion (nodeP != &endNode); + CGAL_assertion (nodeP != &endNode); if (nodeP == &beginNode) nodeP = nullptr; @@ -2042,7 +2041,7 @@ Multiset::insert_after (iterator { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == nullptr); + CGAL_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node (object, Node::BLACK); @@ -2070,7 +2069,7 @@ Multiset::insert_after (iterator // child of the current minimal leaf. parentP = beginNode.parentP; - CGAL_multiset_precondition (comp_f(object, parentP->object) != LARGER); + CGAL_precondition (comp_f(object, parentP->object) != LARGER); parentP->leftP = newNodeP; @@ -2081,9 +2080,9 @@ Multiset::insert_after (iterator else { // Make sure the insertion does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succP = nodeP->successor()); - CGAL_multiset_precondition (comp_f(object, nodeP->object) != SMALLER); - CGAL_multiset_precondition (! _succP->is_valid() || + CGAL_precondition_code (Node *_succP = nodeP->successor()); + CGAL_precondition (comp_f(object, nodeP->object) != SMALLER); + CGAL_precondition (! _succP->is_valid() || comp_f(object, _succP->object) != LARGER); // In case given node has no right child, place the new node as its @@ -2131,7 +2130,7 @@ Multiset::insert_before (iterator Node *nodeP = position.nodeP; // In case we are given a nullptr node, object should be the tree maximum. - CGAL_multiset_assertion (nodeP != &beginNode); + CGAL_assertion (nodeP != &beginNode); if (nodeP == &endNode) nodeP = nullptr; @@ -2140,7 +2139,7 @@ Multiset::insert_before (iterator { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == nullptr); + CGAL_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node(object, Node::BLACK); @@ -2168,7 +2167,7 @@ Multiset::insert_before (iterator // child of the current maximal leaf. parentP = endNode.parentP; - CGAL_multiset_precondition (comp_f(object, parentP->object) != SMALLER); + CGAL_precondition (comp_f(object, parentP->object) != SMALLER); parentP->rightP = newNodeP; @@ -2179,9 +2178,9 @@ Multiset::insert_before (iterator else { // Make sure the insertion does not violate the tree order. - CGAL_multiset_precondition_code (Node *_predP = nodeP->predecessor()); - CGAL_multiset_precondition (comp_f(object, nodeP->object) != LARGER); - CGAL_multiset_precondition (! _predP->is_valid() || + CGAL_precondition_code (Node *_predP = nodeP->predecessor()); + CGAL_precondition (comp_f(object, nodeP->object) != LARGER); + CGAL_precondition (! _predP->is_valid() || comp_f(object, _predP->object) != SMALLER); // In case given node has no left child, place the new node as its @@ -2258,7 +2257,7 @@ void Multiset::erase (iterator po { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); _remove_at (nodeP); return; @@ -2294,16 +2293,16 @@ void Multiset::replace (iterator { Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); // Make sure the replacement does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succP = nodeP->successor()); - CGAL_multiset_precondition (_succP == nullptr || + CGAL_precondition_code (Node *_succP = nodeP->successor()); + CGAL_precondition (_succP == nullptr || _succP->color == Node::DUMMY_END || comp_f(object, _succP->object) != LARGER); - CGAL_multiset_precondition_code (Node *_predP = nodeP->predecessor()); - CGAL_multiset_precondition (_predP == nullptr || + CGAL_precondition_code (Node *_predP = nodeP->predecessor()); + CGAL_precondition (_predP == nullptr || _predP->color == Node::DUMMY_BEGIN || comp_f(object, _predP->object) != SMALLER); @@ -2323,30 +2322,30 @@ void Multiset::swap (iterator pos Node *node1_P = pos1.nodeP; Node *node2_P = pos2.nodeP; - CGAL_multiset_precondition (_is_valid (node1_P)); - CGAL_multiset_precondition (_is_valid (node2_P)); + CGAL_precondition (_is_valid (node1_P)); + CGAL_precondition (_is_valid (node2_P)); if (node1_P == node2_P) return; // Make sure the swap does not violate the tree order. - CGAL_multiset_precondition_code (Node *_succ1_P = node1_P->successor()); - CGAL_multiset_precondition (! _is_valid (_succ1_P) || + CGAL_precondition_code (Node *_succ1_P = node1_P->successor()); + CGAL_precondition (! _is_valid (_succ1_P) || comp_f (node2_P->object, _succ1_P->object) != LARGER); - CGAL_multiset_precondition_code (Node *_pred1_P = node1_P->predecessor()); - CGAL_multiset_precondition (! _is_valid (_pred1_P) || + CGAL_precondition_code (Node *_pred1_P = node1_P->predecessor()); + CGAL_precondition (! _is_valid (_pred1_P) || comp_f (node2_P->object, _pred1_P->object) != SMALLER); - CGAL_multiset_precondition_code (Node *_succ2_P = node2_P->successor()); - CGAL_multiset_precondition (! _is_valid (_succ2_P) || + CGAL_precondition_code (Node *_succ2_P = node2_P->successor()); + CGAL_precondition (! _is_valid (_succ2_P) || comp_f (node1_P->object, _succ2_P->object) != LARGER); - CGAL_multiset_precondition_code (Node *_pred2_P = node2_P->predecessor()); - CGAL_multiset_precondition (! _is_valid (_pred2_P) || + CGAL_precondition_code (Node *_pred2_P = node2_P->predecessor()); + CGAL_precondition (! _is_valid (_pred2_P) || comp_f (node1_P->object, _pred2_P->object) != SMALLER); @@ -2438,13 +2437,13 @@ void Multiset::catenate (Self& tr if (min2_P == nullptr) { // The other tree is empty - nothing to do. - CGAL_multiset_assertion (tree.rootP == nullptr); + CGAL_assertion (tree.rootP == nullptr); return; } else if (max1_P == nullptr) { // Our tree is empty: Copy all other tree properties to our tree. - CGAL_multiset_assertion (rootP == nullptr); + CGAL_assertion (rootP == nullptr); _shallow_assign (tree); return; @@ -2452,12 +2451,12 @@ void Multiset::catenate (Self& tr // Make sure that the minimal object in the other tree is not less than the // maximal object in our tree. - CGAL_multiset_precondition (comp_f (max1_P->object, + CGAL_precondition (comp_f (max1_P->object, min2_P->object) != LARGER); // Make sure both tree roots black. - CGAL_multiset_assertion (_is_black (rootP)); - CGAL_multiset_assertion (_is_black (tree.rootP)); + CGAL_assertion (_is_black (rootP)); + CGAL_assertion (_is_black (tree.rootP)); // Splice max1_P (or min2_P) from its tree, but without deleting it. Node* auxP = nullptr; @@ -2561,7 +2560,7 @@ void Multiset::catenate (Self& tr if (_is_red (node2_P)) node2_P = node2_P->leftP; - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node2_P)); } else { @@ -2578,7 +2577,7 @@ void Multiset::catenate (Self& tr if (_is_red (node1_P)) node1_P = node1_P->rightP; - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node2_P)); } // Check which one of the tree roots have we reached. @@ -2615,7 +2614,7 @@ void Multiset::catenate (Self& tr // moving auxP to be their parent. parentP = node1_P->parentP; - CGAL_multiset_assertion (parentP != nullptr); + CGAL_assertion (parentP != nullptr); // The catenated tree will be rooted at the current root of our tree. newRootP = rootP; @@ -2670,7 +2669,7 @@ template ::split (iterator position, Self& tree) { - CGAL_multiset_precondition (tree.empty()); + CGAL_precondition (tree.empty()); // Check the extremal cases. if (position == begin()) @@ -2691,7 +2690,7 @@ void Multiset::split (iterator po // is at most twice the black-height of the tree. Node *nodeP = position.nodeP; - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); Node *currP = nodeP; Comparison_result *path = new Comparison_result [2 * iBlackHeight]; @@ -2708,7 +2707,7 @@ void Multiset::split (iterator po currP = currP->parentP; } - CGAL_multiset_assertion (currP == rootP); + CGAL_assertion (currP == rootP); // Now go down the path and split the tree accordingly. We also keep // track of the black-height of the current node. @@ -2726,7 +2725,7 @@ void Multiset::split (iterator po while (depth >= 0) { - CGAL_multiset_assertion (_is_valid (currP)); + CGAL_assertion (_is_valid (currP)); // If we encounter a black node, the black-height of both its left and // right subtrees is decremented. @@ -2770,8 +2769,8 @@ void Multiset::split (iterator po else if (_is_valid (childP)) { // Catenate T_r with the current rightTree. - CGAL_multiset_assertion (_is_valid (spineRightP) && - _is_valid(auxRightP)); + CGAL_assertion (_is_valid (spineRightP) && + _is_valid(auxRightP)); // Make sure the root of T_r is black. size_t iCurrRightBHeight = iCurrBHeight; @@ -2784,7 +2783,7 @@ void Multiset::split (iterator po // Go down the leftmost path of rightTree until locating a black // node whose black height is exactly iCurrRightBHeight. - CGAL_multiset_assertion (iRightBHeight >= iCurrRightBHeight); + CGAL_assertion (iRightBHeight >= iCurrRightBHeight); while (iRightBHeight > iCurrRightBHeight) { @@ -2795,7 +2794,7 @@ void Multiset::split (iterator po if (_is_red (spineRightP)) spineRightP = spineRightP->leftP; - CGAL_multiset_assertion (_is_valid (spineRightP)); + CGAL_assertion (_is_valid (spineRightP)); // Use the auxiliary node and make it the parent of T_r (which // becomes its left sub-tree) and spineRightP (which becomes its @@ -2905,8 +2904,8 @@ void Multiset::split (iterator po else if (_is_valid (childP)) { // Catenate T_l with the current leftTree. - CGAL_multiset_assertion (_is_valid (spineLeftP) && - _is_valid(auxLeftP)); + CGAL_assertion (_is_valid (spineLeftP) && + _is_valid(auxLeftP)); // Make sure the root of T_l is black. size_t iCurrLeftBHeight = iCurrBHeight; @@ -2919,7 +2918,7 @@ void Multiset::split (iterator po // Go down the rightmost path of leftTree until locating a black // node whose black height is exactly iCurrLeftBHeight. - CGAL_multiset_assertion (iLeftBHeight >= iCurrLeftBHeight); + CGAL_assertion (iLeftBHeight >= iCurrLeftBHeight); while (iLeftBHeight > iCurrLeftBHeight) { @@ -2930,7 +2929,7 @@ void Multiset::split (iterator po if (_is_red (spineLeftP)) spineLeftP = spineLeftP->rightP; - CGAL_multiset_assertion (_is_valid (spineLeftP)); + CGAL_assertion (_is_valid (spineLeftP)); // Use the auxiliary node and make it the parent of T_l (which // becomes its right sub-tree) and spineLeftP (which becomes its @@ -3012,7 +3011,7 @@ void Multiset::split (iterator po // It is now possible to free the path. delete[] path; - CGAL_multiset_assertion (auxLeftP == nullptr && auxRightP == nodeP); + CGAL_assertion (auxLeftP == nullptr && auxRightP == nodeP); // Fix the properties of the left tree: We know its minimal node is the // same as the current minimum. @@ -3020,7 +3019,7 @@ void Multiset::split (iterator po leftTree.beginNode.parentP->leftP = &(leftTree.beginNode); // Traverse the rightmost path of the left tree to find the its maximum. - CGAL_multiset_assertion (_is_valid (spineLeftP)); + CGAL_assertion (_is_valid (spineLeftP)); while (_is_valid (spineLeftP->rightP)) spineLeftP = spineLeftP->rightP; @@ -3130,7 +3129,7 @@ void Multiset::_shallow_clear () template void Multiset::_remove_at (Node* nodeP) { - CGAL_multiset_precondition (_is_valid (nodeP)); + CGAL_precondition (_is_valid (nodeP)); if (nodeP == rootP && ! _is_valid (rootP->leftP) && ! _is_valid (rootP->rightP)) @@ -3155,7 +3154,7 @@ void Multiset::_remove_at (Node* // which is the leftmost child in its right sub-tree and has at most // one child (it may have a right child). Node *succP = _sub_minimum (nodeP->rightP); - CGAL_multiset_assertion (_is_valid (succP)); + CGAL_assertion (_is_valid (succP)); // Now physically swap nodeP and its successor. Notice this may temporarily // violate the tree properties, but we are going to remove nodeP anyway. @@ -3169,7 +3168,7 @@ void Multiset::_remove_at (Node* if (_is_valid (nodeP->leftP)) { - CGAL_multiset_assertion (! _is_valid (nodeP->rightP)); + CGAL_assertion (! _is_valid (nodeP->rightP)); childP = nodeP->leftP; } else @@ -3247,8 +3246,8 @@ template ::_swap (Node* node1_P, Node* node2_P) { - CGAL_multiset_assertion (_is_valid (node1_P)); - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node1_P)); + CGAL_assertion (_is_valid (node2_P)); // Store the properties of the first node. typename Node::Node_color color1 = node1_P->color; @@ -3388,8 +3387,8 @@ template ::_swap_siblings (Node* node1_P, Node* node2_P) { - CGAL_multiset_assertion (_is_valid (node1_P)); - CGAL_multiset_assertion (_is_valid (node2_P)); + CGAL_assertion (_is_valid (node1_P)); + CGAL_assertion (_is_valid (node2_P)); // Store the properties of the first node. typename Node::Node_color color1 = node1_P->color; @@ -3422,7 +3421,7 @@ void Multiset::_swap_siblings (No Node *parent_P = node1_P->parentP; Node *temp; - CGAL_multiset_assertion (parent_P == node2_P->parentP); + CGAL_assertion (parent_P == node2_P->parentP); temp = parent_P->leftP; parent_P->leftP = parent_P->rightP; @@ -3464,7 +3463,7 @@ template ::_sub_height (const Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Recursively calculate the heights of the left and right sub-trees. size_t iRightHeight = 0; @@ -3552,7 +3551,7 @@ template ::Node* Multiset::_sub_minimum (Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); Node *minP = nodeP; @@ -3568,7 +3567,7 @@ template ::Node* Multiset::_sub_maximum (Node* nodeP) const { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); Node *maxP = nodeP; @@ -3593,7 +3592,7 @@ void Multiset::_rotate_left (Node // Get the right child of the node. Node *yNodeP = xNodeP->rightP; - CGAL_multiset_assertion (_is_valid (yNodeP)); + CGAL_assertion (_is_valid (yNodeP)); // Change its left subtree (T2) to x's right subtree. xNodeP->rightP = yNodeP->leftP; @@ -3639,7 +3638,7 @@ void Multiset::_rotate_right (Nod // Get the left child of the node. Node *xNodeP = yNodeP->leftP; - CGAL_multiset_assertion (_is_valid (xNodeP)); + CGAL_assertion (_is_valid (xNodeP)); // Change its right subtree (T2) to y's left subtree. yNodeP->leftP = xNodeP->rightP; @@ -3683,7 +3682,7 @@ template ::Node* Multiset::_duplicate (const Node* nodeP) { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Create a node of the same color, containing the same object. Node *dupNodeP = _allocate_node(nodeP->object, nodeP->color); @@ -3711,7 +3710,7 @@ Multiset::_duplicate (const Node* template void Multiset::_destroy (Node* nodeP) { - CGAL_multiset_assertion (_is_valid (nodeP)); + CGAL_assertion (_is_valid (nodeP)); // Destroy the children recursively. if (_is_valid (nodeP->rightP)) @@ -3734,7 +3733,7 @@ void Multiset::_destroy (Node* no template void Multiset::_insert_fixup (Node* nodeP) { - CGAL_multiset_precondition (_is_red (nodeP)); + CGAL_precondition (_is_red (nodeP)); // Fix the red-black propreties: we may have inserted a red leaf as the // child of a red parent - so we have to fix the coloring of the parent @@ -3748,7 +3747,7 @@ void Multiset::_insert_fixup (Nod // Get a pointer to the current node's grandparent (notice the root is // always black, so the red parent must have a parent). grandparentP = currP->parentP->parentP; - CGAL_multiset_precondition (grandparentP != nullptr); + CGAL_precondition (grandparentP != nullptr); if (currP->parentP == grandparentP->leftP) { @@ -3781,7 +3780,7 @@ void Multiset::_insert_fixup (Nod // Color the parent black and the grandparent red. currP->parentP->color = Node::BLACK; - CGAL_multiset_assertion (grandparentP == currP->parentP->parentP); + CGAL_assertion (grandparentP == currP->parentP->parentP); grandparentP->color = Node::RED; // Right-rotate the grandparent's sub-tree @@ -3819,7 +3818,7 @@ void Multiset::_insert_fixup (Nod // Color the parent black and the grandparent red. currP->parentP->color = Node::BLACK; - CGAL_multiset_assertion(grandparentP == currP->parentP->parentP); + CGAL_assertion(grandparentP == currP->parentP->parentP); grandparentP->color = Node::RED; // Left-rotate the grandparent's sub-tree @@ -3873,7 +3872,7 @@ void Multiset::_remove_fixup (Nod siblingP = currParentP->rightP; } - CGAL_multiset_assertion (_is_valid (siblingP)); + CGAL_assertion (_is_valid (siblingP)); if (_is_black (siblingP->leftP) && _is_black (siblingP->rightP)) { @@ -3889,7 +3888,7 @@ void Multiset::_remove_fixup (Nod // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == nullptr); + CGAL_assertion (currParentP == nullptr); iBlackHeight--; } } @@ -3938,7 +3937,7 @@ void Multiset::_remove_fixup (Nod siblingP = currParentP->leftP; } - CGAL_multiset_assertion (_is_valid (siblingP)); + CGAL_assertion (_is_valid (siblingP)); if (_is_black (siblingP->leftP) && _is_black (siblingP->rightP)) { @@ -3954,7 +3953,7 @@ void Multiset::_remove_fixup (Nod // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == nullptr); + CGAL_assertion (currParentP == nullptr); iBlackHeight--; } } @@ -4011,8 +4010,8 @@ Multiset::_allocate_node (const Type& object, typename Node::Node_color color) { - CGAL_multiset_assertion (color != Node::DUMMY_BEGIN && - color != Node::DUMMY_END); + CGAL_assertion (color != Node::DUMMY_BEGIN && + color != Node::DUMMY_END); Node* new_node = node_alloc.allocate(beginNode); new_node->init(object, color); diff --git a/STL_Extension/include/CGAL/Named_function_parameters.h b/STL_Extension/include/CGAL/Named_function_parameters.h index bf7059b3ca9..243ed7b4be5 100644 --- a/STL_Extension/include/CGAL/Named_function_parameters.h +++ b/STL_Extension/include/CGAL/Named_function_parameters.h @@ -17,14 +17,18 @@ #endif #include +#include #include +#include #include #include #define CGAL_NP_TEMPLATE_PARAMETERS NP_T=bool, typename NP_Tag=CGAL::internal_np::all_default_t, typename NP_Base=CGAL::internal_np::No_property #define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT NP_T, typename NP_Tag, typename NP_Base +#define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT_1 NP_T1, typename NP_Tag1, typename NP_Base1 +#define CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT_2 NP_T2, typename NP_Tag2, typename NP_Base2 #define CGAL_NP_CLASS CGAL::Named_function_parameters #define CGAL_NP_TEMPLATE_PARAMETERS_1 NP_T1=bool, typename NP_Tag1=CGAL::internal_np::all_default_t, typename NP_Base1=CGAL::internal_np::No_property @@ -32,6 +36,8 @@ #define CGAL_NP_TEMPLATE_PARAMETERS_2 NP_T2=bool, typename NP_Tag2=CGAL::internal_np::all_default_t, typename NP_Base2=CGAL::internal_np::No_property #define CGAL_NP_CLASS_2 CGAL::Named_function_parameters +#define CGAL_NP_TEMPLATE_PARAMETERS_VARIADIC NP_T, typename ... NP_Tag, typename ... NP_Base + namespace CGAL { namespace internal_np{ @@ -43,8 +49,16 @@ enum all_default_t { all_default }; // define enum types and values for new named parameters #define CGAL_add_named_parameter(X, Y, Z) \ enum X { Y }; +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + enum X { Y }; +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + enum X { Y }; +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) #include #undef CGAL_add_named_parameter +#undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only +#undef CGAL_add_extra_named_parameter_with_compatibility template struct Named_params_impl : Base @@ -230,72 +244,17 @@ get_parameter_reference_impl(const Named_params_impl& np, Query_ta return get_parameter_reference_impl(static_cast(np), tag); } - } // end of internal_np namespace - template -struct Named_function_parameters - : internal_np::Named_params_impl -{ - typedef internal_np::Named_params_impl base; - typedef Named_function_parameters self; +struct Named_function_parameters; - Named_function_parameters() : base(T()) {} - Named_function_parameters(const T& v) : base(v) {} - Named_function_parameters(const T& v, const Base& b) : base(v, b) {} - -// create the functions for new named parameters and the one imported boost -// used to concatenate several parameters -#define CGAL_add_named_parameter(X, Y, Z) \ - template \ - Named_function_parameters \ - Z(const K& k) const \ - { \ - typedef Named_function_parameters Params;\ - return Params(k, *this); \ - } -#include -#undef CGAL_add_named_parameter -}; - -namespace parameters { +namespace parameters{ typedef Named_function_parameters Default_named_parameters; -#ifndef CGAL_NO_DEPRECATED_CODE Default_named_parameters -inline all_default() -{ - return Default_named_parameters(); -} -#endif - -Default_named_parameters -inline default_values() -{ - return Default_named_parameters(); -} - -template -Named_function_parameters -inline no_parameters(Named_function_parameters) -{ - typedef Named_function_parameters Params; - return Params(); -} - -// define free functions for named parameters -#define CGAL_add_named_parameter(X, Y, Z) \ - template \ - Named_function_parameters \ - Z(const K& p) \ - { \ - typedef Named_function_parameters Params;\ - return Params(p); \ - } -#include -#undef CGAL_add_named_parameter +inline default_values(); // function to extract a parameter template @@ -358,6 +317,177 @@ const T& choose_parameter(const T& t) return t; } +} // parameters namespace + +namespace internal_np { + +template +auto +combine_named_parameters(const Named_function_parameters& np, const NPS& ... nps) +{ + return np.combine(nps ...); +} + +} // end of internal_np namespace + +template +struct Named_function_parameters + : internal_np::Named_params_impl +{ + typedef internal_np::Named_params_impl base; + typedef Named_function_parameters self; + + Named_function_parameters() : base(T()) {} + Named_function_parameters(const T& v) : base(v) {} + Named_function_parameters(const T& v, const Base& b) : base(v, b) {} + +// create the functions for new named parameters and the one imported boost +// used to concatenate several parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters Params;\ + return Params(k, *this); \ + } +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters Params;\ + return Params(k, *this); \ + } +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + template \ + Named_function_parameters, \ + internal_np::X, self> \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters,\ + internal_np::X, self> Params; \ + return Params(std::cref(k), *this); \ + } +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& k) const \ + { \ + typedef Named_function_parameters Params;\ + return Params(k, *this); \ + } +#include +#undef CGAL_add_named_parameter +#undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only +#undef CGAL_add_extra_named_parameter_with_compatibility + +// inject mesh specific named parameter functions +#define CGAL_NP_BASE self +#define CGAL_NP_BUILD(P, V) P(V, *this) + +#include + +#undef CGAL_NP_BASE +#undef CGAL_NP_BUILD + + template + Named_function_parameters + combine(const Named_function_parameters& np) const + { + return Named_function_parameters(np.v,*this); + } + + template + auto + combine(const Named_function_parameters& np, const NPS& ... nps) const + { + return Named_function_parameters(np.v,*this).combine(nps...); + } + + // typedef for SFINAE + typedef int CGAL_Named_function_parameters_class; +}; + +namespace parameters { + +Default_named_parameters +inline default_values() +{ + return Default_named_parameters(); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +Default_named_parameters +inline all_default() +{ + return Default_named_parameters(); +} +#endif + +template +struct Boost_parameter_compatibility_wrapper +{ + template + Named_function_parameters + operator()(const K& p) const + { + typedef Named_function_parameters Params; + return Params(p); + } + + template + Named_function_parameters + operator=(const K& p) const + { + typedef Named_function_parameters Params; + return Params(p); + } +}; + +template +struct Boost_parameter_compatibility_wrapper +{ + template + Named_function_parameters, Tag> + operator()(const K& p) const + { + typedef Named_function_parameters, Tag> Params; + return Params(std::cref(p)); + } + + template + Named_function_parameters, Tag> + operator=(const K& p) const + { + typedef Named_function_parameters, Tag> Params; + return Params(std::cref(p)); + } +}; + +// define free functions and Boost_parameter_compatibility_wrapper for named parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ + Named_function_parameters \ + Z(const K& p) \ + { \ + typedef Named_function_parameters Params;\ + return Params(p); \ + } + +#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; +#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; +#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \ + const Boost_parameter_compatibility_wrapper Z; +#include +#undef CGAL_add_named_parameter +#undef CGAL_add_extra_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility +#undef CGAL_add_named_parameter_with_compatibility_ref_only + // Version with three parameters for dynamic property maps template D choose_parameter(const internal_np::Param_not_found&, Dynamic_tag tag, PolygonMesh& pm) @@ -407,4 +537,9 @@ namespace boost } #endif +// For disambiguation using SFINAE +BOOST_MPL_HAS_XXX_TRAIT_DEF(CGAL_Named_function_parameters_class) +template +CGAL_CPP17_INLINE constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class::value; + #endif // CGAL_BOOST_FUNCTION_PARAMS_HPP diff --git a/SMDS_3/include/CGAL/SMDS_3/Has_features.h b/STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h similarity index 82% rename from SMDS_3/include/CGAL/SMDS_3/Has_features.h rename to STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h index e2c322fc0f6..d9681f1579c 100644 --- a/SMDS_3/include/CGAL/SMDS_3/Has_features.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/Has_features.h @@ -6,21 +6,17 @@ // // $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) : Stéphane Tayeb, Laurent Rineau -#ifndef CGAL_MESH_3_HAS_FEATURES_H -#define CGAL_MESH_3_HAS_FEATURES_H - -#include - +#ifndef CGAL_HAS_FEATURES_H +#define CGAL_HAS_FEATURES_H #include #include namespace CGAL { -namespace Mesh_3 { namespace internal { // A type has_Has_features to check if type 'Has_features' is a nested @@ -40,7 +36,6 @@ namespace internal { {}; } // end namespace internal -} // end namespace Mesh_3 } // end namespace CGAL #endif // CGAL_MESH_3_HAS_FEATURES_H diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp b/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp index c91dea7d62f..a02a831f044 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp +++ b/STL_Extension/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp @@ -3,7 +3,7 @@ // Copyright 2004 The Trustees of Indiana University. // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) +// https://www.boost.org/LICENSE_1_0.txt) // // Authors: Douglas Gregor // Andrew Lumsdaine diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h new file mode 100644 index 00000000000..09487cc44f9 --- /dev/null +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -0,0 +1,236 @@ +// Copyright (c) 2009 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// + +#ifndef CGAL_MESH_OPTION_CLASSES_H +#define CGAL_MESH_OPTION_CLASSES_H + +#include + +namespace CGAL { + +enum Mesh_error_code { + CGAL_MESH_3_NO_ERROR = 0, + CGAL_MESH_3_MAXIMAL_NUMBER_OF_VERTICES_REACHED, + CGAL_MESH_3_STOPPED +}; + +namespace parameters { + +namespace internal { + +const int undef_parameter = -1; + +// Helpers +struct Optimization_options_base +{ + Optimization_options_base(bool b) + : b_(b), time_limit_(undef_parameter), bound_(undef_parameter) {} + + operator bool() const { return b_; } + + bool is_time_limit_set() const { return time_limit_ != undef_parameter; } + void set_time_limit(double d) { time_limit_ = d; } + double time_limit() const { return time_limit_; } + + bool is_bound_set() const { return bound_ != undef_parameter; } + void set_bound(double d) { bound_ = d; } + double bound() const { return bound_; } + +private: + bool b_; + double time_limit_; + double bound_; +}; + +struct Global_optimization_options_base +{ + Global_optimization_options_base() + : convergence_(undef_parameter), max_it_nb_(undef_parameter) {} + + bool is_convergence_set() const { return convergence_ != undef_parameter; } + void set_convergence(double d) { convergence_ = d; } + double convergence() const { return convergence_; } + + bool is_max_iteration_number_set() const { return max_it_nb_ != std::size_t(undef_parameter); } + void set_max_iteration_number(std::size_t i) { max_it_nb_ = i; } + std::size_t max_iteration_number() const { return max_it_nb_; } + +private: + double convergence_; + std::size_t max_it_nb_; +}; + +// Perturb +struct Perturb_options : public Optimization_options_base +{ + Perturb_options(bool b) : Optimization_options_base(b) {} +}; + +// Exude +struct Exude_options : public Optimization_options_base +{ + Exude_options(bool b) : Optimization_options_base(b) {} +}; + +// Odt +struct Odt_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Odt_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Lloyd +struct Lloyd_options : public Optimization_options_base +, public Global_optimization_options_base +{ + Lloyd_options(bool b) : Optimization_options_base(b) + , Global_optimization_options_base() {} +}; + +// Manifold +struct Manifold_options { + enum { + NON_MANIFOLD = 0, + MANIFOLD_WITH_BOUNDARY = 8, + NO_BOUNDARY = 16, + MANIFOLD = 24 + }; + + Manifold_options(const int topology) + : mesh_topology(topology) + {} + Manifold_options() + : mesh_topology(NON_MANIFOLD) + {} + + int mesh_topology; +}; + +// Various Mesh_3 option +struct Mesh_3_options { +#ifndef CGAL_NO_ATOMIC + typedef std::atomic* Pointer_to_stop_atomic_boolean_t; +#else + typedef bool* Pointer_to_stop_atomic_boolean_t; +#endif + Mesh_3_options(bool nonlinear = false) + // This parameter `nonlinear` adds a compatibility with previous + // API of the constructor of `C3t3_initializer`. + // -- Laurent Rineau, 2019/05/03 + : dump_after_init_prefix() + , dump_after_refine_surface_prefix() + , dump_after_refine_prefix() + , dump_after_glob_opt_prefix() + , dump_after_perturb_prefix() + , dump_after_exude_prefix() + , number_of_initial_points(-1) + , nonlinear_growth_of_balls(nonlinear) + , maximal_number_of_vertices(0) + , pointer_to_error_code(0) +#ifndef CGAL_NO_ATOMIC + , pointer_to_stop_atomic_boolean(0) +#endif + {} + + std::string dump_after_init_prefix; + std::string dump_after_refine_surface_prefix; + std::string dump_after_refine_prefix; + std::string dump_after_glob_opt_prefix; + std::string dump_after_perturb_prefix; + std::string dump_after_exude_prefix; + int number_of_initial_points; + bool nonlinear_growth_of_balls; + std::size_t maximal_number_of_vertices; + Mesh_error_code* pointer_to_error_code; +#ifndef CGAL_NO_ATOMIC + Pointer_to_stop_atomic_boolean_t pointer_to_stop_atomic_boolean; +#endif + +}; // end struct Mesh_3_options + +// Features +struct Features_options +{ + Features_options(bool b) : b_(b) {} + bool features() const { return b_; } +private: + bool b_; +}; + +// ----------------------------------- +// Features generator +// ----------------------------------- +// struct Features_option_generator +template +struct Features_options_generator {}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(true); } +}; + +template<> +struct Features_options_generator +{ + Features_options operator()() { return Features_options(false); } +}; + +// struct Domain_features_generator is designed to handle cases where +// MeshDomain::Has_features is not a valid type +template< typename MeshDomain, bool MeshDomainHasHasFeatures > +struct Domain_features_generator {}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, false > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + +template< typename MeshDomain > +struct Domain_features_generator< MeshDomain, true > +{ + Features_options operator()() + { + return Features_options_generator()(); + } +}; + +} // end namespace internal + + +namespace default_values_for_mesh_3 { + +const double time_limit = 0.; + +// exude_mesh_3 +const double exude_sliver_bound = 0.; + +// perturb_mesh_3 +const double perturb_sliver_bound = 0.; + +// lloyd_optimize_mesh_3 +const double lloyd_freeze_ratio = 0.01; +const double lloyd_convergence_ratio = 0.02; + +// odt_optimize_mesh_3 +const double odt_freeze_ratio = 0.01; +const double odt_convergence_ratio = 0.02; + +// global optimizers +const bool do_freeze = true; + +} } } //namespace CGAL::parameters::def + +#endif diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h new file mode 100644 index 00000000000..ece342c321b --- /dev/null +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_parameters_interface.h @@ -0,0 +1,370 @@ +// Copyright (c) 2017 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// + +// List of named parameters special functions used in meshing packages of CGAL +// no guard on purpose as they are injected both in the parameter namespace +// and the Named_function_parameters class. + + +// ----------------------------------- +// Reset_c3t3 (undocumented) +// ----------------------------------- +inline +Named_function_parameters +reset_c3t3() +{ + typedef Named_function_parameters Param; + return CGAL_NP_BUILD(Param, true); +} + +inline +Named_function_parameters +no_reset_c3t3() +{ + typedef Named_function_parameters Param; + return CGAL_NP_BUILD(Param, false); +} + +// ----------------------------------- +// Perturb +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +perturb(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),::CGAL::parameters::internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::lower_sliver_bound),::CGAL::parameters::default_values_for_mesh_3::perturb_sliver_bound); + + ::CGAL::parameters::internal::Perturb_options options(true); + + if ( ::CGAL::parameters::internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + + options.set_bound(sliver_bound); + typedef Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +perturb(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return perturb(::CGAL::internal_np::combine_named_parameters(np1, np2, nps...)); +} + + +inline Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +no_perturb() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Perturb_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Perturb_options, ::CGAL::internal_np::perturb_options_param_t, CGAL_NP_BASE> +perturb(double time_limit_, + double sliver_bound_=0) +{ + return perturb(time_limit(time_limit_). + sliver_bound(sliver_bound_)); +} +#endif + +// ----------------------------------- +// Exude +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),::CGAL::parameters::internal::undef_parameter); + double sliver_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::lower_sliver_bound),::CGAL::parameters::default_values_for_mesh_3::perturb_sliver_bound); + + ::CGAL::parameters::internal::Exude_options options(true); + + if ( ::CGAL::parameters::internal::undef_parameter != time_limit) + options.set_time_limit(time_limit); + options.set_bound(sliver_bound); + typedef Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> Param; + + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(const CGAL_NP_CLASS_1& np1, const CGAL_NP_CLASS_2& np2, const NP& ... nps) +{ + return exude(::CGAL::internal_np::combine_named_parameters(np1, np2, nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +no_exude() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Exude_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Exude_options, ::CGAL::internal_np::exude_options_param_t, CGAL_NP_BASE> +exude(double time_limit_, + double sliver_bound_ = 0) +{ + return exude(time_limit(time_limit_).sliver_bound(sliver_bound_)); +} +#endif + +// ----------------------------------- +// Odt +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::odt_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::odt_convergence_ratio); + std::size_t max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + ::CGAL::parameters::internal::Odt_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + typedef Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(const CGAL_NP_CLASS& ... nps) +{ + return odt(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +no_odt() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Odt_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Odt_options, ::CGAL::internal_np::odt_options_param_t, CGAL_NP_BASE> +odt(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_ = true) +{ + return odt(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + +// ----------------------------------- +// Lloyd +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + double time_limit = choose_parameter(get_parameter(np,::CGAL::internal_np::maximum_running_time),0); + double freeze_bound = choose_parameter(get_parameter(np,::CGAL::internal_np::vertex_freeze_bound),::CGAL::parameters::default_values_for_mesh_3::lloyd_freeze_ratio); + double convergence = choose_parameter(get_parameter(np,::CGAL::internal_np::convergence_ratio), ::CGAL::parameters::default_values_for_mesh_3::lloyd_convergence_ratio); + std::size_t max_iteration_number = choose_parameter(get_parameter(np,::CGAL::internal_np::number_of_iterations), 0); + ::CGAL::parameters::internal::Lloyd_options options(true); + + options.set_time_limit(time_limit); + options.set_bound(freeze_bound); + options.set_convergence(convergence); + options.set_max_iteration_number(max_iteration_number); + + typedef Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(const CGAL_NP_CLASS& ... nps) +{ + return lloyd(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +no_lloyd() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Lloyd_options(false)); +} + +#ifndef CGAL_NO_DEPRECATED_CODE +CGAL_DEPRECATED +inline +Named_function_parameters<::CGAL::parameters::internal::Lloyd_options, ::CGAL::internal_np::lloyd_options_param_t, CGAL_NP_BASE> +lloyd(double time_limit_, + std::size_t max_iteration_number_ = 0, + double convergence_ = 0.02, + double freeze_bound_ = 0.01, + bool do_freeze_= true) +{ + return lloyd(time_limit(time_limit_). + max_iteration_number(max_iteration_number_). + convergence(convergence_). + freeze_bound(freeze_bound_). + do_freeze(do_freeze_)); +} +#endif + +// ----------------------------------- +// Manifold options +// ----------------------------------- +template +Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + int mesh_topology = choose_parameter(get_parameter(np, ::CGAL::internal_np::mesh_topology_number), -1); + ::CGAL::parameters::internal::Manifold_options options; + options.mesh_topology = mesh_topology; + + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + + +template +Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_options(const CGAL_NP_CLASS& ... nps) +{ + return manifold_options(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Manifold_options(::CGAL::parameters::internal::Manifold_options::MANIFOLD)); +} +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +manifold_with_boundary() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,::CGAL::parameters::internal::Manifold_options( + ::CGAL::parameters::internal::Manifold_options::MANIFOLD_WITH_BOUNDARY)); +} +inline Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> +non_manifold() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Manifold_options, ::CGAL::internal_np::manifold_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Manifold_options(::CGAL::parameters::internal::Manifold_options::NON_MANIFOLD)); +} + +// ----------------------------------- +// Mesh options +// ----------------------------------- + +// Undocumented parameter for refine_mesh_3 and make_mesh_3. +// Allows to dump the mesh at given stage of the mesh generation +// algorithm. +template +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_options(const CGAL_NP_CLASS& np = parameters::default_values()) +{ + using ::CGAL::parameters::choose_parameter; + using ::CGAL::parameters::get_parameter; + ::CGAL::parameters::internal::Mesh_3_options options; + + options.dump_after_init_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_init_prefix_param), ""); + options.dump_after_refine_surface_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_surface_prefix_param), ""); + options.dump_after_refine_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_prefix_param), ""); + options.dump_after_glob_opt_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_glob_opt_prefix_param), ""); + options.dump_after_perturb_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_perturb_prefix_param), ""); + options.dump_after_exude_prefix=choose_parameter(get_parameter(np, ::CGAL::internal_np::dump_after_refine_surface_prefix_param), ""); + options.number_of_initial_points=choose_parameter(get_parameter(np, ::CGAL::internal_np::number_of_initial_points_param), -1); + options.nonlinear_growth_of_balls = choose_parameter(get_parameter(np, ::CGAL::internal_np::nonlinear_growth_of_balls_param), false); + options.maximal_number_of_vertices=choose_parameter(get_parameter(np, ::CGAL::internal_np::maximal_number_of_vertices_param), 0); + options.pointer_to_error_code=choose_parameter(get_parameter(np, ::CGAL::internal_np::pointer_to_error_code_param), ((Mesh_error_code*)0)); +#ifndef CGAL_NO_ATOMIC + options.pointer_to_stop_atomic_boolean=choose_parameter(get_parameter(np, ::CGAL::internal_np::pointer_to_stop_atomic_boolean_param), + ((::CGAL::parameters::internal::Mesh_3_options::Pointer_to_stop_atomic_boolean_t)0)); +#endif + + typedef Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, options); +} + +template +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_options(const CGAL_NP_CLASS& ... nps) +{ + return mesh_3_options(::CGAL::internal_np::combine_named_parameters(nps...)); +} + +// Undocumented parameter for refine_mesh_3 and make_mesh_3. +// Default Mesh_3_options: dump at every stage of the mesh generation. +inline +Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> +mesh_3_dump() +{ + typedef Named_function_parameters<::CGAL::parameters::internal::Mesh_3_options, ::CGAL::internal_np::mesh_param_t, CGAL_NP_BASE> Param; + ::CGAL::parameters::internal::Mesh_3_options options; + + options.dump_after_init_prefix = "mesh_dump_after_init"; + options.dump_after_refine_surface_prefix = "mesh_dump_after_refine_surface"; + options.dump_after_refine_prefix = "mesh_dump_after_refine"; + options.dump_after_glob_opt_prefix = "mesh_dump_after_glob_opt"; + options.dump_after_perturb_prefix = "mesh_dump_after_perturb"; + options.dump_after_exude_prefix = "mesh_dump_after_exude"; + + return CGAL_NP_BUILD(Param, options); +} + +// ----------------------------------- +// Features_options +// ----------------------------------- +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +features() { + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Features_options(true)); +} + +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +no_features() { + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param, ::CGAL::parameters::internal::Features_options(false)); } + +template < typename MeshDomain > +inline Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> +features(const MeshDomain& /*domain*/) +{ + typedef typename ::CGAL::parameters::internal::Domain_features_generator::value > Generator; + + typedef Named_function_parameters<::CGAL::parameters::internal::Features_options, ::CGAL::internal_np::features_option_param_t, CGAL_NP_BASE> Param; + return CGAL_NP_BUILD(Param,Generator()()); +} diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h index 6e25c8d438a..c5ad5f82e96 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/parameters_interface.h @@ -261,7 +261,70 @@ CGAL_add_named_parameter(adjust_directions_t, adjust_directions, adjust_directio CGAL_add_named_parameter(segment_t, segment_map, segment_map) // List of named parameters used in Mesh_2 package -CGAL_add_named_parameter(seeds_t, seeds, seeds) -CGAL_add_named_parameter(domain_is_initialized_t, domain_is_initialized, domain_is_initialized) -CGAL_add_named_parameter(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) -CGAL_add_named_parameter(criteria_t, criteria, criteria) +CGAL_add_named_parameter_with_compatibility(seeds_t, seeds, seeds) +CGAL_add_named_parameter_with_compatibility(domain_is_initialized_t, domain_is_initialized, domain_is_initialized) +CGAL_add_named_parameter_with_compatibility(seeds_are_in_domain_t, seeds_are_in_domain, seeds_are_in_domain) +CGAL_add_extra_named_parameter_with_compatibility(seeds_are_in_domain_t, seeds_are_in_domain, mark) +CGAL_add_named_parameter_with_compatibility(criteria_t, criteria, criteria) +CGAL_add_named_parameter_with_compatibility(convergence_ratio_t, convergence_ratio, convergence) +CGAL_add_named_parameter_with_compatibility(vertex_freeze_bound_t, vertex_freeze_bound, freeze_bound) +CGAL_add_named_parameter_with_compatibility(i_seed_begin_iterator_t, i_seed_begin_iterator, seeds_begin) +CGAL_add_named_parameter_with_compatibility(i_seed_end_iterator_t, i_seed_end_iterator, seeds_end) + +//List of named parameters used in exude_mesh_3.h +CGAL_add_named_parameter_with_compatibility(lower_sliver_bound_t,lower_sliver_bound,sliver_bound) +CGAL_add_named_parameter_with_compatibility(freeze_t,freeze,do_freeze) +//List of named parameters used in perturb_mesh_3.h +CGAL_add_named_parameter_with_compatibility(sliver_criteria_t, sliver_criteria, sliver_criterion) +CGAL_add_named_parameter_with_compatibility(perturb_vector_t, perturb_vector, perturbation_vector) + +//List of named parameters used in refine_mesh_3.h +CGAL_add_extra_named_parameter_with_compatibility(number_of_iterations_t, number_of_iterations, max_iteration_number) +CGAL_add_extra_named_parameter_with_compatibility(maximum_running_time_t, maximum_running_time, time_limit) +CGAL_add_named_parameter_with_compatibility(mesh_topology_number_t, mesh_topology_number, mesh_topology) +CGAL_add_named_parameter_with_compatibility(dump_after_init_prefix_param_t, dump_after_init_prefix_param, dump_after_init_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_refine_surface_prefix_param_t, dump_after_refine_surface_prefix_param, dump_after_refine_surface_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_refine_prefix_param_t, dump_after_refine_prefix_param, dump_after_refine_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_glob_opt_prefix_param_t, dump_after_glob_opt_prefix_param, dump_after_glob_opt_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_perturb_prefix_param_t, dump_after_perturb_prefix_param, dump_after_perturb_prefix) +CGAL_add_named_parameter_with_compatibility(dump_after_exude_prefix_param_t, dump_after_exude_prefix_param, dump_after_exude_prefix) +CGAL_add_named_parameter_with_compatibility(number_of_initial_points_param_t, number_of_initial_points_param, number_of_initial_points) +CGAL_add_named_parameter_with_compatibility(maximal_number_of_vertices_param_t, maximal_number_of_vertices_param, maximal_number_of_vertices) +CGAL_add_named_parameter_with_compatibility(nonlinear_growth_of_balls_param_t, nonlinear_growth_of_balls_param, nonlinear_growth_of_balls) +CGAL_add_named_parameter_with_compatibility(pointer_to_error_code_param_t, pointer_to_error_code_param, pointer_to_error_code) +CGAL_add_named_parameter_with_compatibility(pointer_to_stop_atomic_boolean_param_t, pointer_to_stop_atomic_boolean_param, pointer_to_stop_atomic_boolean) +CGAL_add_named_parameter_with_compatibility(exude_options_param_t, exude_options_param, exude_options) +CGAL_add_named_parameter_with_compatibility(perturb_options_param_t, perturb_options_param, perturb_options) +CGAL_add_named_parameter_with_compatibility(odt_options_param_t, odt_options_param, odt_options) +CGAL_add_named_parameter_with_compatibility(lloyd_options_param_t, lloyd_options_param, lloyd_options) +CGAL_add_named_parameter_with_compatibility(do_reset_c3t3_t, do_reset_c3t3, do_reset_c3t3) +CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_options) +CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option) +CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options) + +CGAL_add_named_parameter_with_compatibility_ref_only(image_3_param_t, image_3_param, image) +CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value) +CGAL_add_named_parameter_with_compatibility(image_subdomain_index_t, image_subdomain_index, image_values_to_subdomain_indices) +CGAL_add_named_parameter_with_compatibility(voxel_value_t, voxel_value, value_outside) +CGAL_add_named_parameter_with_compatibility(error_bound_t, error_bound, relative_error_bound) +CGAL_add_named_parameter_with_compatibility(rng_t, rng, p_rng) +CGAL_add_named_parameter_with_compatibility(null_subdomain_index_param_t,null_subdomain_index_param, null_subdomain_index) +CGAL_add_named_parameter_with_compatibility(surface_patch_index_t, surface_patch_index, construct_surface_patch_index) +CGAL_add_named_parameter_with_compatibility_ref_only(weights_param_t, weights_param, weights) + +CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size) +CGAL_add_named_parameter_with_compatibility_ref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field) +CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle) +CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size) +CGAL_add_named_parameter_with_compatibility_ref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(facet_distance_param_t, facet_distance_param, facet_distance) +CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology) +CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge) +CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio) +CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size) +CGAL_add_named_parameter_with_compatibility_ref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field) +CGAL_add_named_parameter_with_compatibility_ref_only(sizing_field_param_t, sizing_field_param, sizing_field) + +CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function) +CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object) + diff --git a/STL_Extension/include/CGAL/array.h b/STL_Extension/include/CGAL/array.h index cfaca0a0550..ff234183f99 100644 --- a/STL_Extension/include/CGAL/array.h +++ b/STL_Extension/include/CGAL/array.h @@ -30,7 +30,7 @@ namespace CGAL { // https://lists.boost.org/Archives/boost/2006/08/109003.php // // C++0x has it under discussion here : -// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#851 +// https://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#851 // Hopefully C++0x will fix this properly with initializer_lists. // So, it's temporary, therefore I do not document it and keep it internal. diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 45d513d9f5f..b9e145ec9e7 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -44,6 +44,31 @@ # define CGAL_NO_WARNINGS #endif +#if defined(CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME) + +#include +namespace CGAL{ +inline bool& get_use_assertions() +{ + CGAL_STATIC_THREAD_LOCAL_VARIABLE(bool, b, true); + return b; +} +inline void set_use_assertions(bool b) +{ + get_use_assertions() = b; +} +} + +#else + +namespace CGAL{ +inline void set_use_assertions(bool){} +inline constexpr bool get_use_assertions(){return true;} +} + +#endif + + namespace CGAL { // function declarations @@ -89,18 +114,18 @@ inline bool possibly(Uncertain c); #else // no CGAL_NO_ASSERTIONS # define CGAL_ASSERTIONS_ENABLED true # define CGAL_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 # define CGAL_destructor_assertion(EX) \ - (CGAL::possibly(EX)||(std::uncaught_exceptions() > 0)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||(std::uncaught_exceptions() > 0))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_destructor_assertion_catch(CODE) try{ CODE } catch(...) { if(std::uncaught_exceptions() <= 0) throw; } # else // use C++03 `std::uncaught_exception()` # define CGAL_destructor_assertion(EX) \ - (CGAL::possibly(EX)||std::uncaught_exception()?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||std::uncaught_exception())?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_destructor_assertion_catch(CODE) try{ CODE } catch(...) { if(!std::uncaught_exception()) throw; } # endif // use C++03 `std::uncaught_exception()` # define CGAL_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_assertion_code(CODE) CODE # define CGAL_assume(EX) CGAL_assertion(EX) # define CGAL_assume_code(CODE) CGAL_assertion_code(CODE) @@ -124,9 +149,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_assertion_code(CODE) #else # define CGAL_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -136,9 +161,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_assertion_code(CODE) #else # define CGAL_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -148,9 +173,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_assertion_code(CODE) #else # define CGAL_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_assertion_code(CODE) CODE #endif // CGAL_NO_ASSERTIONS @@ -166,9 +191,9 @@ inline bool possibly(Uncertain c); #else # define CGAL_PRECONDITIONS_ENABLED true # define CGAL_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -178,9 +203,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_precondition_code(CODE) #else # define CGAL_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -190,9 +215,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_precondition_code(CODE) #else # define CGAL_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -202,9 +227,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_precondition_code(CODE) #else # define CGAL_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_precondition_code(CODE) CODE #endif // CGAL_NO_PRECONDITIONS @@ -218,9 +243,9 @@ inline bool possibly(Uncertain c); # define CGAL_postcondition_code(CODE) #else # define CGAL_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -230,9 +255,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_postcondition_code(CODE) #else # define CGAL_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -242,9 +267,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_postcondition_code(CODE) #else # define CGAL_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -254,9 +279,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_postcondition_code(CODE) #else # define CGAL_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_postcondition_code(CODE) CODE #endif // CGAL_NO_POSTCONDITIONS @@ -271,16 +296,16 @@ inline bool possibly(Uncertain c); # define CGAL_warning_code(CODE) #else # define CGAL_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 # define CGAL_destructor_warning(EX) \ - (CGAL::possibly(EX)||(std::uncaught_exceptions() > 0)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||(std::uncaught_exceptions() > 0))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # else // use C++03 `std::uncaught_exception()` # define CGAL_destructor_warning(EX) \ - (CGAL::possibly(EX)||std::uncaught_exception()?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX)||std::uncaught_exception())?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # endif // use C++03 `std::uncaught_exception()` # define CGAL_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -290,9 +315,9 @@ inline bool possibly(Uncertain c); # define CGAL_exactness_warning_code(CODE) #else # define CGAL_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_exactness_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -302,9 +327,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_warning_code(CODE) #else # define CGAL_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS @@ -314,9 +339,9 @@ inline bool possibly(Uncertain c); # define CGAL_expensive_exactness_warning_code(CODE) #else # define CGAL_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) # define CGAL_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) + ((!CGAL::get_use_assertions() || CGAL::possibly(EX))?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) # define CGAL_expensive_exactness_warning_code(CODE) CODE #endif // CGAL_NO_WARNINGS diff --git a/STL_Extension/include/CGAL/assertions_behaviour.h b/STL_Extension/include/CGAL/assertions_behaviour.h index a8bcb45fcf8..e70cf1e1169 100644 --- a/STL_Extension/include/CGAL/assertions_behaviour.h +++ b/STL_Extension/include/CGAL/assertions_behaviour.h @@ -14,11 +14,11 @@ // // Author(s) : Geert-Jan Giezeman and Sven Schoenherr -#include - #ifndef CGAL_ASSERTIONS_BEHAVIOUR_H #define CGAL_ASSERTIONS_BEHAVIOUR_H +#include + // workaround against the definition of EXIT in #ifdef EXIT # undef EXIT diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index e395ab3c76f..ea9a964c8a3 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1283,6 +1283,8 @@ template < typename D, typename V = std::tuple<>, typename O = std::tuple<> > struct Derivator { typedef Derivator Self; + Derivator() = default; + Derivator(const Self&) = default; Self& operator=(const Self&) = delete; template void tuple_dispatch(const Tuple&) @@ -1296,6 +1298,8 @@ struct Derivator, std::tuple > typedef Derivator, std::tuple > Self; typedef Derivator, std::tuple > Base; + Derivator() = default; + Derivator(const Self&) = default; Self& operator=(const Self&) = delete; using Base::operator=; diff --git a/STL_Extension/include/CGAL/multiset_assertions.h b/STL_Extension/include/CGAL/multiset_assertions.h deleted file mode 100644 index 894accd47fc..00000000000 --- a/STL_Extension/include/CGAL/multiset_assertions.h +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright (c) 2005 Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_multiset_assertion -#undef CGAL_multiset_assertion_msg -#undef CGAL_multiset_assertion_code - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_multiset_assertion(EX) (static_cast(0)) -# define CGAL_multiset_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_assertion_code(CODE) -#else -# define CGAL_multiset_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_assertion_code(CODE) CODE -# define CGAL_multiset_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - -#undef CGAL_multiset_exactness_assertion -#undef CGAL_multiset_exactness_assertion_msg -#undef CGAL_multiset_exactness_assertion_code - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_assertion(EX) (static_cast(0)) -# define CGAL_multiset_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_assertion_code(CODE) -#else -# define CGAL_multiset_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_assertion_code(CODE) CODE -# define CGAL_multiset_exactness_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - -#undef CGAL_multiset_expensive_assertion -#undef CGAL_multiset_expensive_assertion_msg -#undef CGAL_multiset_expensive_assertion_code - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_assertion(EX) (static_cast(0)) -# define CGAL_multiset_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_assertion_code(CODE) -#else -# define CGAL_multiset_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_assertion_code(CODE) CODE -# define CGAL_multiset_expensive_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - -#undef CGAL_multiset_expensive_exactness_assertion -#undef CGAL_multiset_expensive_exactness_assertion_msg -#undef CGAL_multiset_expensive_exactness_assertion_code - -#if defined(CGAL_MULTISET_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_assertions 1 -#endif // CGAL_MULTISET_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_multiset_precondition -#undef CGAL_multiset_precondition_msg -#undef CGAL_multiset_precondition_code - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_multiset_precondition(EX) (static_cast(0)) -# define CGAL_multiset_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_precondition_code(CODE) -#else -# define CGAL_multiset_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_precondition_code(CODE) CODE -# define CGAL_multiset_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - -#undef CGAL_multiset_exactness_precondition -#undef CGAL_multiset_exactness_precondition_msg -#undef CGAL_multiset_exactness_precondition_code - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_precondition(EX) (static_cast(0)) -# define CGAL_multiset_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_precondition_code(CODE) -#else -# define CGAL_multiset_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_precondition_code(CODE) CODE -# define CGAL_multiset_exactness_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - -#undef CGAL_multiset_expensive_precondition -#undef CGAL_multiset_expensive_precondition_msg -#undef CGAL_multiset_expensive_precondition_code - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_precondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_precondition_code(CODE) -#else -# define CGAL_multiset_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_precondition_code(CODE) CODE -# define CGAL_multiset_expensive_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - -#undef CGAL_multiset_expensive_exactness_precondition -#undef CGAL_multiset_expensive_exactness_precondition_msg -#undef CGAL_multiset_expensive_exactness_precondition_code - -#if defined(CGAL_MULTISET_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_preconditions 1 -#endif // CGAL_MULTISET_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_multiset_postcondition -#undef CGAL_multiset_postcondition_msg -#undef CGAL_multiset_postcondition_code - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_multiset_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_postcondition_code(CODE) -#else -# define CGAL_multiset_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_postcondition_code(CODE) CODE -# define CGAL_multiset_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - -#undef CGAL_multiset_exactness_postcondition -#undef CGAL_multiset_exactness_postcondition_msg -#undef CGAL_multiset_exactness_postcondition_code - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_postcondition_code(CODE) -#else -# define CGAL_multiset_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_postcondition_code(CODE) CODE -# define CGAL_multiset_exactness_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - -#undef CGAL_multiset_expensive_postcondition -#undef CGAL_multiset_expensive_postcondition_msg -#undef CGAL_multiset_expensive_postcondition_code - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_postcondition_code(CODE) -#else -# define CGAL_multiset_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_postcondition_code(CODE) CODE -# define CGAL_multiset_expensive_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - -#undef CGAL_multiset_expensive_exactness_postcondition -#undef CGAL_multiset_expensive_exactness_postcondition_msg -#undef CGAL_multiset_expensive_exactness_postcondition_code - -#if defined(CGAL_MULTISET_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_postconditions 1 -#endif // CGAL_MULTISET_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_multiset_warning -#undef CGAL_multiset_warning_msg -#undef CGAL_multiset_warning_code - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_multiset_warning(EX) (static_cast(0)) -# define CGAL_multiset_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_warning_code(CODE) -#else -# define CGAL_multiset_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_warning_code(CODE) CODE -# define CGAL_multiset_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - -#undef CGAL_multiset_exactness_warning -#undef CGAL_multiset_exactness_warning_msg -#undef CGAL_multiset_exactness_warning_code - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_multiset_exactness_warning(EX) (static_cast(0)) -# define CGAL_multiset_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_exactness_warning_code(CODE) -#else -# define CGAL_multiset_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_exactness_warning_code(CODE) CODE -# define CGAL_multiset_exactness_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - -#undef CGAL_multiset_expensive_warning -#undef CGAL_multiset_expensive_warning_msg -#undef CGAL_multiset_expensive_warning_code - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_warning(EX) (static_cast(0)) -# define CGAL_multiset_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_warning_code(CODE) -#else -# define CGAL_multiset_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_warning_code(CODE) CODE -# define CGAL_multiset_expensive_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS - - -#undef CGAL_multiset_expensive_exactness_warning -#undef CGAL_multiset_expensive_exactness_warning_msg -#undef CGAL_multiset_expensive_exactness_warning_code - -#if defined(CGAL_MULTISET_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_MULTISET_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_MULTISET_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_multiset_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_multiset_expensive_exactness_warning_code(CODE) -#else -# define CGAL_multiset_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_multiset_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_multiset_expensive_exactness_warning_code(CODE) CODE -# define CGAL_multiset_expensive_exactness_warnings 1 -#endif // CGAL_MULTISET_NO_WARNINGS diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index c1f9c8ab130..6aa1988e1cc 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -81,6 +81,27 @@ Assert_compile_time_tag( const Tag&, const Derived& b) x.match_compile_time_tag(b); } -} //namespace CGAL +// To distinguish between kernel predicates for which a division-less FT is sufficient +template +struct Needs_FT +{ + T value; + Needs_FT(T v) : value(v) {} + operator T() const { return value; } +}; + +template +struct Remove_needs_FT +{ + using Type = T; +}; + +template +struct Remove_needs_FT > +{ + using Type = T; +}; + +} // namespace CGAL #endif // CGAL_TAGS_H diff --git a/STL_Extension/include/CGAL/triangulation_assertions.h b/STL_Extension/include/CGAL/triangulation_assertions.h deleted file mode 100644 index 07c7c80e72f..00000000000 --- a/STL_Extension/include/CGAL/triangulation_assertions.h +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) 2001 INRIA Sophia-Antipolis (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org) -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial -// -// -// Author(s) : Geert-Jan Giezeman, Sven Schoenherr -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_triangulation_assertion -#undef CGAL_triangulation_assertion_msg -#undef CGAL_triangulation_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_triangulation_assertion(EX) (static_cast(0)) - - -# define CGAL_triangulation_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_assertion_code(CODE) -#else -# define CGAL_triangulation_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_assertion_code(CODE) CODE -# define CGAL_triangulation_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_exactness_assertion -#undef CGAL_triangulation_exactness_assertion_msg -#undef CGAL_triangulation_exactness_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_assertion_code(CODE) -#else -# define CGAL_triangulation_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_assertion_code(CODE) CODE -# define CGAL_triangulation_exactness_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_expensive_assertion -#undef CGAL_triangulation_expensive_assertion_msg -#undef CGAL_triangulation_expensive_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_assertion_code(CODE) -#else -# define CGAL_triangulation_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_assertion_code(CODE) CODE -# define CGAL_triangulation_expensive_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -#undef CGAL_triangulation_expensive_exactness_assertion -#undef CGAL_triangulation_expensive_exactness_assertion_msg -#undef CGAL_triangulation_expensive_exactness_assertion_code - -#if defined(CGAL_TRIANGULATION_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_assertions 1 -#endif // CGAL_TRIANGULATION_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_triangulation_precondition -#undef CGAL_triangulation_precondition_msg -#undef CGAL_triangulation_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_triangulation_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_precondition_code(CODE) -#else -# define CGAL_triangulation_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_precondition_code(CODE) CODE -# define CGAL_triangulation_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_exactness_precondition -#undef CGAL_triangulation_exactness_precondition_msg -#undef CGAL_triangulation_exactness_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_precondition_code(CODE) -#else -# define CGAL_triangulation_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_precondition_code(CODE) CODE -# define CGAL_triangulation_exactness_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_expensive_precondition -#undef CGAL_triangulation_expensive_precondition_msg -#undef CGAL_triangulation_expensive_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_precondition_code(CODE) -#else -# define CGAL_triangulation_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_precondition_code(CODE) CODE -# define CGAL_triangulation_expensive_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -#undef CGAL_triangulation_expensive_exactness_precondition -#undef CGAL_triangulation_expensive_exactness_precondition_msg -#undef CGAL_triangulation_expensive_exactness_precondition_code - -#if defined(CGAL_TRIANGULATION_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_preconditions 1 -#endif // CGAL_TRIANGULATION_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_triangulation_postcondition -#undef CGAL_triangulation_postcondition_msg -#undef CGAL_triangulation_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_triangulation_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_postcondition_code(CODE) -#else -# define CGAL_triangulation_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_postcondition_code(CODE) CODE -# define CGAL_triangulation_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_exactness_postcondition -#undef CGAL_triangulation_exactness_postcondition_msg -#undef CGAL_triangulation_exactness_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_postcondition_code(CODE) -#else -# define CGAL_triangulation_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_postcondition_code(CODE) CODE -# define CGAL_triangulation_exactness_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_expensive_postcondition -#undef CGAL_triangulation_expensive_postcondition_msg -#undef CGAL_triangulation_expensive_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_postcondition_code(CODE) -#else -# define CGAL_triangulation_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_postcondition_code(CODE) CODE -# define CGAL_triangulation_expensive_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -#undef CGAL_triangulation_expensive_exactness_postcondition -#undef CGAL_triangulation_expensive_exactness_postcondition_msg -#undef CGAL_triangulation_expensive_exactness_postcondition_code - -#if defined(CGAL_TRIANGULATION_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_postconditions 1 -#endif // CGAL_TRIANGULATION_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_triangulation_warning -#undef CGAL_triangulation_warning_msg -#undef CGAL_triangulation_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_triangulation_warning(EX) (static_cast(0)) -# define CGAL_triangulation_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_warning_code(CODE) -#else -# define CGAL_triangulation_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_warning_code(CODE) CODE -# define CGAL_triangulation_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_exactness_warning -#undef CGAL_triangulation_exactness_warning_msg -#undef CGAL_triangulation_exactness_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_triangulation_exactness_warning(EX) (static_cast(0)) -# define CGAL_triangulation_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_exactness_warning_code(CODE) -#else -# define CGAL_triangulation_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_exactness_warning_code(CODE) CODE -# define CGAL_triangulation_exactness_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_expensive_warning -#undef CGAL_triangulation_expensive_warning_msg -#undef CGAL_triangulation_expensive_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_warning(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_warning_code(CODE) -#else -# define CGAL_triangulation_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_warning_code(CODE) CODE -# define CGAL_triangulation_expensive_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS - - -#undef CGAL_triangulation_expensive_exactness_warning -#undef CGAL_triangulation_expensive_exactness_warning_msg -#undef CGAL_triangulation_expensive_exactness_warning_code - -#if defined(CGAL_TRIANGULATION_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TRIANGULATION_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TRIANGULATION_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_triangulation_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_triangulation_expensive_exactness_warning_code(CODE) -#else -# define CGAL_triangulation_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_triangulation_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_triangulation_expensive_exactness_warning_code(CODE) CODE -# define CGAL_triangulation_expensive_exactness_warnings 1 -#endif // CGAL_TRIANGULATION_NO_WARNINGS diff --git a/STL_Extension/test/STL_Extension/test_Compact_container.cpp b/STL_Extension/test/STL_Extension/test_Compact_container.cpp index 661ec453cbd..d2d96cdfc4b 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container.cpp @@ -242,15 +242,15 @@ void test(const Cont &) assert(c11.size() == v1.size()); assert(c10 == c11); - // owns() and owns_dereferencable(). + // owns() and owns_dereferenceable(). for(typename Cont::const_iterator it = c9.begin(), end = c9.end(); it != end; ++it) { assert(c9.owns(it)); - assert(c9.owns_dereferencable(it)); + assert(c9.owns_dereferenceable(it)); assert(! c10.owns(it)); - assert(! c10.owns_dereferencable(it)); + assert(! c10.owns_dereferenceable(it)); } assert(c9.owns(c9.end())); - assert(! c9.owns_dereferencable(c9.end())); + assert(! c9.owns_dereferenceable(c9.end())); c9.erase(c9.begin(), c9.end()); diff --git a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp index 00f2e1da4ec..a42676f8f7f 100644 --- a/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Concurrent_compact_container.cpp @@ -322,15 +322,15 @@ void test(const Cont &) assert(c11.size() == v1.size()); assert(c10 == c11);*/ - // owns() and owns_dereferencable(). + // owns() and owns_dereferenceable(). for(typename Cont::const_iterator it = c9.begin(), end = c9.end(); it != end; ++it) { assert(c9.owns(it)); - assert(c9.owns_dereferencable(it)); + assert(c9.owns_dereferenceable(it)); assert(! c10.owns(it)); - assert(! c10.owns_dereferencable(it)); + assert(! c10.owns_dereferenceable(it)); } assert(c9.owns(c9.end())); - assert(! c9.owns_dereferencable(c9.end())); + assert(! c9.owns_dereferenceable(c9.end())); c9.erase(c9.begin(), c9.end()); diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h index 7cfdb245391..2a55578de06 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h @@ -559,9 +559,6 @@ private: { std::set done; - unsigned int nb_facets_removed = 0; - - unsigned int nb_skipped = 0; for (Cell_iterator cit = _shape->cells_begin (); cit != _shape->cells_end (); ++ cit) { if (_shape->is_infinite (cit)) @@ -702,7 +699,6 @@ private: } else { - nb_facets_removed ++; mark_handled (f); _garbage.push_back (ordered_facet_indices (f)); } @@ -716,7 +712,6 @@ private: } else { - nb_facets_removed ++; mark_handled (_shape->mirror_facet (f)); _garbage.push_back (ordered_facet_indices (_shape->mirror_facet (f))); } @@ -782,7 +777,6 @@ private: // If number of layers is != 2, ignore volume and discard bubble if (layer != 1) { - nb_skipped ++; for (unsigned int i = 0; i < 2; ++ i) for (typename std::set::iterator fit = _bubbles.back()[i].begin (); fit != _bubbles.back()[i].end (); ++ fit) @@ -790,7 +784,6 @@ private: mark_handled (*fit); _map_f2b.erase (*fit); _garbage.push_back (ordered_facet_indices (*fit)); - nb_facets_removed ++; } _bubbles.pop_back (); } @@ -805,10 +798,6 @@ private: typedef std::map, std::set > Edge_shell_map_triples; typedef typename Edge_shell_map_triples::iterator Edge_shell_map_triples_iterator; - unsigned int nb_facets_removed = 0; - - unsigned int nb_nm_edges = 0; - // Store for each pair edge/shell the incident facets Edge_shell_map_triples eshell_triples; std::map map_t2f; @@ -841,8 +830,6 @@ private: if (eit->second.size () < 3) continue; - ++ nb_nm_edges; - Facet_iterator tit = _shells[eit->first.second]; Facet_iterator end = (eit->first.second == _shells.size () - 1) ? _surface.end () : _shells[eit->first.second + 1]; @@ -863,7 +850,6 @@ private: _map_f2s.erase (map_t2f[*current]); _surface.erase (current); - ++ nb_facets_removed; eit->second.erase (search); } @@ -931,14 +917,12 @@ private: _surface.splice(end, tmp, tmp.begin(), tmp.end()); } - unsigned int nb_facets_removed = 0; unsigned int nb_nm_vertices = 0; // Removing facets to fix non-manifold vertices might make some other vertices // become non-manifold, therefore we iterate until no facet needs to be removed. do { nb_nm_vertices = 0; - nb_facets_removed = 0; // Store for each pair vertex/shell the incident facets Vertex_shell_map_facets vshell_facets; @@ -1052,7 +1036,6 @@ private: _garbage.push_back (*current); _surface.erase (current); - ++ nb_facets_removed; ++ tindex; } diff --git a/Scripts/developer_scripts/cgal_check_dependencies.sh b/Scripts/developer_scripts/cgal_check_dependencies.sh index 46c7871152e..cd67b9277a8 100644 --- a/Scripts/developer_scripts/cgal_check_dependencies.sh +++ b/Scripts/developer_scripts/cgal_check_dependencies.sh @@ -27,6 +27,10 @@ do pkg=$(basename $pkg_path) if [ -f $pkg_path/package_info/$pkg/dependencies ]; then mv $pkg_path/package_info/$pkg/dependencies $pkg_path/package_info/$pkg/dependencies.old + else + if [ -d $pkg_path/package_info/$pkg ]; then + touch $pkg_path/package_info/$pkg/dependencies.old + fi fi done @@ -42,11 +46,11 @@ do if [ -f "$pkg_path/package_info/$pkg/dependencies" ]; then PKG_DIFF=$(grep -Fxv -f "$pkg_path/package_info/$pkg/dependencies.old" "$pkg_path/package_info/$pkg/dependencies" || true) if [ -n "$PKG_DIFF" ]; then - TOTAL_RES="Differences in $pkg: $PKG_DIFF are new and not committed.\n $TOTAL_RES" + TOTAL_RES="Differences in $pkg:\n$PKG_DIFF\nare new and not committed.\n$TOTAL_RES" fi PKG_DIFF=$(grep -Fxv -f "$pkg_path/package_info/$pkg/dependencies" "$pkg_path/package_info/$pkg/dependencies.old" || true) if [ -n "$PKG_DIFF" ]; then - TOTAL_RES="Differences in $pkg: $PKG_DIFF have disappeared.\n $TOTAL_RES" + TOTAL_RES="Differences in $pkg:\n$PKG_DIFF\mhave disappeared.\n$TOTAL_RES" fi if [ -f $pkg_path/package_info/$pkg/dependencies.old ]; then rm $pkg_path/package_info/$pkg/dependencies.old diff --git a/Scripts/developer_scripts/test_merge_of_branch b/Scripts/developer_scripts/test_merge_of_branch index 3d4aa099e76..f0ddcbc36fd 100755 --- a/Scripts/developer_scripts/test_merge_of_branch +++ b/Scripts/developer_scripts/test_merge_of_branch @@ -117,6 +117,30 @@ if [ -n "${project_name_demo}" ]; then exit 1 fi +# check minimal version is the first instruction in cmake scripts +echo '.. Checking if all CMakeLists.txt starts with cmake_minimum_required...' +cmr_tests=$(for i in ^build*/test/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); res=$(egrep -v "^\s*#" $i | grep -v "^\s*$" | head -n 1 | grep -v cmake_minimum_required); if [ -n "${res}" ]; then echo $pkg; fi; done) +cmr_examples=$(for i in ^build*/examples/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); res=$(egrep -v "^s*#" $i | grep -v "^\s*$" | head -n 1 | grep -v cmake_minimum_required); if [ -n "${res}" ]; then echo $pkg; fi; done) +cmr_demo=$(for i in ^build*/demo/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); res=$(egrep -v "^s*#" $i | grep -v "^\s*$" | head -n 1 | grep -v cmake_minimum_required); if [ -n "${res}" ]; then echo $pkg; fi; done) + +if [ -n "${cmr_tests}" ]; then + echo "CMakeLists in test with issues:" + echo ${cmr_tests} + exit 1 +fi + +if [ -n "${cmr_examples}" ]; then + echo "CMakeLists in examples with issues:" + echo ${cmr_examples} + exit 1 +fi + +if [ -n "${cmr_demo}" ]; then + echo "CMakeLists in demo with issues:" + echo ${cmr_demo} + exit 1 +fi + #check header files without SPDX license identifier echo '.. Checking SPDX license identifier presence in header files...' file_without_SPDX_identifiers=$(for pkg in `find */package_info -name 'license.txt' | awk -F "/" '{print $1}'`; do if [ -e ${pkg}/include ]; then find ${pkg}/include -type f \( -name '*.h' -o -name '*.hpp' \) | xargs -r grep -L "SPDX-License-Identifier"; fi; done) diff --git a/Scripts/package_info/Scripts/dependencies b/Scripts/package_info/Scripts/dependencies deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 33d1826bf86..a7a22294904 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -38,15 +38,15 @@ find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) EOF if [ -d "${SOURCE_DIR}" ] ; then - echo " set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" + echo "set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" echo fi if [ -d "${SOURCE_DIR}../include" ] ; then - echo " include_directories (BEFORE \"${SOURCE_DIR}../include\")" + echo "include_directories (BEFORE \"${SOURCE_DIR}../include\")" echo fi if [ -d "${SOURCE_DIR}include" ] ; then - echo " include_directories (BEFORE \"${SOURCE_DIR}include\")" + echo "include_directories (BEFORE \"${SOURCE_DIR}include\")" echo fi diff --git a/SearchStructures/doc/SearchStructures/fig/range2.png b/SearchStructures/doc/SearchStructures/fig/range2.png index 7b9ad7d4d3b..83a1e2b8d54 100644 Binary files a/SearchStructures/doc/SearchStructures/fig/range2.png and b/SearchStructures/doc/SearchStructures/fig/range2.png differ diff --git a/SearchStructures/include/CGAL/Range_tree_d.h b/SearchStructures/include/CGAL/Range_tree_d.h index 17f28b8383b..0a1cae56d43 100644 --- a/SearchStructures/include/CGAL/Range_tree_d.h +++ b/SearchStructures/include/CGAL/Range_tree_d.h @@ -222,18 +222,18 @@ protected: link_type vleft = new Range_tree_node2( 0, 0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vleft != 0); + CGAL_assertion( vleft != 0); ++current; link_type vright = new Range_tree_node2( 0,0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vright != 0); + CGAL_assertion( vright != 0); current++; sublevel_last = current; link_type vparent = new Range_tree_node2( vleft, vright, vleft->key ); - CGAL_Tree_assertion( vparent != 0); + CGAL_assertion( vparent != 0); vleft->parent_link = vparent; vright->parent_link = vparent; @@ -260,7 +260,7 @@ protected: link_type vright = new Range_tree_node2( 0, 0, (*current), m_interface.get_key(*current) ); //CGAL_NIL CGAL_NIL first two arguments - CGAL_Tree_assertion( vright != 0); //CGAL_NIL + CGAL_assertion( vright != 0); //CGAL_NIL current++; sublevel_last = current; prevchild = vright; @@ -276,7 +276,7 @@ protected: link_type vparent = new Range_tree_node2( prevchild, 0, rightchild->key ); //CGAL_NIL argument - CGAL_Tree_assertion( vparent != 0); + CGAL_assertion( vparent != 0); prevchild->parent_link = vparent; diff --git a/SearchStructures/include/CGAL/Segment_tree_d.h b/SearchStructures/include/CGAL/Segment_tree_d.h index e116f5f9c0c..732a9596f91 100644 --- a/SearchStructures/include/CGAL/Segment_tree_d.h +++ b/SearchStructures/include/CGAL/Segment_tree_d.h @@ -533,9 +533,9 @@ public: } else { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_left(*count), - m_interface.get_right(*count)), - "invalid segment ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_left(*count), + m_interface.get_right(*count)), + "invalid segment ignored"); } count++; } @@ -627,9 +627,9 @@ public: if(is_less_equal(m_interface.get_right_win(win), m_interface.get_left_win(win))) { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_right_win(win), - m_interface.get_left_win(win)), - "invalid window -- query ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_right_win(win), + m_interface.get_left_win(win)), + "invalid window -- query ignored"); return result; } link_type v = root(); @@ -680,9 +680,9 @@ public: if(is_less_equal(m_interface.get_right_win(win), m_interface.get_left_win(win))) { - CGAL_Tree_warning_msg(m_interface.comp(m_interface.get_right_win(win), - m_interface.get_left_win(win)), - "invalid window -- query ignored"); + CGAL_warning_msg(m_interface.comp(m_interface.get_right_win(win), + m_interface.get_left_win(win)), + "invalid window -- query ignored"); return result; } link_type v = root(); diff --git a/SearchStructures/include/CGAL/Tree_assertions.h b/SearchStructures/include/CGAL/Tree_assertions.h deleted file mode 100644 index 091d35fa81b..00000000000 --- a/SearchStructures/include/CGAL/Tree_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 1997 ETH Zurich (Switzerland). -// 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) : Geert-Jan Giezeman, Sven Schoenherr, Gabriele Neyer -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_Tree_assertion -#undef CGAL_Tree_assertion_msg -#undef CGAL_Tree_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_Tree_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_Tree_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_assertion_code(CODE) -#else -# define CGAL_Tree_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_assertion_code(CODE) CODE -# define CGAL_Tree_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_exactness_assertion -#undef CGAL_Tree_exactness_assertion_msg -#undef CGAL_Tree_exactness_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_assertion(EX) (static_cast(0)) -# define CGAL_Tree_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_assertion_code(CODE) -#else -# define CGAL_Tree_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_assertion_code(CODE) CODE -# define CGAL_Tree_exactness_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_expensive_assertion -#undef CGAL_Tree_expensive_assertion_msg -#undef CGAL_Tree_expensive_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_assertion(EX) (static_cast(0)) -# define CGAL_Tree_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_assertion_code(CODE) -#else -# define CGAL_Tree_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_assertion_code(CODE) CODE -# define CGAL_Tree_expensive_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -#undef CGAL_Tree_expensive_exactness_assertion -#undef CGAL_Tree_expensive_exactness_assertion_msg -#undef CGAL_Tree_expensive_exactness_assertion_code - -#if defined(CGAL_TREE_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_assertions 1 -#endif // CGAL_TREE_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_Tree_precondition -#undef CGAL_Tree_precondition_msg -#undef CGAL_Tree_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_Tree_precondition(EX) (static_cast(0)) -# define CGAL_Tree_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_precondition_code(CODE) -#else -# define CGAL_Tree_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_precondition_code(CODE) CODE -# define CGAL_Tree_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_exactness_precondition -#undef CGAL_Tree_exactness_precondition_msg -#undef CGAL_Tree_exactness_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_precondition(EX) (static_cast(0)) -# define CGAL_Tree_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_precondition_code(CODE) -#else -# define CGAL_Tree_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_precondition_code(CODE) CODE -# define CGAL_Tree_exactness_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_expensive_precondition -#undef CGAL_Tree_expensive_precondition_msg -#undef CGAL_Tree_expensive_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_precondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_precondition_code(CODE) -#else -# define CGAL_Tree_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_precondition_code(CODE) CODE -# define CGAL_Tree_expensive_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -#undef CGAL_Tree_expensive_exactness_precondition -#undef CGAL_Tree_expensive_exactness_precondition_msg -#undef CGAL_Tree_expensive_exactness_precondition_code - -#if defined(CGAL_TREE_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_preconditions 1 -#endif // CGAL_TREE_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_Tree_postcondition -#undef CGAL_Tree_postcondition_msg -#undef CGAL_Tree_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_Tree_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_postcondition_code(CODE) -#else -# define CGAL_Tree_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_postcondition_code(CODE) CODE -# define CGAL_Tree_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_exactness_postcondition -#undef CGAL_Tree_exactness_postcondition_msg -#undef CGAL_Tree_exactness_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_postcondition_code(CODE) -#else -# define CGAL_Tree_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_postcondition_code(CODE) CODE -# define CGAL_Tree_exactness_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_expensive_postcondition -#undef CGAL_Tree_expensive_postcondition_msg -#undef CGAL_Tree_expensive_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_postcondition_code(CODE) -#else -# define CGAL_Tree_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_postcondition_code(CODE) CODE -# define CGAL_Tree_expensive_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -#undef CGAL_Tree_expensive_exactness_postcondition -#undef CGAL_Tree_expensive_exactness_postcondition_msg -#undef CGAL_Tree_expensive_exactness_postcondition_code - -#if defined(CGAL_TREE_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_postconditions 1 -#endif // CGAL_TREE_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_Tree_warning -#undef CGAL_Tree_warning_msg -#undef CGAL_Tree_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_Tree_warning(EX) (static_cast(0)) -# define CGAL_Tree_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_warning_code(CODE) -#else -# define CGAL_Tree_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_warning_code(CODE) CODE -# define CGAL_Tree_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_exactness_warning -#undef CGAL_Tree_exactness_warning_msg -#undef CGAL_Tree_exactness_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_Tree_exactness_warning(EX) (static_cast(0)) -# define CGAL_Tree_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_exactness_warning_code(CODE) -#else -# define CGAL_Tree_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_exactness_warning_code(CODE) CODE -# define CGAL_Tree_exactness_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_expensive_warning -#undef CGAL_Tree_expensive_warning_msg -#undef CGAL_Tree_expensive_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_warning(EX) (static_cast(0)) -# define CGAL_Tree_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_warning_code(CODE) -#else -# define CGAL_Tree_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_warning_code(CODE) CODE -# define CGAL_Tree_expensive_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS - - -#undef CGAL_Tree_expensive_exactness_warning -#undef CGAL_Tree_expensive_exactness_warning_msg -#undef CGAL_Tree_expensive_exactness_warning_code - -#if defined(CGAL_TREE_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_TREE_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_TREE_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_Tree_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_Tree_expensive_exactness_warning_code(CODE) -#else -# define CGAL_Tree_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_Tree_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_Tree_expensive_exactness_warning_code(CODE) CODE -# define CGAL_Tree_expensive_exactness_warnings 1 -#endif // CGAL_TREE_NO_WARNINGS diff --git a/SearchStructures/include/CGAL/Tree_base.h b/SearchStructures/include/CGAL/Tree_base.h index 90368baf98e..fd011f90a2f 100644 --- a/SearchStructures/include/CGAL/Tree_base.h +++ b/SearchStructures/include/CGAL/Tree_base.h @@ -22,7 +22,6 @@ #include #include #include -#include #ifndef CGAL_TREE_BASE_nullptr #define CGAL_TREE_BASE_nullptr 0 diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h index 55d5ea7bc7f..6fb02a67ddf 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_2.h @@ -17,9 +17,9 @@ Currently it only supports the insertions of sites. models of the concepts `SegmentDelaunayGraphVertexBase_2` and `TriangulationFaceBase_2`, respectively. It defaults to: \code - `CGAL::Triangulation_data_structure_2< + CGAL::Triangulation_data_structure_2< CGAL::Segment_Delaunay_graph_vertex_base_2, - CGAL::Segment_Delaunay_graph_face_base_2 >` + CGAL::Segment_Delaunay_graph_face_base_2 > \endcode \cgalHeading{Storage} diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h index 450a299f188..c1ef0bcc9fc 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_hierarchy_2.h @@ -57,10 +57,10 @@ data structure must be a model of the `SegmentDelaunayGraphHierarchyVertexBase_2` concept. The fourth template parameter defaults to: \code -`CGAL::Triangulation_data_structure_2< +CGAL::Triangulation_data_structure_2< CGAL::Segment_Delaunay_graph_hierarchy_vertex_base_2< CGAL::Segment_Delaunay_graph_vertex_base_2, - CGAL::Segment_Delaunay_graph_face_base_2 >` + CGAL::Segment_Delaunay_graph_face_base_2 > \endcode The `Segment_Delaunay_graph_hierarchy_2` class derives publicly from the diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_traits_with_info_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_traits_with_info_2.h index eb032cea795..49dd92c5160 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_traits_with_info_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_storage_traits_with_info_2.h @@ -11,7 +11,7 @@ The class `Segment_Delaunay_graph_storage_traits_with_info_2` provides a model f \cgalModels `SegmentDelaunayGraphStorageTraits_2` -\sa `CGAL::`Segment_Delaunay_graph_storage_site_with_info_2` +\sa `CGAL::Segment_Delaunay_graph_storage_site_with_info_2` */ template class Segment_Delaunay_graph_storage_traits_with_info_2 diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h index 4095dadf734..7519abf3039 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Triangulation_face_base_with_edges_2.h @@ -17,12 +17,7 @@ #include - - #include -#include - - namespace CGAL { diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h index 47093483971..fb8d2378953 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h @@ -43,6 +43,7 @@ #include #include +#include #include #include 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 6f346a248bc..73a5247879e 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 @@ -105,6 +105,7 @@ find_faces_to_split(const Vertex_handle& v, const Site_2& t, Face_circulator fc_start = fc; int n_inf = 0; int n_faces = 0; + CGAL_USE(n_faces); do { if ( is_infinite(fc) ) { n_inf++; } fc++; diff --git a/Set_movable_separability_2/doc/Set_movable_separability_2/Set_movable_separability_2.txt b/Set_movable_separability_2/doc/Set_movable_separability_2/Set_movable_separability_2.txt index 32e3051acd5..c21ee4bd0f0 100644 --- a/Set_movable_separability_2/doc/Set_movable_separability_2/Set_movable_separability_2.txt +++ b/Set_movable_separability_2/doc/Set_movable_separability_2/Set_movable_separability_2.txt @@ -73,9 +73,9 @@ right. The input polygon must satisfy two conditions as follows. First, it has to be simple. Essentially, a simple polygon is topologically equivalent to a disk; see Chapter \ref -Chapter_2D_Regularized_Boolean_Set-Operations "2D Regularized Boolean -Set-Operations" for the precise definition of simple -polygons. Secondly, any consecutive three vertices cannot be +Chapter_2D_Regularized_Boolean_Set-Operations +"2D Regularized Boolean Set-Operations" for the precise definition +of simple polygons. Secondly, any consecutive three vertices cannot be collinear. If you suspect that the input polygon may not satisfy the latter condition, pre-process the polygon to eliminate this ill-condition. diff --git a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt index ce108acd83c..b06dec3dfef 100644 --- a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Set_movable_separability_2_Tests) -if(RUNNING_CGAL_AUTO_TEST) +if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) # Just to avoid a warning from CMake when that variable is set on the command line... endif() if(CGAL_DIR) diff --git a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt index 78cd7bfe429..52206f94312 100644 --- a/Shape_regularization/examples/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/examples/Shape_regularization/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -project(Shape_regularization_Examples) - cmake_minimum_required(VERSION 3.1...3.23) +project(Shape_regularization_Examples) + find_package(CGAL REQUIRED COMPONENTS Core) # Find OSQP library and headers. diff --git a/Shape_regularization/package_info/Shape_regularization/dependencies b/Shape_regularization/package_info/Shape_regularization/dependencies new file mode 100644 index 00000000000..5cf917f32ed --- /dev/null +++ b/Shape_regularization/package_info/Shape_regularization/dependencies @@ -0,0 +1,28 @@ +Algebraic_foundations +BGL +Circulator +Distance_2 +Distance_3 +Filtered_kernel +Hash_map +Installation +Intersections_2 +Intersections_3 +Interval_support +Kernel_23 +Kernel_d +Modular_arithmetic +Number_types +Orthtree +Principal_component_analysis_LGPL +Profiling_tools +Property_map +Random_numbers +STL_Extension +Shape_detection +Shape_regularization +Spatial_searching +Spatial_sorting +Stream_support +TDS_2 +Triangulation_2 diff --git a/Shape_regularization/test/Shape_regularization/CMakeLists.txt b/Shape_regularization/test/Shape_regularization/CMakeLists.txt index 96ce53eb1a5..ddaa6f3ea31 100644 --- a/Shape_regularization/test/Shape_regularization/CMakeLists.txt +++ b/Shape_regularization/test/Shape_regularization/CMakeLists.txt @@ -1,10 +1,10 @@ # Created by the script cgal_create_CMakeLists. # This is the CMake script for compiling a set of CGAL applications. -project(Shape_regularization_Tests) - cmake_minimum_required(VERSION 3.1...3.23) +project(Shape_regularization_Tests) + find_package(CGAL REQUIRED COMPONENTS Core) # Find OSQP library and headers. diff --git a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h index 00f97708e78..6962b1ec8f2 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h @@ -655,8 +655,8 @@ locate_in_tmc(const Bare_point &p0, TMC_Cell_handle start) const if (start->has_vertex(_tmc.infinite_vertex(), ind_inf) ) start = start->neighbor(ind_inf); - CGAL_triangulation_precondition(start != TMC_Cell_handle()); - CGAL_triangulation_precondition(!start->has_vertex(_tmc.infinite_vertex())); + CGAL_precondition(start != TMC_Cell_handle()); + CGAL_precondition(!start->has_vertex(_tmc.infinite_vertex())); // We implement the remembering visibility/stochastic walk. diff --git a/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h b/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h index 1a888a011ce..5f908c59c86 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h +++ b/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h @@ -189,7 +189,7 @@ class ConstructVertex_2 public: /*! returns the source or target of `seg`. If `i` modulo 2 is 0, - the source is returned, otherwise the target is returned.} + the source is returned, otherwise the target is returned. */ Point_2 operator()(Segment_2 seg, int i); }; @@ -223,7 +223,7 @@ class ConstructIsoRectangle_2 public: /*! - introduces an iso-oriented rectangle fo whose minimal `x` coordinate + introduces an iso-oriented rectangle whose minimal `x` coordinate is the one of `left`, the maximal `x` coordinate is the one of `right`, the minimal `y` coordinate is the one of `bottom`, the maximal `y` coordinate is the one of `top`.} diff --git a/Snap_rounding_2/doc/Snap_rounding_2/Snap_rounding_2.txt b/Snap_rounding_2/doc/Snap_rounding_2/Snap_rounding_2.txt index bffd43ef1dd..41d9f6872e4 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/Snap_rounding_2.txt +++ b/Snap_rounding_2/doc/Snap_rounding_2/Snap_rounding_2.txt @@ -128,8 +128,7 @@ Polyline number 4: The package is supplied with a graphical demo program that opens a window, allows the user to edit segments dynamically, applies a selected snap-rounding procedures, and displays the result onto the same window -(see `/demo/Snap_rounding_2/demo.cpp`). +(see `/demo/Snap_rounding_2/Snap_rounding_2.cpp`). */ } /* namespace CGAL */ - diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h index cf7b6c2def6..20140344b84 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h b/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h index e0321f57395..2138c377e42 100644 --- a/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h +++ b/Solver_interface/include/CGAL/Eigen_diagonalize_traits.h @@ -53,7 +53,7 @@ struct Restricted_FT { typedef float type; }; /// /// \cgalModels `DiagonalizeTraits` /// -/// \sa http://eigen.tuxfamily.org/index.php?title=Main_Page +/// \sa https://eigen.tuxfamily.org/index.php?title=Main_Page template class Eigen_diagonalize_traits { diff --git a/Solver_interface/include/CGAL/Eigen_matrix.h b/Solver_interface/include/CGAL/Eigen_matrix.h index 4a34a022d0d..4f28c3f7c6f 100644 --- a/Solver_interface/include/CGAL/Eigen_matrix.h +++ b/Solver_interface/include/CGAL/Eigen_matrix.h @@ -23,7 +23,7 @@ namespace CGAL { \ingroup PkgSolverInterfaceLS The class `Eigen_matrix` is a wrapper around `Eigen` matrix type -`Eigen::Matrix`. +`Eigen::Matrix`. \cgalModels `SvdTraits::Matrix` diff --git a/Solver_interface/include/CGAL/Eigen_solver_traits.h b/Solver_interface/include/CGAL/Eigen_solver_traits.h index 9fe3457e84d..93820b7b827 100644 --- a/Solver_interface/include/CGAL/Eigen_solver_traits.h +++ b/Solver_interface/include/CGAL/Eigen_solver_traits.h @@ -75,7 +75,7 @@ The class `Eigen_solver_traits` provides an interface to the sparse solvers of \ \sa `CGAL::Eigen_sparse_matrix` \sa `CGAL::Eigen_sparse_symmetric_matrix` \sa `CGAL::Eigen_vector` -\sa http://eigen.tuxfamily.org/index.php?title=Main_Page +\sa https://eigen.tuxfamily.org/index.php?title=Main_Page \cgalHeading{Instantiation Example} diff --git a/Solver_interface/include/CGAL/Eigen_sparse_matrix.h b/Solver_interface/include/CGAL/Eigen_sparse_matrix.h index ff83d2a65fd..20e8962bb15 100644 --- a/Solver_interface/include/CGAL/Eigen_sparse_matrix.h +++ b/Solver_interface/include/CGAL/Eigen_sparse_matrix.h @@ -21,7 +21,7 @@ namespace CGAL { \ingroup PkgSolverInterfaceLS The class `Eigen_sparse_matrix` is a wrapper around `Eigen` matrix type -`Eigen::SparseMatrix` +`Eigen::SparseMatrix` that represents general matrices, be they symmetric or not. \cgalModels `SparseLinearAlgebraTraits_d::Matrix` @@ -301,7 +301,7 @@ private: \ingroup PkgSolverInterfaceRefLS The class `Eigen_sparse_symmetric_matrix` is a wrapper around `Eigen` matrix type -`Eigen::SparseMatrix` +`Eigen::SparseMatrix` Since the matrix is symmetric, only the lower triangle part is stored. diff --git a/Solver_interface/include/CGAL/Eigen_vector.h b/Solver_interface/include/CGAL/Eigen_vector.h index d080777a2f8..b50ac037eff 100644 --- a/Solver_interface/include/CGAL/Eigen_vector.h +++ b/Solver_interface/include/CGAL/Eigen_vector.h @@ -20,7 +20,7 @@ namespace CGAL { \ingroup PkgSolverInterfaceLS The class `Eigen_vector` is a wrapper around `Eigen` -vector type, +vector type, which is a simple array of numbers. \cgalModels `SvdTraits::Vector` diff --git a/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp b/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp index 766b41c77fc..a999a5235ec 100644 --- a/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp +++ b/Spatial_searching/benchmark/Spatial_searching/include/nanoflann.hpp @@ -393,7 +393,7 @@ namespace nanoflann /** @addtogroup param_grp Parameter structs * @{ */ - /** Parameters (see http://code.google.com/p/nanoflann/ for help choosing the parameters) + /** Parameters (see https://github.com/jlblancoc/nanoflann for help choosing the parameters) */ struct KDTreeSingleIndexAdaptorParams { @@ -580,10 +580,10 @@ namespace nanoflann * This code is an adapted version from Boost, modifed for its integration * within MRPT (JLBC, Dec/2009) (Renamed array -> CArray to avoid possible potential conflicts). * See - * http://www.josuttis.com/cppcode + * https://www.josuttis.com/cppcode/ * for details and the latest version. * See - * http://www.boost.org/libs/array for Documentation. + * https://www.boost.org/libs/array for Documentation. * for documentation. * * (C) Copyright Nicolai M. Josuttis 2001. @@ -851,7 +851,7 @@ namespace nanoflann * * Params: * inputData = dataset with the input features - * params = parameters passed to the kdtree algorithm (see http://code.google.com/p/nanoflann/ for help choosing the parameters) + * params = parameters passed to the kdtree algorithm (see https://github.com/jlblancoc/nanoflann for help choosing the parameters) */ KDTreeSingleIndexAdaptor(const int dimensionality, const DatasetAdaptor& inputData, const KDTreeSingleIndexAdaptorParams& params = KDTreeSingleIndexAdaptorParams() ) : dataset(inputData), index_params(params), root_node(NULL), distance(inputData) diff --git a/Spatial_searching/doc/Spatial_searching/CGAL/Weighted_Minkowski_distance.h b/Spatial_searching/doc/Spatial_searching/CGAL/Weighted_Minkowski_distance.h index d82fd2ca8b7..e1575fb05f3 100644 --- a/Spatial_searching/doc/Spatial_searching/CGAL/Weighted_Minkowski_distance.h +++ b/Spatial_searching/doc/Spatial_searching/CGAL/Weighted_Minkowski_distance.h @@ -52,7 +52,8 @@ Constructor implementing \f$ l_2\f$ metric for \f$ d\f$-dimensional points. Weighted_Minkowski_distance(int d,Traits t=Traits()); /*! -Constructor implementing the \f$ l_{power}(weights)\f$ metric. \f$ power \leq0\f$ denotes the \f$ l_{\infty}(weights)\f$ metric. +Constructor implementing the \f$ l_{power}(weights)\f$ metric. `power=0` +denotes the \f$ l_{\infty}(weights)\f$ metric. The values in the iterator range `[wb,we)` are the weight. */ template diff --git a/Spatial_searching/test/Spatial_searching/test_print.cpp b/Spatial_searching/test/Spatial_searching/test_print.cpp index eff527cef53..8826824ef49 100644 --- a/Spatial_searching/test/Spatial_searching/test_print.cpp +++ b/Spatial_searching/test/Spatial_searching/test_print.cpp @@ -27,10 +27,9 @@ void test_print(const std::string filename) { std::ifstream in(filename); CGAL::IO::set_ascii_mode(in); - Point_3 p; std::size_t count = 0; + Point_3 p; while (in >> p) { points.push_back(p); - ++count; } assert(points.size() > 0); diff --git a/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h b/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h index ed0dceb3efe..8e1d0387b18 100644 --- a/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h +++ b/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h @@ -10,7 +10,7 @@ // Author(s) : Fernando Cacciola // // Descriptions of the file format can be found at -// http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf #ifndef CGAL_DXF_STREAM_H #define CGAL_DXF_STREAM_H diff --git a/Straight_skeleton_2/include/CGAL/IO/Dxf_writer.h b/Straight_skeleton_2/include/CGAL/IO/Dxf_writer.h index 2c6e28c1fc7..11a41b3a204 100644 --- a/Straight_skeleton_2/include/CGAL/IO/Dxf_writer.h +++ b/Straight_skeleton_2/include/CGAL/IO/Dxf_writer.h @@ -10,7 +10,7 @@ // Author(s) : Fernando Cacciola // // Description of the file format can be found at the following address: -// http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf #ifndef CGAL_IO_DXF_WRITER_H #define CGAL_IO_DXF_WRITER_H diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h index 3916c7627c5..252fab5815e 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/assertions.h @@ -15,18 +15,6 @@ #include -#if defined(CGAL_STRAIGHT_SKELETON_NO_POSTCONDITIONS) \ - || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STRAIGHT_SKELETON_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_stskel_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_stskel_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_stskel_expensive_postcondition_code(CODE) -#else -# define CGAL_stskel_expensive_postcondition(EX) (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_stskel_expensive_postcondition_msg(EX,MSG) (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_stskel_expensive_postcondition_code(CODE) CODE -#endif - namespace CGAL { @@ -44,4 +32,3 @@ template inline bool handle_assigned ( Handle const& aH ) #endif // CGAL_STRAIGHT_SKELETON_ASSERTIONS_H // // EOF // - diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index 7331f70bd69..4ceae69e570 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -46,8 +46,9 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin , const K& ) { - bool bk_poly_assert_mode = get_use_polygon_assertions(); - set_use_polygon_assertions(false); // disable assertions in Polygon_2 function as we may manipulate strictly simple polygons + bool bk_poly_assert_mode = get_use_assertions(); + set_use_assertions(false); // disable assertions in Polygon_2 function as we may + // manipulate strictly simple polygons typedef typename std::iterator_traits::difference_type difference_type ; typedef typename std::iterator_traits::value_type PolygonPtr ; @@ -100,14 +101,14 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin if (lParent == nullptr) { - set_use_polygon_assertions(bk_poly_assert_mode); + set_use_assertions(bk_poly_assert_mode); return false; } lParent->add_hole(*lPoly); } } - set_use_polygon_assertions(bk_poly_assert_mode); + set_use_assertions(bk_poly_assert_mode); return true; } diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index ad14146a74b..02082ff8724 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -2,6 +2,7 @@ #include #include +#define CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME #define CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE //#define CGAL_STRAIGHT_SKELETON_ENABLE_TRACE 100 @@ -943,12 +944,12 @@ void test_offset(const char* filename) std::cout << offset_poly_with_holes.size() << " polygons with holes" << std::endl; // for(const auto& offp : offset_poly_with_holes) // print_polygon_with_holes(*offp); - CGAL::set_use_polygon_assertions(false); + CGAL::set_use_assertions(false); for(const auto& offp : offset_poly_with_holes){ (void)offp; assert(offp->outer_boundary().is_counterclockwise_oriented()); } - CGAL::set_use_polygon_assertions(true); + CGAL::set_use_assertions(true); #ifdef CGAL_SLS_TEST_SPEED_THINGS_UP_FOR_THE_TESTSUITE if(i > 2) break; diff --git a/Stream_lines_2/include/CGAL/Regular_grid_2.h b/Stream_lines_2/include/CGAL/Regular_grid_2.h index 57b69a00e41..2ef9c992a01 100644 --- a/Stream_lines_2/include/CGAL/Regular_grid_2.h +++ b/Stream_lines_2/include/CGAL/Regular_grid_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include @@ -59,7 +59,7 @@ public: std::pair get_field(const Point_2 & p) const { - CGAL_streamlines_precondition(is_in_domain(p)); + CGAL_precondition(is_in_domain(p)); Vector_2 v = get_vector_field(p); FT density = get_density_field(p); return std::pair(v,density); @@ -126,7 +126,7 @@ template inline typename Regular_grid_2::Vector_2 Regular_grid_2::get_field(int i, int j) const { - CGAL_streamlines_precondition(is_in_samples(i,j)); + CGAL_precondition(is_in_samples(i,j)); int index = get_index(i,j); return Vector_2((*vector_field)[index], (*vector_field)[index+1]); } @@ -137,7 +137,7 @@ Regular_grid_2::set_field(int i, int j, const Vector_2 & v) { - CGAL_streamlines_precondition(is_in_samples(i,j)); + CGAL_precondition(is_in_samples(i,j)); int index = get_index(i,j); (*vector_field)[index++] = v.x(); (*vector_field)[index] = v.y(); diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index a000bbf684f..16d71b84af7 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include // undocumented class @@ -392,7 +392,7 @@ Stream_lines_2::integrate_forward(const Vector_fiel { Point_2 ex_old_point = old_point; old_point = new_point; - CGAL_streamlines_precondition(vector_field_2.is_in_domain(old_point)); + CGAL_precondition(vector_field_2.is_in_domain(old_point)); new_point = integrator(old_point,vector_field_2,true); bEnd = !vector_field_2.is_in_domain(new_point); bEnd = bEnd || (new_point == old_point);/* to review */ @@ -521,7 +521,7 @@ void Stream_lines_2::integrate_backward(const Vecto Point_2 ex_old_point = old_point; old_point = new_point; std::pair field_vector; - CGAL_streamlines_precondition(vector_field_2.is_in_domain(old_point)); + CGAL_precondition(vector_field_2.is_in_domain(old_point)); new_point = integrator(old_point,vector_field_2,false); bEnd = !vector_field_2.is_in_domain(new_point); FT dist_ = distance(ex_old_point,new_point); diff --git a/Stream_lines_2/include/CGAL/streamlines_assertions.h b/Stream_lines_2/include/CGAL/streamlines_assertions.h deleted file mode 100644 index ce5fe41b14b..00000000000 --- a/Stream_lines_2/include/CGAL/streamlines_assertions.h +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 2005 INRIA Sophia-Antipolis (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) : Geert-Jan Giezeman, Sven Schoenherr, Abdelkrim Mebarki -// -// Generated from script create_assertions.sh - - -// Note that this header file is intentionnaly not protected with a -// macro (as ). Calling it a second time with another value -// for CGAL_NO_ASSERTIONS for example must make a difference. - -#include - -// macro definitions -// ================= -// assertions -// ---------- - -#undef CGAL_streamlines_assertion -#undef CGAL_streamlines_assertion_msg -#undef CGAL_streamlines_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) -# define CGAL_streamlines_assertion(EX) (static_cast(0)) - -#include - -# define CGAL_streamlines_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_assertion_code(CODE) -#else -# define CGAL_streamlines_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_assertion_code(CODE) CODE -# define CGAL_streamlines_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_exactness_assertion -#undef CGAL_streamlines_exactness_assertion_msg -#undef CGAL_streamlines_exactness_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_assertion_code(CODE) -#else -# define CGAL_streamlines_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_assertion_code(CODE) CODE -# define CGAL_streamlines_exactness_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_expensive_assertion -#undef CGAL_streamlines_expensive_assertion_msg -#undef CGAL_streamlines_expensive_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) \ - || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_assertion_code(CODE) -#else -# define CGAL_streamlines_expensive_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_assertion_code(CODE) CODE -# define CGAL_streamlines_expensive_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -#undef CGAL_streamlines_expensive_exactness_assertion -#undef CGAL_streamlines_expensive_exactness_assertion_msg -#undef CGAL_streamlines_expensive_exactness_assertion_code - -#if defined(CGAL_STREAMLINES_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_assertion(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_assertion_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_assertion_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_assertion(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_assertion_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_assertion_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_assertions 1 -#endif // CGAL_STREAMLINES_NO_ASSERTIONS - - -// preconditions -// ------------- - -#undef CGAL_streamlines_precondition -#undef CGAL_streamlines_precondition_msg -#undef CGAL_streamlines_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) -# define CGAL_streamlines_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_precondition_code(CODE) -#else -# define CGAL_streamlines_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_precondition_code(CODE) CODE -# define CGAL_streamlines_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_exactness_precondition -#undef CGAL_streamlines_exactness_precondition_msg -#undef CGAL_streamlines_exactness_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_precondition_code(CODE) -#else -# define CGAL_streamlines_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_precondition_code(CODE) CODE -# define CGAL_streamlines_exactness_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_expensive_precondition -#undef CGAL_streamlines_expensive_precondition_msg -#undef CGAL_streamlines_expensive_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_precondition_code(CODE) -#else -# define CGAL_streamlines_expensive_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_precondition_code(CODE) CODE -# define CGAL_streamlines_expensive_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -#undef CGAL_streamlines_expensive_exactness_precondition -#undef CGAL_streamlines_expensive_exactness_precondition_msg -#undef CGAL_streamlines_expensive_exactness_precondition_code - -#if defined(CGAL_STREAMLINES_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_precondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_precondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_precondition_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_precondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_precondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_precondition_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_preconditions 1 -#endif // CGAL_STREAMLINES_NO_PRECONDITIONS - - -// postconditions -// -------------- - -#undef CGAL_streamlines_postcondition -#undef CGAL_streamlines_postcondition_msg -#undef CGAL_streamlines_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) -# define CGAL_streamlines_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_postcondition_code(CODE) -#else -# define CGAL_streamlines_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_postcondition_code(CODE) CODE -# define CGAL_streamlines_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_exactness_postcondition -#undef CGAL_streamlines_exactness_postcondition_msg -#undef CGAL_streamlines_exactness_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_postcondition_code(CODE) -#else -# define CGAL_streamlines_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_postcondition_code(CODE) CODE -# define CGAL_streamlines_exactness_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_expensive_postcondition -#undef CGAL_streamlines_expensive_postcondition_msg -#undef CGAL_streamlines_expensive_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_postcondition_code(CODE) -#else -# define CGAL_streamlines_expensive_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_postcondition_code(CODE) CODE -# define CGAL_streamlines_expensive_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -#undef CGAL_streamlines_expensive_exactness_postcondition -#undef CGAL_streamlines_expensive_exactness_postcondition_msg -#undef CGAL_streamlines_expensive_exactness_postcondition_code - -#if defined(CGAL_STREAMLINES_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_postcondition(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_postcondition_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_postcondition_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_postcondition(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_postcondition_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_postcondition_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_postconditions 1 -#endif // CGAL_STREAMLINES_NO_POSTCONDITIONS - - -// warnings -// -------- - -#undef CGAL_streamlines_warning -#undef CGAL_streamlines_warning_msg -#undef CGAL_streamlines_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) -# define CGAL_streamlines_warning(EX) (static_cast(0)) -# define CGAL_streamlines_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_warning_code(CODE) -#else -# define CGAL_streamlines_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_warning_code(CODE) CODE -# define CGAL_streamlines_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_exactness_warning -#undef CGAL_streamlines_exactness_warning_msg -#undef CGAL_streamlines_exactness_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS)) -# define CGAL_streamlines_exactness_warning(EX) (static_cast(0)) -# define CGAL_streamlines_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_exactness_warning_code(CODE) -#else -# define CGAL_streamlines_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_exactness_warning_code(CODE) CODE -# define CGAL_streamlines_exactness_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_expensive_warning -#undef CGAL_streamlines_expensive_warning_msg -#undef CGAL_streamlines_expensive_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_warning(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_warning_code(CODE) -#else -# define CGAL_streamlines_expensive_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_warning_code(CODE) CODE -# define CGAL_streamlines_expensive_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS - - -#undef CGAL_streamlines_expensive_exactness_warning -#undef CGAL_streamlines_expensive_exactness_warning_msg -#undef CGAL_streamlines_expensive_exactness_warning_code - -#if defined(CGAL_STREAMLINES_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ - || (!defined(CGAL_STREAMLINES_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ - || (!defined(CGAL_STREAMLINES_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) -# define CGAL_streamlines_expensive_exactness_warning(EX) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_warning_msg(EX,MSG) (static_cast(0)) -# define CGAL_streamlines_expensive_exactness_warning_code(CODE) -#else -# define CGAL_streamlines_expensive_exactness_warning(EX) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__)) -# define CGAL_streamlines_expensive_exactness_warning_msg(EX,MSG) \ - (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) -# define CGAL_streamlines_expensive_exactness_warning_code(CODE) CODE -# define CGAL_streamlines_expensive_exactness_warnings 1 -#endif // CGAL_STREAMLINES_NO_WARNINGS diff --git a/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt b/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt index 4834a83616b..5ca36ae8a8c 100644 --- a/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt +++ b/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt @@ -107,7 +107,7 @@ which offers combinatorial repairing while reading bad inputs. The `OBJ` file format, using the file extension `.obj`, is a simple \ascii data format that represents 3D geometry. Vertices are stored in a counter-clockwise order by default, making explicit declaration of face normals unnecessary. -A precise specification of the format is available here. +A precise specification of the format is available here. @@ -148,7 +148,7 @@ The `STL` file format, using the file extension `.stl`, is an \ascii or binary f to the stereolithography CAD software created by 3D Systems. STL files describe the surface geometry of a three-dimensional object. -A precise specification of those formats is available here. +A precise specification of those formats is available here.
    diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index f2845004424..34dfd1ddba6 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -41,7 +41,7 @@ namespace CGAL { namespace IO { namespace internal { -// HEdgesRange" = range of std::pair +// HEdgesRange = range of std::pair // HUVRange = range of std::pair template bool read_PLY(std::istream& is, diff --git a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h index a65d68323db..b80a511a262 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_method_3/subdivision_masks_3.h @@ -571,12 +571,12 @@ public: /// computes the \f$ \sqrt{3}\f$ vertex-point `pt` of the vertex `vd`. void vertex_node(vertex_descriptor vertex, Point& pt) { Halfedge_around_target_circulator vcir(vertex, *(this->pmesh)); - const typename boost::graph_traits::degree_size_type n = degree(vertex, *(this->pmesh)); + const int n = static_cast(degree(vertex, *(this->pmesh))); const FT a = (FT) ((4.0-2.0*std::cos(2.0*CGAL_PI/(double)n))/9.0); Vector cv = ((FT)(1.0-a)) * (get(this->vpmap, vertex) - CGAL::ORIGIN); - for (typename boost::graph_traits::degree_size_type i = 1; i <= n; ++i, --vcir) { + for (int i = 1; i <= n; ++i, --vcir) { cv = cv + (a/FT(n))*(get(this->vpmap, target(opposite(*vcir, *(this->pmesh)), *(this->pmesh)))-CGAL::ORIGIN); } diff --git a/Surface_mesh/benchmark/polyhedron_performance.h b/Surface_mesh/benchmark/polyhedron_performance.h index 6229adb0007..b4de8bd6b6d 100644 --- a/Surface_mesh/benchmark/polyhedron_performance.h +++ b/Surface_mesh/benchmark/polyhedron_performance.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -461,7 +461,7 @@ private: ) vb->id() = index++; - SMS::Count_ratio_stop_predicate stop(0.1); + SMS::Edge_count_ratio_stop_predicate stop(0.1); int r = SMS::edge_collapse(P, stop); #endif } diff --git a/Surface_mesh/benchmark/surface_mesh_performance.h b/Surface_mesh/benchmark/surface_mesh_performance.h index 9ab57e28c9a..e310a6f4400 100644 --- a/Surface_mesh/benchmark/surface_mesh_performance.h +++ b/Surface_mesh/benchmark/surface_mesh_performance.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include typedef CGAL::Simple_cartesian K; @@ -284,7 +284,7 @@ private: mesh.clear(); bool b = CGAL::IO::read_OFF(_filename, mesh); - SMS::Count_ratio_stop_predicate stop(0.1); + SMS::Edge_count_ratio_stop_predicate stop(0.1); int r = SMS::edge_collapse(mesh, stop); } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 97ba5aed47b..8e274941fc1 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -289,10 +289,22 @@ public: if(m_vcolors == 3) { - unsigned char r, g, b; - element.assign(r, "red"); - element.assign(g, "green"); - element.assign(b, "blue"); + unsigned char r=0, g=0, b=0; + float rf=0, gf=0, bf=0; + if(element.has_property("red",r)) + { + element.assign(r, "red"); + element.assign(g, "green"); + element.assign(b, "blue"); + }else if(element.has_property("red", rf)) + { + element.assign(rf, "red"); + element.assign(gf, "green"); + element.assign(bf, "blue"); + r = static_cast(std::floor(rf*255)); + g = static_cast(std::floor(gf*255)); + b = static_cast(std::floor(bf*255)); + } m_vcolor_map[vi] = CGAL::IO::Color(r, g, b); } } @@ -331,10 +343,22 @@ public: if(m_fcolors == 3) { - unsigned char r, g, b; - element.assign(r, "red"); - element.assign(g, "green"); - element.assign(b, "blue"); + unsigned char r=0, g=0, b=0; + float rf=0, gf=0, bf=0; + if(element.has_property("red",r)) + { + element.assign(r, "red"); + element.assign(g, "green"); + element.assign(b, "blue"); + } else if(element.has_property("red", rf)) + { + element.assign(rf, "red"); + element.assign(gf, "green"); + element.assign(bf, "blue"); + r = static_cast(std::floor(rf*255)); + g = static_cast(std::floor(gf*255)); + b = static_cast(std::floor(bf*255)); + } m_fcolor_map[fi] = CGAL::IO::Color(r, g, b); } } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index dc30f94af43..5191f3b1397 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,10 @@ namespace CGAL { size_type idx() const { return idx_; } + // For convenience + size_type id() const { + return idx_; + } /// increments the internal index. This operation does not /// guarantee that the index is valid or undeleted after the @@ -1466,7 +1471,7 @@ public: /// perform an expensive validity check on the data structure and /// print found errors to `std::cerr` when `verbose == true`. - bool is_valid(bool verbose = true) const + bool is_valid(bool verbose = false) const { bool valid = true; size_type vcount = 0, hcount = 0, fcount = 0; @@ -1578,23 +1583,37 @@ public: } /// performs a validity check on a single vertex. - bool is_valid(Vertex_index v) const { + bool is_valid(Vertex_index v, + bool verbose = false) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(v)) - return false; + { + verr << "Vertex has invalid index: " << (size_type)v << std::endl; + return false; + } Halfedge_index h = vconn_[v].halfedge_; - if(h!= null_halfedge() && (!has_valid_index(h) || is_removed(h))) { - std::cerr << "Vertex connectivity halfedge error in " << (size_type)v - << " with " << (size_type)h << std::endl; - return false; + if(h != null_halfedge() && (!has_valid_index(h) || is_removed(h))) { + verr << "Vertex connectivity halfedge error: Vertex " << (size_type)v + << " with " << (size_type)h << std::endl; + return false; } return true; } /// performs a validity check on a single halfedge. - bool is_valid(Halfedge_index h) const { + bool is_valid(Halfedge_index h, + bool verbose = false) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(h)) + { + verr << "Halfedge has invalid index: " << (size_type)h << std::endl; return false; + } Face_index f = hconn_[h].face_; Vertex_index v = hconn_[h].vertex_; @@ -1605,30 +1624,30 @@ public: // don't validate the face if this is a border halfedge if(!is_border(h)) { if(!has_valid_index(f) || is_removed(f)) { - std::cerr << "Halfedge connectivity Face " - << (!has_valid_index(f) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: Face " + << (!has_valid_index(f) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } } if(!has_valid_index(v) || is_removed(v)) { - std::cerr << "Halfedge connectivity Vertex " - << (!has_valid_index(v) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: Vertex " + << (!has_valid_index(v) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } if(!has_valid_index(hn) || is_removed(hn)) { - std::cerr << "Halfedge connectivity hnext " - << (!has_valid_index(hn) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: hnext " + << (!has_valid_index(hn) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } if(!has_valid_index(hp) || is_removed(hp)) { - std::cerr << "Halfedge connectivity hprev " - << (!has_valid_index(hp) ? "invalid" : "removed") - << " in " << (size_type)h << std::endl; + verr << "Halfedge connectivity error: hprev " + << (!has_valid_index(hp) ? "invalid" : "removed") + << " in " << (size_type)h << std::endl; valid = false; } return valid; @@ -1636,25 +1655,39 @@ public: /// performs a validity check on a single edge. - bool is_valid(Edge_index e) const { + bool is_valid(Edge_index e, + bool verbose = false) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(e)) + { + verr << "Edge has invalid index: " << (size_type)e << std::endl; return false; + } Halfedge_index h = halfedge(e); - return is_valid(h) && is_valid(opposite(h)); + return is_valid(h, verbose) && is_valid(opposite(h), verbose); } /// performs a validity check on a single face. - bool is_valid(Face_index f) const { + bool is_valid(Face_index f, + bool verbose = false) const + { + Verbose_ostream verr(verbose); + if(!has_valid_index(f)) + { + verr << "Face has invalid index: " << (size_type)f << std::endl; return false; + } Halfedge_index h = fconn_[f].halfedge_; if(!has_valid_index(h) || is_removed(h)) { - std::cerr << "Face connectivity halfedge error in " << (size_type)f - << " with " << (size_type)h << std::endl; - return false; + verr << "Face connectivity halfedge error: Face " << (size_type)f + << " with " << (size_type)h << std::endl; + return false; } return true; } 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 547b8374776..d044c38a557 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 @@ -528,6 +528,51 @@ template void normalize_border(const CGAL::Surface_mesh

    &) {} + +template +bool is_valid_vertex_descriptor(typename boost::graph_traits >::vertex_descriptor v, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(v, verbose)) + return false; + + return BGL::is_valid_vertex_descriptor(v, g, verbose); +} + +template +bool is_valid_halfedge_descriptor(typename boost::graph_traits >::halfedge_descriptor h, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(h, verbose)) + return false; + + return BGL::is_valid_halfedge_descriptor(h, g, verbose); +} + +template +bool is_valid_edge_descriptor(typename boost::graph_traits >::edge_descriptor e, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(e, verbose)) + return false; + + return BGL::is_valid_edge_descriptor(e, g, verbose); +} + +template +bool is_valid_face_descriptor(typename boost::graph_traits >::face_descriptor f, + const CGAL::Surface_mesh

    & g, + const bool verbose = false) +{ + if(!g.is_valid(f, verbose)) + return false; + + return BGL::is_valid_face_descriptor(f, g, verbose); +} + } // namespace CGAL #endif // DOXYGEN_RUNNING diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h index aa3a8ad55ee..32a71b17f71 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Concepts/Parameterizer_3.h @@ -58,9 +58,9 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (`vimap` must be initialized) @@ -75,4 +75,3 @@ public: /// @} }; /* end Parameterizer_3 */ - diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt index db7aa8e187c..c7d456389ec 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/examples.txt @@ -1,4 +1,5 @@ /*! + \example Surface_mesh_parameterization/ARAP_parameterization.cpp \example Surface_mesh_parameterization/discrete_authalic.cpp \example Surface_mesh_parameterization/lscm.cpp \example Surface_mesh_parameterization/orbifold.cpp diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp new file mode 100644 index 00000000000..6919bd32dc8 --- /dev/null +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/ARAP_parameterization.cpp @@ -0,0 +1,57 @@ +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +typedef CGAL::Simple_cartesian Kernel; +typedef Kernel::Point_2 Point_2; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh SurfaceMesh; + +typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +namespace SMP = CGAL::Surface_mesh_parameterization; + +int main(int argc, char** argv) +{ + const std::string filename = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/head.off"); + + SurfaceMesh sm; + if(!CGAL::IO::read_polygon_mesh(filename, sm)) + { + std::cerr << "Invalid input file." << std::endl; + return EXIT_FAILURE; + } + + // A halfedge on the border + halfedge_descriptor bhd = CGAL::Polygon_mesh_processing::longest_border(sm).first; + + // The 2D points of the uv parametrisation will be written into this map + typedef SurfaceMesh::Property_map UV_pmap; + UV_pmap uv_map = sm.add_property_map("v:uv").first; + + SMP::ARAP_parameterizer_3 parameterizer; + SMP::Error_code err = SMP::parameterize(sm, parameterizer, bhd, uv_map); + + if(err != SMP::OK) { + std::cerr << "Error: " << SMP::get_error_message(err) << std::endl; + return EXIT_FAILURE; + } + + std::ofstream out("result.off"); + SMP::IO::output_uvmap_to_off(sm, bhd, uv_map, out); + + return EXIT_SUCCESS; +} diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index 78a9f87f083..988f875425e 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -45,6 +45,8 @@ if(TARGET CGAL::Eigen3_support) # End of SuiteSparse detection # ------------------------------------------------------------------ + create_single_source_cgal_program("ARAP_parameterization.cpp") + target_link_libraries(ARAP_parameterization PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("discrete_authalic.cpp") target_link_libraries(discrete_authalic PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("lscm.cpp") @@ -60,6 +62,7 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program( "iterative_authalic_parameterizer.cpp" ) target_link_libraries(iterative_authalic_parameterizer PUBLIC CGAL::Eigen3_support) if(SuiteSparse_FOUND) + target_link_libraries(ARAP_parameterization PRIVATE ${SuiteSparse_LIBRARIES}) target_link_libraries(orbifold PRIVATE ${SuiteSparse_LIBRARIES}) endif() diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 9f71e2d5dc8..65bd6659902 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -138,7 +138,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code @@ -560,7 +560,6 @@ private: Error_code status = OK; // compute A - unsigned int count = 0; for(vertex_descriptor vd : vertices) { if(!get(vpmap, vd)) { // not yet parameterized // Compute the line i of the matrix A @@ -570,7 +569,6 @@ private: } else { // fixed vertices int index = get(vimap, vd); A.set_coef(index, index, 1, true /*new*/); - ++count; } } return status; @@ -1079,7 +1077,6 @@ private: // Initialize the right hand side B in the linear system "A*X = B" Error_code status = OK; - unsigned int count = 0; for(vertex_descriptor vd : vertices) { if(!get(vpmap, vd)) { // not yet parameterized // Compute the lines i of the vectors Bu and Bv @@ -1092,7 +1089,6 @@ private: const Point_2& uv = get(uvmap, vd); Bu.set(index, uv.x()); Bv.set(index, uv.y()); - ++count; } } return status; @@ -1293,9 +1289,9 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (vimap must be initialized). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h index f311cb9396a..15ac8ec8aef 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h @@ -53,7 +53,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code @@ -157,8 +157,7 @@ public: // Default copy constructor and operator =() are fine /// returns whether the 3D -> 2D mapping is one-to-one. - template + template bool is_one_to_one_mapping(const Triangle_mesh& mesh, halfedge_descriptor bhd, const VertexUVMap uvmap) const diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h index d7b10934389..321f32b99d5 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Circular_border_parameterizer_3.h @@ -119,8 +119,8 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (vimap must be initialized). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h index aeb891cff92..ec6df820e80 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h @@ -54,7 +54,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h index 3d09fad861c..554ce4bf65b 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h @@ -54,7 +54,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph` /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index 2c1d79f2a90..44f86383d32 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -68,7 +68,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code @@ -190,9 +190,9 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The mesh border must be mapped onto a convex polygon. @@ -255,7 +255,6 @@ public: main_border.insert(v); } - int count = 0; for(vertex_descriptor v : vertices){ // inner vertices only if(main_border.find(v) == main_border.end()){ @@ -263,8 +262,6 @@ public: status = setup_inner_vertex_relations(A, Bu, Bv, mesh, v, vimap); if(status != OK) return status; - } else { - count++; } } @@ -323,8 +320,8 @@ protected: /// \param Bv the right hand side vector in the linear system of y coordinates /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. /// /// \pre Vertices must be indexed (`vimap` must be initialized). /// \pre `A`, `Bu`, and `Bv` must be allocated. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index d70453b963a..24cf892b964 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -69,7 +69,7 @@ namespace Surface_mesh_parameterization { /// the \f$ L_2\f$ stretch - as defined by Sander et al. \cgalCite{cgal:ssgh-tmpm-01} - over the mesh. /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code @@ -806,8 +806,8 @@ public: /// \param Bv the right hand side vector in the linear system of y coordinates /// \param tmesh a triangulated surface /// \param bhd a halfedge descriptor on the boundary of `mesh` - /// \param uvmap an instanciation of the class `VertexUVmap` - /// \param vimap an instanciation of the class `VertexIndexMap` + /// \param uvmap an instantiation of the class `VertexUVmap` + /// \param vimap an instantiation of the class `VertexIndexMap` /// /// \pre Vertices must be indexed (`vimap` must be initialized). /// \pre `A`, `Bu`, and `Bv` must be allocated. @@ -1082,9 +1082,9 @@ public: /// /// \param tmesh a triangulated surface /// \param bhd a halfedge descriptor on the boundary of `mesh` - /// \param uvmap an instanciation of the class `VertexUVmap` - /// \param vimap an instanciation of the class `VertexIndexMap` - /// \param vpmap an instanciation of the class `VertexParameterizedMap` + /// \param uvmap an instantiation of the class `VertexUVmap` + /// \param vimap an instantiation of the class `VertexIndexMap` + /// \param vpmap an instantiation of the class `VertexParameterizedMap` /// \param iterations an integer number of iterations to run the parameterization /// /// \pre `tmesh` must be a triangular mesh. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h index 7e6b2aa9cbd..08b74876715 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/LSCM_parameterizer_3.h @@ -61,7 +61,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code @@ -182,9 +182,9 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (`vimap` must be initialized). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index a57a6031b83..665f2077fd4 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -726,8 +726,8 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. /// template diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h index 95593adf95e..019fcb20262 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h @@ -53,7 +53,7 @@ namespace Surface_mesh_parameterization { /// /// \tparam TriangleMesh_ must be a model of `FaceGraph`. /// -/// \tparam BorderParameterizer_ is a Strategy to parameterize the surface border +/// \tparam BorderParameterizer_ is a strategy to parameterize the surface border /// and must be a model of `Parameterizer_3`.
    /// %Default: /// \code diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 0d774636226..39070956d64 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -888,8 +887,8 @@ public: /// \param cmap a mapping of the `vertex_descriptor`s of `mesh` that are cones /// to their respective \link PkgSurfaceMeshParameterizationEnums Cone_type \endlink /// classification. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The underlying mesh of `mesh` is a topological ball. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h index 9c58d2a242f..b806eb1ead6 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Square_border_parameterizer_3.h @@ -273,8 +273,8 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (vimap must be initialized). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index 0cd827b34cf..f43b70f66eb 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -288,9 +288,9 @@ public: /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. - /// \param uvmap an instanciation of the class `VertexUVmap`. - /// \param vimap an instanciation of the class `VertexIndexMap`. - /// \param vpmap an instanciation of the class `VertexParameterizedMap`. + /// \param uvmap an instantiation of the class `VertexUVmap`. + /// \param vimap an instantiation of the class `VertexIndexMap`. + /// \param vpmap an instantiation of the class `VertexParameterizedMap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (vimap must be initialized). diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h index 64739653d23..c4d8651fa74 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/orbifold_enums.h @@ -45,7 +45,7 @@ enum Cone_type /// \ingroup PkgSurfaceMeshParameterizationEnums /// -/// The four Orbifold types available in the Orbifold Tutte parameterization. +/// The four orbifold types available in the Orbifold Tutte parameterization. /// The different shapes result from the number of cones and the angle constraints /// at the cones. enum Orbifold_type @@ -59,7 +59,7 @@ enum Orbifold_type /// \ingroup PkgSurfaceMeshParameterizationEnums /// \brief Convert the orbifold type to a literal message. /// \param orb_type the integer value in the enum -/// \return the string describing the Orbifold type. +/// \return the string describing the orbifold type. const char* get_orbifold_type(int orb_type) { // Messages corresponding to the different orbifold types. diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h index a669eb417f6..4aff7413027 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/parameterize.h @@ -39,7 +39,7 @@ namespace Surface_mesh_parameterization { /// \tparam TriangleMesh must be a model of `FaceGraph`. /// \tparam Parameterizer must be a model of `Parameterizer_3`. /// \tparam HD must be the halfedge_descriptor type corresponding to the graph -/// traits of TriangleMesh. +/// traits of `TriangleMesh`. /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with /// `boost::graph_traits::%vertex_descriptor` as key type and /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) @@ -48,7 +48,7 @@ namespace Surface_mesh_parameterization { /// \param mesh a triangulated surface. /// \param parameterizer a parameterizer. /// \param bhd a halfedge descriptor on the boundary of `mesh`. -/// \param uvmap an instanciation of the class `VertexUVmap`. +/// \param uvmap an instantiation of the class `VertexUVmap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The mesh border must be mapped onto a convex polygon @@ -87,7 +87,7 @@ Error_code parameterize(TriangleMesh& mesh, /// /// \tparam TriangleMesh must be a model of `FaceGraph`. /// \tparam HD must be the halfedge_descriptor type corresponding to the graph -/// traits of TriangleMesh. +/// traits of `TriangleMesh`. /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with /// `boost::graph_traits::%vertex_descriptor` as key type and /// %Point_2 (type deduced from `TriangleMesh` using `Kernel_traits`) @@ -95,7 +95,7 @@ Error_code parameterize(TriangleMesh& mesh, /// /// \param mesh a triangulated surface. /// \param bhd a halfedge descriptor on the boundary of `mesh`. -/// \param uvmap an instanciation of the class `VertexUVmap`. +/// \param uvmap an instantiation of the class `VertexUVmap`. /// /// \pre `mesh` must be a triangular mesh. /// \pre The vertices must be indexed (vimap must be initialized). diff --git a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/auxiliary/graph.h b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/auxiliary/graph.h index 5f357c809ab..03c90101c33 100644 --- a/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/auxiliary/graph.h +++ b/Surface_mesh_segmentation/include/CGAL/Surface_mesh_segmentation/internal/auxiliary/graph.h @@ -53,7 +53,7 @@ This program is available under dual licence: 1) Under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Note that any program that incorporates the code under this licence must, under the terms of the GNU GPL, be released under a licence compatible with the GPL. GNU GPL does not permit incorporating this program into proprietary programs. If you wish to do this, please see the alternative licence available below. -GNU General Public License can be found at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +GNU General Public License can be found at https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 2) Proprietary Licence from UCL Business PLC. To enable programers to include the MaxFlow software in a proprietary system (which is not allowed by the GNU GPL), this licence gives you the right to incorporate the software in your program and distribute under any licence of your choosing. The full terms of the licence and applicable fee, are available from the Licensors at: http://www.uclb-elicensing.com/optimisation_software/maxflow_computervision.html diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp index 389cc215f11..aaf41537b8b 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/TestMesh.cpp @@ -72,6 +72,12 @@ struct TestMeshProgramInstance numIterations = 1; } + ~TestMeshProgramInstance() + { + if (randomizer) + delete randomizer; + } + size_t numIterations; std::string meshName; bool debugMode; @@ -264,7 +270,7 @@ void run_program_instance(po::variables_map& vm) if (vm.count("randomseed")) { - programInstance.randomizer = new CGAL::Random(vm["randomSeed"].as()); + programInstance.randomizer = new CGAL::Random(vm["randomseed"].as()); } programInstance.debugMode = vm["debugmode"].as(); @@ -308,9 +314,9 @@ int main(int argc, char** argv) options.add_options() ("help,h", "Display help message") - ("polyhedron,p", po::value(), "Polyhedron input file") + ("polyhedron,p", po::value()->default_value("./data/test_mesh_6.off"), "Polyhedron input file") ("debugmode,d", po::value()->default_value(false), "Enable debug output") - ("randomseed,r", po::value(), "Randomization seed value") + ("randomseed,r", po::value()->default_value(0), "Randomization seed value") ("trials,t", po::value()->default_value(1), "Number of trials to run") ("kernel,k", po::value()->default_value("epick"), "Kernel to use. One of \'ipick\', \'epick\', \'epeck\'") ; diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h index 8ffe08d081a..f4a5378489b 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h @@ -5,6 +5,8 @@ namespace Surface_mesh_simplification { /*! \ingroup PkgSurfaceMeshSimplificationRef +\deprecated This class is deprecated since \cgal 5.6, the class `Edge_count_ratio_stop_predicate` should be used instead. + The class `Count_ratio_stop_predicate` is a model for the `StopPredicate` concept which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. @@ -12,8 +14,8 @@ which returns `true` when the relation between the initial and current number of \cgalModels `StopPredicate` -\sa `CGAL::Surface_mesh_simplification::Count_stop_predicate` - +\sa `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` */ template< typename TriangleMesh> class Count_ratio_stop_predicate @@ -34,7 +36,7 @@ public: /// @{ /*! - Returns `((double)current_edge_count / (double)initial_edge_count) < ratio`. + Returns `(double(current_edge_count) / double(initial_edge_count)) < ratio`. All other parameters are ignored (but exist since this is a generic policy). */ bool operator()(const Edge_profile::FT current_cost, diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h index 7e6deb0254a..bef9e2fdba9 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h @@ -4,6 +4,8 @@ namespace Surface_mesh_simplification { /*! \ingroup PkgSurfaceMeshSimplificationRef +\deprecated This class is deprecated since \cgal 5.6, the class `Edge_count_stop_predicate` should be used instead. + The class `Count_stop_predicate` is a model for the `StopPredicate` concept, which returns `true` when the number of current edges drops below a certain threshold. @@ -11,8 +13,8 @@ which returns `true` when the number of current edges drops below a certain thre \cgalModels `StopPredicate` -\sa `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` - +\sa `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` */ template class Count_stop_predicate diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..fed8537304f --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h @@ -0,0 +1,50 @@ + +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Edge_count_ratio_stop_predicate` is a model for the `StopPredicate` concept +which returns `true` when the relation between the initial and current number of edges drops below a certain ratio. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` +*/ +template< typename TriangleMesh> +class Edge_count_ratio_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `ratio`. + */ + Edge_count_ratio_stop_predicate(const double ratio); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `(double(current_edge_count) / double(initial_edge_count)) < ratio`. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h new file mode 100644 index 00000000000..6e3920dd421 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h @@ -0,0 +1,48 @@ +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Edge_count_stop_predicate` is a model for the `StopPredicate` concept, +which returns `true` when the number of current edges drops below a certain threshold. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Edge_ratio_count_stop_predicate` +*/ +template +class Edge_count_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `threshold` value. + */ + Edge_count_stop_predicate(const Edge_profile::edges_size_type threshold); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `(current_edge_count < threshold)`. All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT& current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..f5154aeb0d8 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h @@ -0,0 +1,51 @@ + +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Face_count_ratio_stop_predicate` is a model for the `StopPredicate` concept +which returns `true` when the relation between the initial and current number of faces drops below a certain ratio. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +*/ +template< typename TriangleMesh> +class Face_count_ratio_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `ratio`. + */ + Face_count_ratio_stop_predicate(const double ratio, const TriangleMesh& tmesh); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `true` if the ratio of current face count over initial face count is strictly smaller than `ratio`, + and `false` otherwise. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h new file mode 100644 index 00000000000..8c35a5c35e7 --- /dev/null +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h @@ -0,0 +1,49 @@ +namespace CGAL { +namespace Surface_mesh_simplification { + +/*! +\ingroup PkgSurfaceMeshSimplificationRef + +\cgalModels `StopPredicate` + +The class `Face_count_stop_predicate` is a model for the `StopPredicate` concept, +which returns `true` when the number of current faces drops below a certain threshold. + +\tparam TriangleMesh is the type of surface mesh being simplified, and must be a model of the `MutableFaceGraph` and `HalfedgeListGraph` concepts. + +\sa `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\sa `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` +*/ +template +class Face_count_stop_predicate +{ +public: + + /// \name Creation + /// @{ + + /*! + Initializes the predicate establishing the `threshold` value. + */ + Face_count_stop_predicate(const Edge_profile::edges_size_type threshold); + + /// @} + + /// \name Operations + /// @{ + + /*! + Returns `true` if the current face count is strictly smaller than `threshold`, and `false` otherwise. + All other parameters are ignored (but exist since this is a generic policy). + */ + bool operator()(const Edge_profile::FT& current_cost, + const Edge_profile& edge_profile, + const Edge_profile::edges_size_type initial_edge_count, + const Edge_profile::edges_size_type current_edge_count) const; + + /// @} + +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h index b24bc09c99e..ad5f22d4ccb 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Concepts/StopPredicate.h @@ -4,8 +4,10 @@ The concept `StopPredicate` describes the requirements for the predicate which indicates if the simplification process must finish. -\cgalHasModel `CGAL::Surface_mesh_simplification::Count_stop_predicate` -\cgalHasModel `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +\cgalHasModel `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` \cgalHasModel `CGAL::Surface_mesh_simplification::Edge_length_stop_predicate` */ diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt index f29f913fc0a..1d97e670f9d 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/PackageDescription.txt @@ -34,8 +34,12 @@ - `CGAL::Surface_mesh_simplification::edge_collapse()` \cgalCRPSection{Policies} -- `CGAL::Surface_mesh_simplification::Count_stop_predicate` -- `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` +- `CGAL::Surface_mesh_simplification::Count_stop_predicate` (deprecated) +- `CGAL::Surface_mesh_simplification::Count_ratio_stop_predicate` (deprecated) +- `CGAL::Surface_mesh_simplification::Edge_count_stop_predicate` +- `CGAL::Surface_mesh_simplification::Face_count_stop_predicate` +- `CGAL::Surface_mesh_simplification::Edge_count_ratio_stop_predicate` +- `CGAL::Surface_mesh_simplification::Face_count_ratio_stop_predicate` - `CGAL::Surface_mesh_simplification::Edge_length_stop_predicate` - `CGAL::Surface_mesh_simplification::Edge_length_cost` - `CGAL::Surface_mesh_simplification::Midpoint_placement` diff --git a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Surface_mesh_simplification.txt b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Surface_mesh_simplification.txt index 7bef367dd3a..31c3939c926 100644 --- a/Surface_mesh_simplification/doc/Surface_mesh_simplification/Surface_mesh_simplification.txt +++ b/Surface_mesh_simplification/doc/Surface_mesh_simplification/Surface_mesh_simplification.txt @@ -412,7 +412,7 @@ Note that these policies depend on the third party \ref thirdpartyEigen library. \section SimplificationDesign Design and Implementation History The core of the package, as well as most of the simplification strategies, are the work of Fernando Cacciola, -betwen 2006 and 2009. +between 2006 and 2009. Andreas Fabri added the `Surface_mesh_simplification::Bounded_normal_change_placement` functionality in \cgal 4.11. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp index ae8c50b4c45..7612d7436e2 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_OpenMesh.cpp @@ -5,7 +5,7 @@ // Simplification function #include -#include +#include #include #include @@ -70,7 +70,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000) const std::size_t stop_n = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(stop_n); + SMS::Edge_count_stop_predicate stop(stop_n); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index e8d0ba8ba1b..88eb9b986e7 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number const std::size_t stop_n = (argc > 2) ? std::stoi(argv[2]) : num_halfedges(surface_mesh)/2 - 1; - SMS::Count_stop_predicate stop(stop_n); + SMS::Edge_count_stop_predicate stop(stop_n); typedef SMS::LindstromTurk_placement Placement; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp index 678087c38b2..f40a35faeae 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrain_sharp_edges.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -121,7 +121,7 @@ int main(int argc, char** argv) std::cerr << "# sharp edges = " << nb_sharp_edges << std::endl; // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); std::cout << "Collapsing as many non-sharp edges of mesh: " << filename << " as possible..." << std::endl; int r = SMS::edge_collapse(surface_mesh, stop, diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp index 9c50a593725..1fcb9ce4e05 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp @@ -11,7 +11,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -78,7 +78,7 @@ int main(int argc, char** argv) } // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); Border_is_constrained_edge_map bem(surface_mesh); // This the actual call to the simplification algorithm. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp index b60753cddfc..4d3418e9abe 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp @@ -11,7 +11,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -77,7 +77,7 @@ int main(int argc, char** argv) } // Contract the surface mesh as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); Border_is_constrained_edge_map bem(surface_mesh); // This the actual call to the simplification algorithm. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp index d8b574b241f..a48e1833bb3 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below xx% of the initial count const double ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); // The index maps are not explicitelty passed as in the previous // example because the surface mesh items have a proper id() field. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp index 6b8ee4e8902..7fc05ffc8b8 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_envelope.cpp @@ -3,7 +3,7 @@ #include -#include +#include #include #include #include @@ -33,7 +33,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : CGAL::data_file_path("meshes/helmet.off")); is >> mesh; - SMS::Count_stop_predicate stop(0); // go as far as you can while in the envelope + SMS::Edge_count_stop_predicate stop(0); // go as far as you can while in the envelope CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(mesh)); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp index ef14f4f94ba..8a70a30d560 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp @@ -1,11 +1,13 @@ #include #include -#include +#include #include #include #include +#include + #include #include #include @@ -29,13 +31,13 @@ void collapse_gh(Surface_mesh& mesh, { std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now(); - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); // Garland&Heckbert simplification policies typedef typename GHPolicies::Get_cost GH_cost; typedef typename GHPolicies::Get_placement GH_placement; - typedef SMS::Bounded_normal_change_placement Bounded_GH_placement; + typedef SMS::Bounded_normal_change_placement Bounded_GH_placement; GHPolicies gh_policies(mesh); const GH_cost& gh_cost = gh_policies.get_cost(); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp index 3528fb06646..4bedf34619a 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp @@ -4,7 +4,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -42,7 +42,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000 by default) const std::size_t edge_count_treshold = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(edge_count_treshold); + SMS::Edge_count_stop_predicate stop(edge_count_treshold); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp index a46b5ab76db..712afa46742 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_polyhedron.cpp @@ -5,7 +5,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -36,7 +36,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000) const std::size_t edge_count_treshold = (argc > 2) ? std::stoi(argv[2]) : 1000; - SMS::Count_stop_predicate stop(edge_count_treshold); + SMS::Edge_count_stop_predicate stop(edge_count_treshold); // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index d0bce9ca051..d21417d9829 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -36,7 +36,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below 10% of the initial count double stop_ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(stop_ratio); + SMS::Edge_count_ratio_stop_predicate stop(stop_ratio); int r = SMS::edge_collapse(surface_mesh, stop); diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp index 2568e555755..f0b747108a6 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp @@ -8,7 +8,7 @@ #include // Stop-condition policy -#include +#include #include #include @@ -112,7 +112,7 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below xx% of the initial count const double ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); Stats stats; My_visitor vis(&stats); diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h index eaa2849e61b..36b784e4dbf 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_ratio_stop_predicate.h @@ -13,48 +13,24 @@ #include -#include -#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include + +#ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { namespace Surface_mesh_simplification { -//******************************************************************************************************************* -// -= stopping condition predicate =- -// -// Determines whether the simplification has finished. -// The arguments are (current_cost,vertex,vertex,is_edge,initial_pair_count,current_pair_count,surface) and the result is bool -// -//******************************************************************************************************************* - -// Stops when the ratio of initial to current vertex pairs is below some value. +// Stops when the ratio of initial to current number of edges is below some value. template -class Count_ratio_stop_predicate -{ -public: - typedef TM_ TM; - typedef typename boost::graph_traits::edges_size_type size_type; - - Count_ratio_stop_predicate(const double ratio) - : m_ratio(ratio) - { - CGAL_warning(0. < ratio && ratio <= 1.); - } - - template - bool operator()(const F& /*current_cost*/, - const Profile& /*profile*/, - size_type initial_edge_count, - size_type current_edge_count) const - { - return (static_cast(current_edge_count) / static_cast(initial_edge_count)) < m_ratio; - } - -private: - double m_ratio; -}; +using Count_ratio_stop_predicate CGAL_DEPRECATED = Edge_count_ratio_stop_predicate; } // namespace Surface_mesh_simplification } // namespace CGAL +#endif // CGAL_NO_DEPRECATED_CODE + #endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_COUNT_RATIO_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h index ddc7e7a4843..66b0f5fb8c9 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h @@ -13,46 +13,24 @@ #include -#include -#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include + +#ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { namespace Surface_mesh_simplification { -//******************************************************************************************************************* -// -= stopping condition predicate =- -// -// Determines whether the simplification has finished. -// The arguments are (current_cost,vertex,vertex,is_edge,initial_pair_count,current_pair_count,surface) and the result is bool -// -//******************************************************************************************************************* - // Stops when the number of edges left falls below a given number. template -class Count_stop_predicate -{ -public: - typedef TM_ TM; - typedef typename boost::graph_traits::edges_size_type size_type; - - Count_stop_predicate(const std::size_t edge_count_threshold) - : m_edge_count_threshold(edge_count_threshold) - { } - - template - bool operator()(const F& /*current_cost*/, - const Profile& /*profile*/, - std::size_t /*initial_edge_count*/, - std::size_t current_edge_count) const - { - return current_edge_count < m_edge_count_threshold; - } - -private: - std::size_t m_edge_count_threshold; -}; +using Count_stop_predicate CGAL_DEPRECATED = Edge_count_stop_predicate; } // namespace Surface_mesh_simplification } // namespace CGAL +#endif // CGAL_NO_DEPRECATED_CODE + #endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..13123440d86 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_ratio_stop_predicate.h @@ -0,0 +1,52 @@ +// Copyright (c) 2006 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) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_RATIO_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_RATIO_STOP_PREDICATE_H + +#include + +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the ratio of initial to current number of edges is below some value. +template +class Edge_count_ratio_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Edge_count_ratio_stop_predicate(const double ratio) + : m_ratio(ratio) + { + CGAL_warning(0. < ratio && ratio <= 1.); + } + + template + bool operator()(const F& /*current_cost*/, + const Profile& /*profile*/, + size_type initial_edge_count, + size_type current_edge_count) const + { + return (static_cast(current_edge_count) / static_cast(initial_edge_count)) < m_ratio; + } + +private: + double m_ratio; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_RATIO_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h new file mode 100644 index 00000000000..aa3de2159a9 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_count_stop_predicate.h @@ -0,0 +1,50 @@ +// Copyright (c) 2006 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) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H + +#include + +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the number of edges falls below a given number. +template +class Edge_count_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Edge_count_stop_predicate(const std::size_t edge_count_threshold) + : m_edge_count_threshold(edge_count_threshold) + { } + + template + bool operator()(const F& /*current_cost*/, + const Profile& /*profile*/, + std::size_t /*initial_edge_count*/, + std::size_t current_edge_count) const + { + return current_edge_count < m_edge_count_threshold; + } + +private: + std::size_t m_edge_count_threshold; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_EDGE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h new file mode 100644 index 00000000000..d349c948181 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_ratio_stop_predicate.h @@ -0,0 +1,56 @@ +// Copyright (c) 2006 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) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_RATIO_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_RATIO_STOP_PREDICATE_H + +#include + +#include +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the ratio of initial to current number of faces is below some value. +template +class Face_count_ratio_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::edges_size_type size_type; + + Face_count_ratio_stop_predicate(const double ratio, + const TM& tmesh) + : m_ratio(ratio), m_initial_face_count(CGAL::internal::exact_num_faces(tmesh)) + { + CGAL_warning(0. < ratio && ratio <= 1.); + } + + template + bool operator()(const F& /*current_cost*/, + const Profile& profile, + size_type /*initial_edge_count*/, + size_type /*current_edge_count*/) const + { + const std::size_t current_face_count = CGAL::internal::exact_num_faces(profile.surface_mesh()); + return (static_cast(current_face_count) / static_cast(m_initial_face_count)) < m_ratio; + } + +private: + const double m_ratio; + const std::size_t m_initial_face_count; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_RATIO_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h new file mode 100644 index 00000000000..873cac7c320 --- /dev/null +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h @@ -0,0 +1,52 @@ +// Copyright (c) 2006 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) : Fernando Cacciola +// +#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H +#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H + +#include + +#include +#include +#include + +namespace CGAL { +namespace Surface_mesh_simplification { + +// Stops when the number of faces falls below a given number. +template +class Face_count_stop_predicate +{ +public: + typedef TM_ TM; + typedef typename boost::graph_traits::faces_size_type size_type; + + Face_count_stop_predicate(const std::size_t face_count_threshold) + : m_face_count_threshold(face_count_threshold) + { } + + template + bool operator()(const F& /*current_cost*/, + const Profile& profile, + std::size_t /*initial_edge_count*/, + std::size_t /*current_edge_count*/) const + { + const std::size_t current_face_count = CGAL::internal::exact_num_faces(profile.surface_mesh()); + return (current_face_count < m_face_count_threshold); + } + +private: + std::size_t m_face_count_threshold; +}; + +} // namespace Surface_mesh_simplification +} // namespace CGAL + +#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_EDGE_COLLAPSE_FACE_COUNT_STOP_PREDICATE_H diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index 86599afd28e..2f55474593a 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -11,6 +11,7 @@ create_single_source_cgal_program("test_edge_collapse_bounded_distance.cpp") create_single_source_cgal_program("test_edge_collapse_Envelope.cpp") create_single_source_cgal_program("test_edge_collapse_Polyhedron_3.cpp") create_single_source_cgal_program("test_edge_profile_link.cpp") +create_single_source_cgal_program("test_edge_deprecated_stop_predicates.cpp") find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h b/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h index 703a7f4c194..e1363e7fed6 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/basics.h @@ -32,7 +32,8 @@ void Surface_simplification_external_trace(std::string s) #include #include #include -#include +#include +#include #include #include diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp index 9b7bd975503..32505153d06 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_garland_heckbert_variations.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -102,7 +102,7 @@ Surface_mesh edge_collapse(Surface_mesh& mesh, const Cost& cost = p.get_cost(); const Placement& unbounded_placement = p.get_placement(); Bounded_placement bounded_placement(unbounded_placement); - SMS::Count_ratio_stop_predicate stop(ratio); + SMS::Edge_count_ratio_stop_predicate stop(ratio); std::chrono::time_point start_time = std::chrono::steady_clock::now(); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp index 5e0ab17d1d6..479a7687dda 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_topology.cpp @@ -8,7 +8,7 @@ #include // Stop-condition policy -#include +#include typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Surface; @@ -36,7 +36,7 @@ int main(int argc, char** argv) std::cout << "Initial count " << initial_count << " edges.\n"; // Contract the surface as much as possible - SMS::Count_stop_predicate stop(0); + SMS::Edge_count_stop_predicate stop(0); int r = SMS::edge_collapse (surface diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp index d7228a1406a..cb52e089ede 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Envelope.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include #include @@ -96,7 +96,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : "data/helmet.off"); is >> input_mesh; - SMS::Count_stop_predicate stop(0); // go as far as you can while in the envelope + SMS::Edge_count_stop_predicate stop(0); // go as far as you can while in the envelope Stats stats; My_visitor vis(&stats); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index 7c641c5eb69..b81c477049c 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -378,7 +378,7 @@ bool Test (string aName) set_halfedgeds_items_id(lSurface); - SMS::Count_stop_predicate stop(sStop); + SMS::Edge_count_stop_predicate stop(sStop); Real_timer t; t.start(); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp index 0764b881fe1..f6cd535bf50 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_bounded_distance.cpp @@ -4,7 +4,7 @@ // Simplification function #include #include -#include +#include #include #include @@ -42,7 +42,7 @@ int main(int argc, char** argv) std::ifstream is(argc > 1 ? argv[1] : "data/helmet.off"); is >> ref_mesh; - SMS::Count_stop_predicate stop(num_halfedges(ref_mesh)/10); + SMS::Edge_count_stop_predicate stop(num_halfedges(ref_mesh)/10); std::cout << "input has " << num_vertices(ref_mesh) << " vertices." << std::endl; CGAL::Iso_cuboid_3 bbox(CGAL::Polygon_mesh_processing::bbox(ref_mesh)); diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_deprecated_stop_predicates.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_deprecated_stop_predicates.cpp new file mode 100644 index 00000000000..238a796eb03 --- /dev/null +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_deprecated_stop_predicates.cpp @@ -0,0 +1,170 @@ +#include + +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +// deprecated +#include +#include + +#include +#include + +#include + +typedef CGAL::Simple_cartesian K; +typedef CGAL::Surface_mesh Mesh; + +namespace SMS = CGAL::Surface_mesh_simplification; + +typedef SMS::Edge_count_stop_predicate Edge_count_stop; +typedef SMS::Face_count_stop_predicate Face_count_stop; +typedef SMS::Edge_count_ratio_stop_predicate Edge_count_ratio_stop; +typedef SMS::Face_count_ratio_stop_predicate Face_count_ratio_stop; + +typedef SMS::Count_stop_predicate Count_stop; +typedef SMS::Count_ratio_stop_predicate Count_ratio_stop; + +typedef SMS::Count_ratio_stop_predicate Count_ratio_stop; + +typedef SMS::Edge_length_cost Cost; +typedef SMS::Midpoint_placement Placement; + +int main(int argc, char** argv) +{ + const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cube-meshed.off"); + + Mesh mesh; + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) + { + std::cerr << "Failed to read input mesh: " << filename << std::endl; + return EXIT_FAILURE; + } + + if(!CGAL::is_triangle_mesh(mesh)) + { + std::cerr << "Input geometry is not triangulated." << std::endl; + return EXIT_FAILURE; + } + + std::cout << "Input mesh has " << num_vertices(mesh) << " nv " + << num_edges(mesh) << " ne " + << num_faces(mesh) << " nf" << std::endl; + + Cost cost; + Placement placement; + + // Edge_count_stop + { + Mesh mesh_cpy = mesh; + const std::size_t expected_ne = num_edges(mesh_cpy) / 2; + Edge_count_stop stop(expected_ne); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_edges(mesh_cpy) < expected_ne); + } + + // Count_stop + { + Mesh mesh_cpy = mesh; + const std::size_t expected_ne = num_edges(mesh_cpy) + 1; + Count_stop stop(expected_ne); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_edges(mesh_cpy) < expected_ne); + } + + // Face_count_stop + { + Mesh mesh_cpy = mesh; + const std::size_t expected_nf = num_faces(mesh_cpy) / 4; + Face_count_stop stop(expected_nf); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_faces(mesh_cpy) < expected_nf); + } + + /// RATIO + + // Edge_count_ratio_stop + { + Mesh mesh_cpy = mesh; + const double ratio = 0.5; + const std::size_t initial_ne = num_edges(mesh_cpy); + Edge_count_ratio_stop stop(ratio); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_edges(mesh_cpy) / initial_ne < ratio); + } + + // Count_ratio_stop + { + Mesh mesh_cpy = mesh; + const double ratio = 1.; + const std::size_t initial_ne = num_edges(mesh_cpy); + Count_ratio_stop stop(ratio); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_edges(mesh_cpy) / initial_ne < ratio); + } + + // Face_count_ratio_stop + { + Mesh mesh_cpy = mesh; + const double ratio = 0.7; + const std::size_t initial_nf = num_faces(mesh_cpy); + Face_count_ratio_stop stop(ratio, mesh_cpy); + SMS::edge_collapse(mesh_cpy, stop, + CGAL::parameters::get_cost(cost) + .get_placement(placement)); + + std::cout << "Output mesh has " << CGAL::internal::exact_num_vertices(mesh_cpy) << " nv " + << CGAL::internal::exact_num_edges(mesh_cpy) << " ne " + << CGAL::internal::exact_num_faces(mesh_cpy) << " nf" << std::endl; + + assert(CGAL::internal::exact_num_faces(mesh_cpy) / initial_nf < ratio); + } + + return 0; +} + diff --git a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h index 9e6385a8a7e..3c11f859619 100644 --- a/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h +++ b/Surface_mesh_skeletonization/include/CGAL/Mean_curvature_flow_skeletonization.h @@ -392,7 +392,7 @@ public: const Traits& traits = Traits()) : m_traits(traits), m_weight_calculator(true /* use_clamped_version */) { - init(tmesh); + init(tmesh, get(vertex_point, tmesh)); } #endif /// @} Constructor @@ -513,6 +513,29 @@ public: m_omega_P = value; } + /// \cgalAdvancedFunction + /// \cgalAdvancedBegin + /// sets the vertices in the range `[begin, end)` as fixed. Fixed vertices will not be moved + /// during contraction and this will therefore prevent convergence + /// towards the skeleton if `contract_until_convergence()` is used. + /// It is useful only if the end goal is to retrieve the meso-skeleton + /// after a number of `contract_geometry()`, keeping the specified + /// vertices fixed in place. + /// \tparam InputIterator a model of `InputIterator` with `boost::graph_traits::%vertex_descriptor` as value type. + /// \cgalAdvancedEnd + template + void set_fixed_vertices(InputIterator begin, InputIterator end) + { + std::unordered_set set(begin, end); + + for(vertex_descriptor vd : vertices(m_tmesh)) + { + if (set.find(vd->vertices[0]) != set.end()) { + vd->is_fixed = true; + } + } + } + /// \cond SKIP_FROM_MANUAL void set_zero_TH(double value) { @@ -843,12 +866,13 @@ private: } /// Initialize some global data structures such as vertex id. - void init(const TriangleMesh& tmesh) + void init(const TriangleMesh& tmesh, VertexPointMap vpm) { typedef std::pair Vertex_pair; std::vector v2v; copy_face_graph(tmesh, m_tmesh, - CGAL::parameters::vertex_to_vertex_output_iterator(std::back_inserter(v2v))); + CGAL::parameters::vertex_to_vertex_output_iterator( + std::back_inserter(v2v)).vertex_point_map(vpm)); // copy input vertices to keep correspondence for(const Vertex_pair& vp : v2v) diff --git a/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt b/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt index 53106ce0049..97f1f3bad7e 100644 --- a/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt +++ b/Surface_mesh_topology/doc/Surface_mesh_topology/PackageDescription.txt @@ -1,10 +1,10 @@ -/// \defgroup PkgSurfaceMeshTopology Surface Mesh Topology Reference +/// \defgroup PkgSurfaceMeshTopologyRef Surface Mesh Topology Reference /// \defgroup PkgSurfaceMeshTopologyConcepts Concepts -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /// \defgroup PkgSurfaceMeshTopologyClasses Classes -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /*! \code @@ -12,17 +12,17 @@ \endcode */ /// \defgroup PkgDrawFaceGraphWithPaths Draw a Mesh with Paths -/// \ingroup PkgSurfaceMeshTopology +/// \ingroup PkgSurfaceMeshTopologyRef /*! -\addtogroup PkgSurfaceMeshTopology +\addtogroup PkgSurfaceMeshTopologyRef \cgalPkgDescriptionBegin{Surface Mesh Topology,PkgSurfaceMeshTopology} \cgalPkgPicture{surface-mesh-topology-logo.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Guillaume Damiand, Francis Lazarus} \cgalPkgDesc{This package provides a toolbox for manipulating curves on a combinatorial surface from the topological point of view. Two main functionalities are proposed. One is the computation of shortest curves that cannot be continuously deformed to a point. This includes the computation of the so-called edge width and face width of the vertex-edge graph of a combinatorial surface. The other functionality is the homotopy test for deciding if two given curves on a combinatorial surface can be continuously deformed one into the other.} -\cgalPkgManuals{Chapter_Surface_Mesh_Topology,PkgSurfaceMeshTopology} +\cgalPkgManuals{Chapter_Surface_Mesh_Topology,PkgSurfaceMeshTopologyRef} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{5.1} diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 0afd17425fb..4a489b19ff1 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -54,17 +54,16 @@ template void draw_facewidth(const LCC& lcc, const std::vector& cycle) { - int nbv=0, nbf=0; typename LCC::size_type vertex_mark = lcc.get_new_mark(); typename LCC::size_type face_mark = lcc.get_new_mark(); for (std::size_t i=0; i(cycle[i], vertex_mark); ++nbv; } + { lcc.template mark_cell<0>(cycle[i], vertex_mark); } // Color the face if (!lcc.is_marked(cycle[i], face_mark)) - { lcc.template mark_cell<2>(cycle[i], face_mark); ++nbf; } + { lcc.template mark_cell<2>(cycle[i], face_mark); } } Facewidth_draw_functor df(vertex_mark, face_mark); diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index f5eb723ef7f..f167c9a13da 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -11,8 +11,7 @@ if(CGAL_ImageIO_FOUND) create_single_source_cgal_program("mesh_an_implicit_function.cpp") else() - - if(RUNNING_CGAL_AUTO_TEST) + if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE) # Just to avoid a warning from CMake if that variable is set on the command line... endif() diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h index 76d4c88cdaf..27362bda2f8 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h @@ -54,46 +54,6 @@ namespace CGAL { namespace Surface_mesher { - /** - Type and functions required in GT: - - Compute_scalar_product_3 (from rev. 29646) - - Compute_squared_distance_3 - - Compute_squared_radius_3 - - Construct_center_3 - - Construct_midpoint_3 - - Construct_point_on_3 (from rev. 29646) - - Construct_scaled_vector_3 - - Construct_segment_3 (from rev. 29646) - - Construct_translated_point_3 - - Construct_vector_3 - - FT - - Has_on_bounded_side_3 (from rev. 29646) - - Line_3 - - Point_3 - - Ray_3 - - Segment_3 - - Sphere_3 - - Vector_3 (from rev. 29646) - - compute_scalar_product_3_object (from rev. 29646) - - compute_squared_distance_3_object - - compute_squared_radius_3_object - - construct_center_3_object - - construct_line_3_object (no longer, since rev. 29646) - - construct_midpoint_3_object - - construct_point_on_3_object (from rev. 29646) - - construct_scaled_vector_3_object - - construct_segment_3_object (from rev. 29646) - - construct_translated_point_3_object - - construct_vector_3_object - - has_on_bounded_side_3_object (from rev. 29646) -(Computed by use of: - perl -ne '/GT\(\)\.([a-zA-Z_0-9]+)/ - && print "$1\n";' {implicit_surface_oracle_3.h,Sphere_oracle_3.h} | sort -u - perl -ne '/GT::([a-zA-Z_0-9]+)/ - && print "$1\n";' {implicit_surface_oracle_3.h,Sphere_oracle_3.h} | sort -u -) - */ - namespace { template diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h index 1638fc00565..71b6cb08cbd 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h @@ -107,15 +107,17 @@ namespace CGAL { { #ifdef CGAL_SURFACE_MESHER_VERBOSE std::cerr << "scanning vertices" << std::endl; -#endif int n = 0; +#endif for (Finite_vertices_iterator vit = SMMBB::tr.finite_vertices_begin(); vit != SMMBB::tr.finite_vertices_end(); ++vit) { if ( (SMMBB::c2t3.face_status(vit) // @TODO: appeler is_regular == C2t3::SINGULAR) ) { bad_vertices.insert( vit ); +#ifdef CGAL_SURFACE_MESHER_VERBOSE ++n; +#endif } } bad_vertices_initialized = true; diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h index 815ca228874..25095602a93 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_regular_edges.h @@ -213,8 +213,8 @@ namespace CGAL { if(withBoundary) std::cerr << "(boundaries allowed)"; std::cerr << "...\n"; -#endif int n = 0; +#endif for (Finite_edges_iterator eit = SMB::tr.finite_edges_begin(); eit != SMB::tr.finite_edges_end(); ++eit) { if ( (SMB::c2t3.face_status(*eit) @@ -223,7 +223,9 @@ namespace CGAL { (SMB::c2t3.face_status(*eit) == C2t3::BOUNDARY) ) ) { bad_edges.insert( edge_to_edgevv(*eit) ); +#ifdef CGAL_SURFACE_MESHER_VERBOSE ++n; +#endif } } bad_edges_initialized = true; diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index c49536c1a2e..79f0b1b4022 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -240,8 +240,8 @@ public: Vertex_handle mirror_vertex(Face_handle f, int i) const { - CGAL_triangulation_precondition ( f->neighbor(i) != Face_handle() - && f->dimension() >= 1); + CGAL_precondition ( f->neighbor(i) != Face_handle() + && f->dimension() >= 1); return f->neighbor(i)->vertex(mirror_index(f,i)); } @@ -249,8 +249,8 @@ public: mirror_index(Face_handle f, int i) const { // return the index of opposite vertex in neighbor(i); - CGAL_triangulation_precondition (f->neighbor(i) != Face_handle() && - f->dimension() >= 1); + CGAL_precondition (f->neighbor(i) != Face_handle() && + f->dimension() >= 1); if (f->dimension() == 1) { CGAL_assertion(i<=1); const int j = f->neighbor(i)->index(f->vertex((i==0) ? 1 : 0)); @@ -263,8 +263,8 @@ public: Edge mirror_edge(const Edge e) const { - CGAL_triangulation_precondition(e.first->neighbor(e.second) != Face_handle() - && e.first->dimension() >= 1); + CGAL_precondition(e.first->neighbor(e.second) != Face_handle() + && e.first->dimension() >= 1); return Edge(e.first->neighbor(e.second), mirror_index(e.first, e.second)); } @@ -461,7 +461,7 @@ public: void insert_in_hole(Vertex_handle v, FaceIt face_begin, FaceIt face_end) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::vector new_faces; std::vector bdry_edges; @@ -604,7 +604,7 @@ public: // the triangulation is assumed to have dim=2 // hole is supposed to be ccw oriented { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); EdgeIt eit = edge_begin; FaceIt fit = face_begin; @@ -742,7 +742,7 @@ void Triangulation_data_structure_2:: swap(Tds &tds) { - CGAL_triangulation_expensive_precondition(tds.is_valid() && is_valid()); + CGAL_expensive_precondition(tds.is_valid() && is_valid()); std::swap(_dimension, tds._dimension); faces().swap(tds.faces()); vertices().swap(tds.vertices()); @@ -895,7 +895,7 @@ void Triangulation_data_structure_2:: flip(Face_handle f, int i) { - CGAL_triangulation_precondition( dimension()==2); + CGAL_precondition( dimension()==2); Face_handle n = f->neighbor(i); int ni = mirror_index(f,i); //ni = n->index(f); @@ -930,8 +930,8 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_first( ) { - CGAL_triangulation_precondition( number_of_vertices() == 0 && - dimension()==-2 ); + CGAL_precondition( number_of_vertices() == 0 && + dimension()==-2 ); return insert_dim_up(); } @@ -940,8 +940,8 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: insert_second() { - CGAL_triangulation_precondition( number_of_vertices() == 1 && - dimension()==-1 ); + CGAL_precondition( number_of_vertices() == 1 && + dimension()==-1 ); return insert_dim_up(); } @@ -953,7 +953,7 @@ Triangulation_data_structure_2:: insert_in_face(Face_handle f) // New vertex will replace f->vertex(0) in face f { - CGAL_triangulation_precondition( f != Face_handle() && dimension()== 2); + CGAL_precondition( f != Face_handle() && dimension()== 2); Vertex_handle v = create_vertex(); Vertex_handle v0 = f->vertex(0); @@ -992,11 +992,11 @@ Triangulation_data_structure_2:: insert_in_edge(Face_handle f, int i) //insert in the edge opposite to vertex i of face f { - CGAL_triangulation_precondition(f != Face_handle() && dimension() >= 1); - if (dimension() == 1) {CGAL_triangulation_precondition(i == 2);} - if (dimension() == 2) {CGAL_triangulation_precondition(i == 0 || - i == 1 || - i == 2);} + CGAL_precondition(f != Face_handle() && dimension() >= 1); + if (dimension() == 1) {CGAL_precondition(i == 2);} + if (dimension() == 2) {CGAL_precondition(i == 0 || + i == 1 || + i == 2);} Vertex_handle v; if (dimension() == 1) { v = create_vertex(); @@ -1118,7 +1118,7 @@ insert_dim_up(Vertex_handle w, bool orient) } break; default: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); break; } return v; } @@ -1130,11 +1130,11 @@ Triangulation_data_structure_2:: remove_degree_3(Vertex_handle v, Face_handle f) // remove a vertex of degree 3 { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(degree(v) == 3); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(degree(v) == 3); if (f == Face_handle()) {f= v->face();} - else { CGAL_triangulation_assertion( f->has_vertex(v));} + else { CGAL_assertion( f->has_vertex(v));} int i = f->index(v); Face_handle left = f->neighbor(cw(i)); @@ -1144,7 +1144,7 @@ remove_degree_3(Vertex_handle v, Face_handle f) Face_handle ll, rr; Vertex_handle q = left->vertex(li); - CGAL_triangulation_assertion( left->vertex(li) == right->vertex(ri)); + CGAL_assertion( left->vertex(li) == right->vertex(ri)); ll = left->neighbor(cw(li)); if(ll != Face_handle()) { @@ -1177,11 +1177,11 @@ void Triangulation_data_structure_2:: dim_down(Face_handle f, int i) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() == 2 ); - CGAL_triangulation_precondition( number_of_vertices() > 3 ); - CGAL_triangulation_precondition( degree( f->vertex(i) ) == - number_of_vertices()-1 ); + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( dimension() == 2 ); + CGAL_precondition( number_of_vertices() > 3 ); + CGAL_precondition( degree( f->vertex(i) ) == + number_of_vertices()-1 ); Vertex_handle v = f->vertex(i); std::list to_delete; @@ -1236,7 +1236,7 @@ remove_dim_down(Vertex_handle v) break; case 1: case 2: -// CGAL_triangulation_precondition ( +// CGAL_precondition ( // (dimension() == 1 && number_of_vertices() == 3) || // (dimension() == 2 && number_of_vertices() > 3) ); // the faces incident to v are down graded one dimension @@ -1282,12 +1282,12 @@ void Triangulation_data_structure_2:: remove_1D(Vertex_handle v) { - CGAL_triangulation_precondition( dimension() == 1 && - number_of_vertices() > 3); + CGAL_precondition( dimension() == 1 && + number_of_vertices() > 3); Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion( f->index(v) == 1); + CGAL_assertion( f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); set_adjacency(f, 0, g->neighbor(0), 1); @@ -1304,8 +1304,8 @@ inline void Triangulation_data_structure_2:: remove_second(Vertex_handle v) { - CGAL_triangulation_precondition(number_of_vertices()== 2 && - dimension() == 0); + CGAL_precondition(number_of_vertices()== 2 && + dimension() == 0); remove_dim_down(v); return; } @@ -1316,8 +1316,8 @@ inline void Triangulation_data_structure_2:: remove_first(Vertex_handle v) { - CGAL_triangulation_precondition(number_of_vertices()== 1 && - dimension() == -1); + CGAL_precondition(number_of_vertices()== 1 && + dimension() == -1); remove_dim_down(v); return; } @@ -1353,7 +1353,7 @@ make_hole(Vertex_handle v, List_edges& hole) // delete the faces incident to v and v // and return the dscription of the hole in hole { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list to_delete; Face_handle f, fn; @@ -1506,9 +1506,9 @@ inline void Triangulation_data_structure_2:: set_adjacency(Face_handle f0, int i0, Face_handle f1, int i1) const { - CGAL_triangulation_assertion(i0 >= 0 && i0 <= dimension()); - CGAL_triangulation_assertion(i1 >= 0 && i1 <= dimension()); - CGAL_triangulation_assertion(f0 != f1); + CGAL_assertion(i0 >= 0 && i0 <= dimension()); + CGAL_assertion(i1 >= 0 && i1 <= dimension()); + CGAL_assertion(f0 != f1); f0->set_neighbor(i0,f1); f1->set_neighbor(i1,f0); } @@ -1518,10 +1518,10 @@ inline void Triangulation_data_structure_2:: delete_face(Face_handle f) { - CGAL_triangulation_expensive_precondition( dimension() != 2 || is_face(f)); - CGAL_triangulation_expensive_precondition( dimension() != 1 || is_edge(f,2)); - CGAL_triangulation_expensive_precondition( dimension() != 0 || - is_vertex(f->vertex(0)) ); + CGAL_expensive_precondition( dimension() != 2 || is_face(f)); + CGAL_expensive_precondition( dimension() != 1 || is_edge(f,2)); + CGAL_expensive_precondition( dimension() != 0 || + is_vertex(f->vertex(0)) ); faces().erase(f); } @@ -1530,7 +1530,7 @@ inline void Triangulation_data_structure_2:: delete_vertex(Vertex_handle v) { - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(v) ); vertices().erase(v); } @@ -1586,11 +1586,11 @@ split_vertex(Vertex_handle v, Face_handle f1, Face_handle g1) // */ - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() == 2 ); - CGAL_triangulation_precondition( f1 != Face_handle() && f1->has_vertex(v) ); - CGAL_triangulation_precondition( g1 != Face_handle() && g1->has_vertex(v) ); + CGAL_precondition( dimension() == 2 ); + CGAL_precondition( f1 != Face_handle() && f1->has_vertex(v) ); + CGAL_precondition( g1 != Face_handle() && g1->has_vertex(v) ); // 1. first we read some information that we will need int i1 = f1->index(v); @@ -1657,7 +1657,7 @@ split_vertex(Vertex_handle v, Face_handle f1, Face_handle g1) g1->set_neighbor( cw(j1), g ); g2->set_neighbor( ccw(j2), g ); - CGAL_triangulation_expensive_postcondition( is_valid() ); + CGAL_expensive_postcondition( is_valid() ); // 6. return the new stuff return Fourtuple(v1, v2, f, g); @@ -1668,9 +1668,9 @@ typename Triangulation_data_structure_2::Vertex_handle Triangulation_data_structure_2:: join_vertices(Face_handle f, int i, Vertex_handle v) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( f != Face_handle() ); - CGAL_triangulation_precondition( i >= 0 && i <= 2 ); + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( f != Face_handle() ); + CGAL_precondition( i >= 0 && i <= 2 ); // this methods does the "join"-operation and preserves // the vertex v among the two vertices that define the edge (f, i) @@ -1678,7 +1678,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) Vertex_handle v1 = f->vertex( ccw(i) ); Vertex_handle v2 = f->vertex( cw(i) ); - CGAL_triangulation_precondition( v == v1 || v == v2 ); + CGAL_precondition( v == v1 || v == v2 ); if ( v == v2 ) { return join_vertices(f->neighbor(i), mirror_index(f,i), v); @@ -1686,7 +1686,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) size_type deg2 = degree(v2); - CGAL_triangulation_precondition( deg2 >= 3 ); + CGAL_precondition( deg2 >= 3 ); if ( deg2 == 3 ) { remove_degree_3(v2, f->neighbor(ccw(i))); @@ -1762,7 +1762,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) ++fc; } while ( fc != fc_start ); - CGAL_triangulation_assertion( + CGAL_assertion( static_cast(star_faces_of_v2.size()) == deg2 ); // from this point and on we modify the values @@ -1775,7 +1775,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) // contain v1 for (unsigned int k = 0; k < star_faces_of_v2.size(); k++) { int id = star_indices_of_v2[k]; - CGAL_triangulation_assertion( star_faces_of_v2[k]->vertex(id) == v2 ); + CGAL_assertion( star_faces_of_v2[k]->vertex(id) == v2 ); star_faces_of_v2[k]->set_vertex( id, v1 ); } @@ -1788,10 +1788,10 @@ join_vertices(Face_handle f, int i, Vertex_handle v) if ( v1->face() == f || v1->face() == g ) v1->set_face(tl); -#if ! defined(CGAL_TRIANGULATION_NO_ASSERTIONS) && ! defined(CGAL_NO_ASSERTIONS) +#if ! defined(CGAL_NO_ASSERTIONS) for (Face_iterator fit = faces_begin(); fit != faces_end(); ++fit) { int id; - CGAL_triangulation_assertion( !fit->has_vertex(v2, id) ); + CGAL_assertion( !fit->has_vertex(v2, id) ); } #endif @@ -1804,7 +1804,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) delete_vertex(v2); - CGAL_triangulation_expensive_postcondition( is_valid() ); + CGAL_expensive_postcondition( is_valid() ); return v1; } @@ -1912,7 +1912,7 @@ is_valid(bool verbose, int level) const bool result = (dimension()>= -1); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); //count and test the validity of the faces (for positive dimensions) Face_iterator ib = face_iterator_base_begin(); @@ -1922,25 +1922,25 @@ is_valid(bool verbose, int level) const count_stored_faces += 1; if (dimension()>= 0) { result = result && ib->is_valid(verbose,level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } result = result && (count_stored_faces == number_of_full_dim_faces()); - CGAL_triangulation_assertion( + CGAL_assertion( count_stored_faces == number_of_full_dim_faces()); // vertex count size_type vertex_count = 0; for(Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit) { - CGAL_triangulation_assertion( vit->face() != Face_handle()); + CGAL_assertion( vit->face() != Face_handle()); result = result && vit->is_valid(verbose,level); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); ++vertex_count; } result = result && (number_of_vertices() == vertex_count); - CGAL_triangulation_assertion( number_of_vertices() == vertex_count ); + CGAL_assertion( number_of_vertices() == vertex_count ); //edge count size_type edge_count = 0; @@ -1958,26 +1958,26 @@ is_valid(bool verbose, int level) const case -1: result = result && vertex_count == 1 && face_count == 0 && edge_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 0: result = result && vertex_count == 2 && face_count == 0 && edge_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 1: result = result && edge_count == vertex_count; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); result = result && face_count == 0; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; case 2: result = result && edge_count == 3*face_count/2 ; - CGAL_triangulation_assertion(edge_count == 3*face_count/2); + CGAL_assertion(edge_count == 3*face_count/2); break; default: result = false; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; } @@ -1992,7 +1992,7 @@ copy_tds(const TDS_src& tds_src, const ConvertFace& convert_face) { if (vert != typename TDS_src::Vertex_handle()) - CGAL_triangulation_precondition( tds_src.is_vertex(vert)); + CGAL_precondition( tds_src.is_vertex(vert)); clear(); set_dimension(tds_src.dimension()); @@ -2043,7 +2043,7 @@ copy_tds(const TDS_src& tds_src, // remove the post condition because it is false when copying the // TDS of a regular triangulation because of hidden vertices - // CGAL_triangulation_postcondition( is_valid() ); + // CGAL_postcondition( is_valid() ); return (vert == typename TDS_src::Vertex_handle()) ? Vertex_handle() : vmap[vert]; } diff --git a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h index bf5aa71b9a2..3fa0d17af0a 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace CGAL { @@ -71,22 +71,22 @@ public: bool operator!=(const Face_handle &fh) const { return pos != fh; } bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Face& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return *pos; } Face* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return &*pos; } @@ -152,22 +152,22 @@ public: { return pos->vertex(_ri) != vh; } bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Vertex& operator*() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return *(pos->vertex(_ri)); } Vertex* operator->() const { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); return &*(pos->vertex(_ri)); } @@ -231,8 +231,8 @@ public: bool operator==(const Edge_circulator &vc) const; bool operator!=(const Edge_circulator &vc) const; bool is_empty() const; - bool operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; - bool operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const; + bool operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const; + bool operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const; Edge* operator->() const { edge.first=pos; @@ -259,7 +259,7 @@ Triangulation_ds_face_circulator_2(Vertex_handle v, Face_handle f) if (pos == Face_handle()|| pos->dimension() < 2) { _v = Vertex_handle() ; pos = Face_handle(); return;} - else CGAL_triangulation_precondition( pos->has_vertex(v)); + else CGAL_precondition( pos->has_vertex(v)); } @@ -268,8 +268,8 @@ Triangulation_ds_face_circulator_2& Triangulation_ds_face_circulator_2 :: operator++() { - CGAL_triangulation_precondition( pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition( pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); pos = pos->neighbor(ccw(i)); return *this; @@ -280,8 +280,8 @@ Triangulation_ds_face_circulator_2 Triangulation_ds_face_circulator_2 :: operator++(int) { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); Face_circulator tmp(*this); ++(*this); return tmp; @@ -292,8 +292,8 @@ Triangulation_ds_face_circulator_2& Triangulation_ds_face_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); pos = pos->neighbor(cw(i)); return *this; @@ -304,8 +304,8 @@ Triangulation_ds_face_circulator_2 Triangulation_ds_face_circulator_2 :: operator--(int) { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); Face_circulator tmp(*this); --(*this); return tmp; @@ -338,18 +338,18 @@ return (_v == Vertex_handle() || pos == Face_handle() ); template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle() ); } template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return ! (*this == nullptr); } @@ -376,8 +376,8 @@ Triangulation_ds_vertex_circulator_2& Triangulation_ds_vertex_circulator_2 :: operator++() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -408,7 +408,7 @@ Triangulation_ds_vertex_circulator_2& Triangulation_ds_vertex_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); int i = pos->index(_v); @@ -462,18 +462,18 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return !(*this == nullptr); } @@ -499,7 +499,7 @@ Triangulation_ds_edge_circulator_2& Triangulation_ds_edge_circulator_2 :: operator++() { - CGAL_triangulation_precondition(pos != Face_handle() && + CGAL_precondition(pos != Face_handle() && _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -530,8 +530,8 @@ Triangulation_ds_edge_circulator_2& Triangulation_ds_edge_circulator_2 :: operator--() { - CGAL_triangulation_precondition(pos != Face_handle() && - _v != Vertex_handle()); + CGAL_precondition(pos != Face_handle() && + _v != Vertex_handle()); int i = pos->index(_v); if (pos->dimension() == 1) { @@ -584,18 +584,18 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator==(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator==(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator!=(std::nullptr_t /*CGAL_triangulation_assertion_code(n)*/) const +operator!=(std::nullptr_t /*CGAL_assertion_code(n)*/) const { - //CGAL_triangulation_assertion( n == nullptr); + //CGAL_assertion( n == nullptr); return !(*this == nullptr); } diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_2.h index e617e4c3320..4cad650dbc3 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_2.h @@ -67,8 +67,8 @@ typename Triangulation_ds_face_2::Vertex_handle Triangulation_ds_face_2:: mirror_vertex(int i) const { - CGAL_triangulation_precondition ( this->neighbor(i) != Face_handle() - && this->dimension() >= 1); + CGAL_precondition ( this->neighbor(i) != Face_handle() + && this->dimension() >= 1); //return neighbor(i)->vertex(neighbor(i)->index(this->handle())); return this->neighbor(i)->vertex(mirror_index(i)); } @@ -79,8 +79,8 @@ Triangulation_ds_face_2:: mirror_index(int i) const { // return the index of opposite vertex in neighbor(i); - CGAL_triangulation_precondition (this->neighbor(i) != Face_handle() && - this->dimension() >= 1); + CGAL_precondition (this->neighbor(i) != Face_handle() && + this->dimension() >= 1); if (this->dimension() == 1) { return 1 - (this->neighbor(i)->index(this->vertex(1-i))); } diff --git a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h index b9e660d9d03..bb4c448c669 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include #include @@ -129,7 +129,7 @@ typename Triangulation_ds_face_base_2::Vertex_handle Triangulation_ds_face_base_2:: vertex(int i) const { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); return V[i]; } @@ -169,7 +169,7 @@ index(Vertex_handle v) const { if (v == V[0]) return 0; if (v == V[1]) return 1; - CGAL_triangulation_assertion( v == V[2] ); + CGAL_assertion( v == V[2] ); return 2; } @@ -179,7 +179,7 @@ typename Triangulation_ds_face_base_2::Face_handle Triangulation_ds_face_base_2:: neighbor(int i) const { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); return N[i]; } @@ -221,7 +221,7 @@ index(Face_handle n) const { if (n == N[0]) return 0; if (n == N[1]) return 1; - CGAL_triangulation_assertion( n == N[2] ); + CGAL_assertion( n == N[2] ); return 2; } @@ -230,7 +230,7 @@ inline void Triangulation_ds_face_base_2 :: set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); V[i] = v; } @@ -239,8 +239,8 @@ inline void Triangulation_ds_face_base_2 :: set_neighbor(int i, Face_handle n) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -275,9 +275,9 @@ inline void Triangulation_ds_face_base_2 :: set_neighbors(Face_handle n0,Face_handle n1, Face_handle n2) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; diff --git a/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h b/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h index caede3ef945..45c9c07ec23 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_iterators_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { @@ -109,7 +109,7 @@ void Triangulation_ds_edge_iterator_2:: increment() { - CGAL_triangulation_precondition(_tds->dimension() >= 1); + CGAL_precondition(_tds->dimension() >= 1); if (_tds->dimension() == 1) ++pos; else if (edge.second == 2) {edge.second = 0; ++pos;} else edge.second += 1; @@ -122,7 +122,7 @@ void Triangulation_ds_edge_iterator_2:: decrement() { - CGAL_triangulation_precondition(_tds->dimension() >= 1); + CGAL_precondition(_tds->dimension() >= 1); if (_tds->dimension() == 1) --pos; else if (edge.second == 0) { edge.second = 2; --pos;} else edge.second -= 1; @@ -145,7 +145,7 @@ Triangulation_ds_edge_iterator_2& Triangulation_ds_edge_iterator_2:: operator++() { - //CGAL_triangulation_precondition(pos != Iterator_base() && + //CGAL_precondition(pos != Iterator_base() && // pos != _tds->faces().end()); do increment(); while( pos != _tds->faces().end() && !associated_edge()); @@ -159,7 +159,7 @@ Triangulation_ds_edge_iterator_2& Triangulation_ds_edge_iterator_2:: operator--() { - // CGAL_triangulation_precondition(pos != Iterator_base() + // CGAL_precondition(pos != Iterator_base() // && *this != Edge_iterator(_tds)); do decrement(); while ( !associated_edge() && *this != Edge_iterator(_tds) ); diff --git a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h index 4f2c6fee42e..ca17923ec49 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h @@ -17,7 +17,7 @@ #include -#include +#include namespace CGAL { @@ -105,13 +105,13 @@ Triangulation_ds_vertex_2 :: is_valid(bool verbose, int level) { bool result = Vb::is_valid(verbose, level); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); if (this->face() != Face_handle()) { // face==nullptr if dim <0 result = result && ( &*this->face()->vertex(0) == this || &*this->face()->vertex(1) == this || &*this->face()->vertex(2) == this ); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } diff --git a/TDS_2/include/CGAL/Triangulation_utils_2.h b/TDS_2/include/CGAL/Triangulation_utils_2.h index 2501c51858f..17f661eafea 100644 --- a/TDS_2/include/CGAL/Triangulation_utils_2.h +++ b/TDS_2/include/CGAL/Triangulation_utils_2.h @@ -18,7 +18,7 @@ #include -#include +#include namespace CGAL { template < class T = void > @@ -39,13 +39,13 @@ class Triangulation_cw_ccw_2 public: static int ccw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return ccw_map[i]; } static int cw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return cw_map[i]; } }; diff --git a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h index e39b14907bb..3568d783b53 100644 --- a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h +++ b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_circulators_3.h @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -45,43 +45,43 @@ public: Triangulation_ds_cell_circulator_3(Cell_handle c, int s, int t) : _s(c->vertex(s)), _t(c->vertex(t)), pos(c) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 ); } Triangulation_ds_cell_circulator_3(const Edge & e) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(e.first) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >=0 && e.second < 4 && - e.third >=0 && e.third < 4); + CGAL_precondition( e.first != Cell_handle() && + e.second >=0 && e.second < 4 && + e.third >=0 && e.third < 4); } Triangulation_ds_cell_circulator_3(Cell_handle c, int s, int t, Cell_handle start) : _s(c->vertex(s)), _t(c->vertex(t)), pos(start) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); } Triangulation_ds_cell_circulator_3(const Edge & e, Cell_handle start) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(start) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >=0 && e.second < 4 && - e.third >=0 && e.third < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >=0 && e.second < 4 && + e.third >=0 && e.third < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); } Cell_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor(next_around_edge(pos->index(_s), pos->index(_t))); @@ -97,7 +97,7 @@ public: Cell_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor(next_around_edge(pos->index(_t), pos->index(_s))); return *this; @@ -140,9 +140,9 @@ public: return ch != pos; } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const + bool operator==(std::nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return pos == Cell_handle(); } @@ -207,34 +207,34 @@ public: Triangulation_ds_facet_circulator_3(Cell_handle c, int s, int t) : _s(c->vertex(s)), _t(c->vertex(t)), pos(c) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 ); } Triangulation_ds_facet_circulator_3(const Edge & e) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)), pos(e.first) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4); } Triangulation_ds_facet_circulator_3(Cell_handle c, int s, int t, Cell_handle start, int f) : _s(c->vertex(s)), _t(c->vertex(t)) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - f >= 0 && f < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + f >= 0 && f < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); int i = start->index( _s ); int j = start->index( _t ); - CGAL_triangulation_precondition( f!=i && f!=j ); + CGAL_precondition( f!=i && f!=j ); if ( f == next_around_edge(i,j) ) pos = start; @@ -246,16 +246,16 @@ public: const Facet & start) : _s(c->vertex(s)), _t(c->vertex(t)) { - CGAL_triangulation_precondition( c != Cell_handle() && - s >= 0 && s < 4 && - t >= 0 && t < 4 && - start.first->has_vertex( _s ) && - start.first->has_vertex( _t ) ); + CGAL_precondition( c != Cell_handle() && + s >= 0 && s < 4 && + t >= 0 && t < 4 && + start.first->has_vertex( _s ) && + start.first->has_vertex( _t ) ); int i = start.first->index( _s ); int j = start.first->index( _t ); - CGAL_triangulation_precondition( start.second !=i && start.second !=j ); + CGAL_precondition( start.second !=i && start.second !=j ); if ( start.second == next_around_edge(i,j) ) pos = start.first; @@ -266,17 +266,17 @@ public: Triangulation_ds_facet_circulator_3(const Edge & e, Cell_handle start, int f) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4 && - f >= 0 && f < 4 && - start->has_vertex( _s ) && - start->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4 && + f >= 0 && f < 4 && + start->has_vertex( _s ) && + start->has_vertex( _t ) ); int i = start->index( _s ); int j = start->index( _t ); - CGAL_triangulation_precondition( f!=i && f!=j ); + CGAL_precondition( f!=i && f!=j ); if ( f == next_around_edge(i,j) ) pos = start; @@ -287,11 +287,11 @@ public: Triangulation_ds_facet_circulator_3(const Edge & e, const Facet & start) : _s(e.first->vertex(e.second)), _t(e.first->vertex(e.third)) { - CGAL_triangulation_precondition( e.first != Cell_handle() && - e.second >= 0 && e.second < 4 && - e.third >= 0 && e.third < 4 && - start.first->has_vertex( _s ) && - start.first->has_vertex( _t ) ); + CGAL_precondition( e.first != Cell_handle() && + e.second >= 0 && e.second < 4 && + e.third >= 0 && e.third < 4 && + start.first->has_vertex( _s ) && + start.first->has_vertex( _t ) ); int i = start.first->index( _s ); int j = start.first->index( _t ); @@ -304,7 +304,7 @@ public: Facet_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor( next_around_edge( pos->index(_s), pos->index(_t) ) ); @@ -320,7 +320,7 @@ public: Facet_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor( next_around_edge( pos->index(_t), pos->index(_s) ) ); return *this; @@ -359,9 +359,9 @@ public: return ! (*this == ccir); } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_assertion_code(c)) const { - CGAL_triangulation_assertion(c == nullptr); + CGAL_assertion(c == nullptr); return pos == Cell_handle(); } @@ -410,7 +410,7 @@ public: Face_circulator & operator++() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); //then dimension() cannot be < 3 pos = pos->neighbor(ccw(pos->index(_s))); @@ -426,7 +426,7 @@ public: Face_circulator & operator--() { - CGAL_triangulation_precondition( pos != Cell_handle() ); + CGAL_precondition( pos != Cell_handle() ); pos = pos->neighbor(cw(pos->index(_s))); return *this; @@ -459,9 +459,9 @@ public: return ! (*this == ccir); } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_assertion_code(c)) const { - CGAL_triangulation_assertion(c == nullptr); + CGAL_assertion(c == nullptr); return pos == Cell_handle(); } diff --git a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h index 885172184d0..459b166447e 100644 --- a/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h +++ b/TDS_3/include/CGAL/TDS_3/internal/Triangulation_ds_iterators_3.h @@ -17,7 +17,6 @@ #include -#include #include namespace CGAL { namespace internal { diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 89e237cc0d4..6333387f28b 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -338,14 +338,14 @@ public: Cell_handle create_face() { - CGAL_triangulation_precondition(dimension()<3); + CGAL_precondition(dimension()<3); return create_cell(); } Cell_handle create_face(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2) { - CGAL_triangulation_precondition(dimension()<3); + CGAL_precondition(dimension()<3); return cells().emplace(v0, v1, v2, Vertex_handle()); } @@ -354,7 +354,7 @@ public: Cell_handle f1, int i1, Cell_handle f2, int i2) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f0->vertex(cw(i0)), f1->vertex(cw(i1)), f2->vertex(cw(i2))); @@ -367,7 +367,7 @@ public: Cell_handle create_face(Cell_handle f0, int i0, Cell_handle f1, int i1) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f0->vertex(cw(i0)), f1->vertex(cw(i1)), f1->vertex(ccw(i1))); @@ -378,7 +378,7 @@ public: Cell_handle create_face(Cell_handle f, int i, Vertex_handle v) { - CGAL_triangulation_precondition(dimension() <= 2); + CGAL_precondition(dimension() <= 2); Cell_handle newf = create_face(f->vertex(cw(i)), f->vertex(ccw(i)), v); @@ -397,13 +397,13 @@ public: void delete_vertex( Vertex_handle v ) { - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(v) ); vertices().erase(v); } void delete_cell( Cell_handle c ) { - CGAL_triangulation_expensive_precondition( is_simplex(c) ); + CGAL_expensive_precondition( is_simplex(c) ); cells().erase(c); } @@ -504,7 +504,7 @@ public: Cell_handle begin, int i, Vertex_handle newv) { - CGAL_triangulation_precondition(begin != Cell_handle()); + CGAL_precondition(begin != Cell_handle()); // if begin == nullptr (default arg), we could compute one by walking in // CellIt. At the moment, the functionality is not available, you have // to specify a starting facet. @@ -639,7 +639,7 @@ public: // Change orientation of the whole TDS. void reorient() { - CGAL_triangulation_precondition(dimension() >= 1); + CGAL_precondition(dimension() >= 1); for (Cell_iterator i = cells().begin(); i != cells().end(); ++i) change_orientation(i); @@ -728,66 +728,66 @@ public: // cells around an edge Cell_circulator incident_cells(const Edge & e) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(e); } Cell_circulator incident_cells(Cell_handle ce, int i, int j) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(ce, i, j); } Cell_circulator incident_cells(const Edge &e, Cell_handle start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(e, start); } Cell_circulator incident_cells(Cell_handle ce, int i, int j, Cell_handle start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Cell_circulator(ce, i, j, start); } //facets around an edge Facet_circulator incident_facets(const Edge & e) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e); } Facet_circulator incident_facets(Cell_handle ce, int i, int j) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j); } Facet_circulator incident_facets(const Edge & e, const Facet & start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e, start); } Facet_circulator incident_facets(Cell_handle ce, int i, int j, const Facet & start) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j, start); } Facet_circulator incident_facets(const Edge & e, Cell_handle start, int f) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(e, start, f); } Facet_circulator incident_facets(Cell_handle ce, int i, int j, Cell_handle start, int f) const { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return Facet_circulator(ce, i, j, start, f); } // 2D : circulates on the faces adjacent to a vertex. Face_circulator incident_faces(Vertex_handle v) const { - CGAL_triangulation_precondition( dimension() == 2 ); + CGAL_precondition( dimension() == 2 ); return Face_circulator(v, v->cell()); } @@ -800,7 +800,7 @@ private: std::pair it) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); std::stack cell_stack; cell_stack.push(d); @@ -861,7 +861,7 @@ private: void just_incident_cells_3(Vertex_handle v, std::vector& cells) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); Cell_handle d = v->cell(); cells.push_back(d); @@ -890,7 +890,7 @@ private: incident_cells_2(Vertex_handle v, Cell_handle, OutputIterator cells) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); Face_circulator fc = incident_faces(v); Face_circulator done(fc); @@ -1166,7 +1166,7 @@ public: OutputIterator incident_facets(Vertex_handle v, OutputIterator facets, Filter f = Filter()) const { - CGAL_triangulation_precondition( dimension() > 1 ); + CGAL_precondition( dimension() > 1 ); if(dimension() == 3) return visit_incident_cells, OutputIterator>(v, facets, f); else @@ -1184,7 +1184,7 @@ public: OutputIterator incident_facets_threadsafe(Vertex_handle v, OutputIterator facets, Filter f = Filter()) const { - CGAL_triangulation_precondition( dimension() > 1 ); + CGAL_precondition( dimension() > 1 ); if(dimension() == 3) return visit_incident_cells_threadsafe, OutputIterator>(v, facets, f); else @@ -1203,7 +1203,7 @@ public: incident_edges_1d(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { CGAL_assertion (dimension() == 1); - CGAL_triangulation_assertion( number_of_vertices() >= 3); + CGAL_assertion( number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1221,10 +1221,10 @@ public: OutputIterator incident_edges(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= 1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= 1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == 1) { return incident_edges_1d(v, edges, f); @@ -1240,10 +1240,10 @@ public: incident_edges_threadsafe(Vertex_handle v, OutputIterator edges, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= 1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= 1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == 1) { return incident_edges_1d(v, edges, f); @@ -1273,10 +1273,10 @@ public: OutputIterator adjacent_vertices(Vertex_handle v, OutputIterator vertices, Filter f = Filter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() >= -1 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() >= -1 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); if (dimension() == -1) return vertices; @@ -1288,7 +1288,7 @@ public: } if (dimension() == 1) { - CGAL_triangulation_assertion( number_of_vertices() >= 3); + CGAL_assertion( number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1335,10 +1335,10 @@ public: adjacent_vertices_threadsafe(Vertex_handle v, OutputIterator vertices, Filter f = Filter()) const { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(dimension() >= -1); - CGAL_triangulation_expensive_precondition(is_vertex(v)); - CGAL_triangulation_expensive_precondition(is_valid()); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(dimension() >= -1); + CGAL_expensive_precondition(is_vertex(v)); + CGAL_expensive_precondition(is_valid()); if (dimension() == -1) return vertices; @@ -1350,7 +1350,7 @@ public: } if (dimension() == 1) { - CGAL_triangulation_assertion(number_of_vertices() >= 3); + CGAL_assertion(number_of_vertices() >= 3); Cell_handle n0 = v->cell(); const int index_v_in_n0 = n0->index(v); CGAL_assume(index_v_in_n0 <= 1); @@ -1373,8 +1373,8 @@ public: OutputIterator visit_incident_cells(Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1405,8 +1405,8 @@ public: visit_incident_cells_threadsafe( Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1437,8 +1437,8 @@ public: visit_incident_cells(Vertex_handle v, OutputIterator output, std::vector &cells, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1465,8 +1465,8 @@ public: OutputIterator visit_just_incident_cells(Vertex_handle v, OutputIterator output, Filter f) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_expensive_precondition( is_vertex(v) ); if ( dimension() < 2 ) return output; @@ -1499,10 +1499,10 @@ public: std::vector &cells, VertexFilter f = VertexFilter()) const { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( dimension() == 3 ); - CGAL_triangulation_expensive_precondition( is_vertex(v) ); - CGAL_triangulation_expensive_precondition( is_valid() ); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( dimension() == 3 ); + CGAL_expensive_precondition( is_vertex(v) ); + CGAL_expensive_precondition( is_valid() ); return visit_incident_cells @@ -1554,16 +1554,16 @@ public: void set_adjacency(Cell_handle c0, int i0, Cell_handle c1, int i1) const { - CGAL_triangulation_assertion(i0 >= 0 && i0 <= dimension()); - CGAL_triangulation_assertion(i1 >= 0 && i1 <= dimension()); - CGAL_triangulation_assertion(c0 != c1); + CGAL_assertion(i0 >= 0 && i0 <= dimension()); + CGAL_assertion(i1 >= 0 && i1 <= dimension()); + CGAL_assertion(c0 != c1); c0->set_neighbor(i0,c1); c1->set_neighbor(i1,c0); } int mirror_index(Cell_handle c, int i) const { - CGAL_triangulation_precondition ( i>=0 && i<4 ); + CGAL_precondition ( i>=0 && i<4 ); return c->neighbor(i)->index(c); } @@ -1656,7 +1656,7 @@ public: convert_cell(c, *C[j]); } - CGAL_triangulation_assertion(is_valid(false)); + CGAL_assertion(is_valid(false)); return is; } @@ -1698,9 +1698,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) { - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1724,7 +1724,7 @@ create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1756,9 +1756,9 @@ recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2, int depth) { if ( depth == 100 ) return non_recursive_create_star_3(v,c,li,prev_ind2); - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1782,7 +1782,7 @@ recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1814,9 +1814,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) { - CGAL_triangulation_precondition( dimension() == 3); - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( dimension() == 3); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); Cell_handle cnew = create_cell(c->vertex(0), c->vertex(1), @@ -1843,7 +1843,7 @@ non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind Cell_handle n = cur->neighbor(zz); // turn around the oriented edge vj1 vj2 while ( n->tds_data().is_in_conflict() ) { - CGAL_triangulation_assertion( n != c ); + CGAL_assertion( n != c ); cur = n; zz = next_around_edge(n->index(vj1), n->index(vj2)); n = cur->neighbor(zz); @@ -1863,8 +1863,8 @@ non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind adjacency_info_stack.push( iAdjacency_info(zzz,cnew,ii,c,li,prev_ind2) ); c=nnn; li=zz; prev_ind2=zzz; ii=0; //copy-pasted from beginning to avoid if ii==0 - CGAL_triangulation_precondition( c->tds_data().is_in_conflict() ); - CGAL_triangulation_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); + CGAL_precondition( c->tds_data().is_in_conflict() ); + CGAL_precondition( ! c->neighbor(li)->tds_data().is_in_conflict() ); cnew = create_cell(c->vertex(0),c->vertex(1),c->vertex(2),c->vertex(3)); cnew->set_vertex(li, v); c_li = c->neighbor(li); @@ -1891,7 +1891,7 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: create_star_2(Vertex_handle v, Cell_handle c, int li ) { - CGAL_triangulation_assertion( dimension() == 2 ); + CGAL_assertion( dimension() == 2 ); Cell_handle cnew; // i1 i2 such that v,i1,i2 positive @@ -1980,7 +1980,7 @@ operator>>(std::istream& is, Triangulation_data_structure_3& tds) std::size_t m; tds.read_cells(is, V, m, C); - CGAL_triangulation_assertion( tds.is_valid() ); + CGAL_assertion( tds.is_valid() ); return is; } @@ -2022,7 +2022,7 @@ operator<<(std::ostream& os, const Triangulation_data_structure_3 &tds for (Vertex_iterator it=tds.vertices_begin(); it != tds.vertices_end(); ++it) V[it] = i++; - CGAL_triangulation_assertion( i == n ); + CGAL_assertion( i == n ); tds.print_cells(os, V); @@ -2049,7 +2049,7 @@ bool Triangulation_data_structure_3:: is_vertex(Vertex_handle v) const { - return vertices().owns_dereferencable(v); + return vertices().owns_dereferenceable(v); } template @@ -2059,7 +2059,7 @@ is_edge(Vertex_handle u, Vertex_handle v, Cell_handle &c, int &i, int &j) const // returns false when dimension <1 or when indices wrong { - CGAL_triangulation_expensive_precondition( is_vertex(u) && is_vertex(v) ); + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) ); if (u==v) return false; @@ -2102,7 +2102,7 @@ is_edge(Cell_handle c, int i, int j) const if ( (dimension() == 2) && ((i>2) || (j>2)) ) return false; if ((i>3) || (j>3)) return false; - return cells().owns_dereferencable(c); + return cells().owns_dereferenceable(c); } template @@ -2113,7 +2113,7 @@ is_facet(Vertex_handle u, Vertex_handle v, Cell_handle & c, int & i, int & j, int & k) const // returns false when dimension <2 or when indices wrong { - CGAL_triangulation_expensive_precondition( is_vertex(u) && + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) && is_vertex(w) ); @@ -2141,7 +2141,7 @@ bool Triangulation_data_structure_3:: is_facet(Cell_handle c, int i) const { - CGAL_triangulation_precondition(i>=0 && i<4); + CGAL_precondition(i>=0 && i<4); if ( dimension() < 2 ) return false; @@ -2149,7 +2149,7 @@ is_facet(Cell_handle c, int i) const if ( (dimension() == 2) && (i!=3) ) return false; - return cells().owns_dereferencable(c); + return cells().owns_dereferenceable(c); } template @@ -2161,7 +2161,7 @@ is_cell( Cell_handle c ) const if (dimension() < 3) return false; - return cells().owns_dereferencable(c); + return cells().owns_dereferenceable(c); } template @@ -2172,7 +2172,7 @@ is_cell(Vertex_handle u, Vertex_handle v, Cell_handle & c, int & i, int & j, int & k, int & l) const // returns false when dimension <3 { - CGAL_triangulation_expensive_precondition( is_vertex(u) && + CGAL_expensive_precondition( is_vertex(u) && is_vertex(v) && is_vertex(w) && is_vertex(t) ); @@ -2217,7 +2217,7 @@ has_vertex(Cell_handle c, int i, Vertex_handle v, int & j) const // facet (c,i) // j has no meaning if false is returned { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); return ( c->has_vertex(v,j) && (j != i) ); } @@ -2228,7 +2228,7 @@ Triangulation_data_structure_3:: has_vertex(Cell_handle c, int i, Vertex_handle v) const // checks whether the query facet (c,i) has vertex v { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); int j; return ( c->has_vertex(v,j) && (j != i) ); } @@ -2264,7 +2264,7 @@ are_equal(Cell_handle c, int i, Cell_handle n, int j) const // if ( c->neighbor(i) != n ) return false; // if ( n->neighbor(j) != c ) return false; { - CGAL_triangulation_precondition( dimension() == 3 ); + CGAL_precondition( dimension() == 3 ); if ( (c==n) && (i==j) ) return true; @@ -2300,9 +2300,9 @@ flip( Cell_handle c, int i ) // flips facet i of cell c // c will be replaced by one of the new cells { - CGAL_triangulation_precondition( (dimension() == 3) && (0<=i) && (i<4) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); Cell_handle n = c->neighbor(i); int in = n->index(c); @@ -2323,16 +2323,16 @@ flip_flippable(Cell_handle c, int i ) // flips facet i of cell c // c will be replaced by one of the new cells { - CGAL_triangulation_precondition( (dimension() == 3) && (0<=i) && (i<4) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); Cell_handle n = c->neighbor(i); int in = n->index(c); // checks that the facet is flippable, // ie the future edge does not already exist - CGAL_triangulation_expensive_precondition( !is_edge(c->vertex(i), + CGAL_expensive_precondition( !is_edge(c->vertex(i), n->vertex(in))); flip_really(c,i,n,in); } @@ -2374,7 +2374,7 @@ flip_really( Cell_handle c, int i, Cell_handle n, int in ) c->vertex(i2)->set_cell(c); n->vertex(in3)->set_cell(n); // to be implemented : 2d case - // CGAL_triangulation_precondition( (0<=i) && (i<3) ); + // CGAL_precondition( (0<=i) && (i<3) ); } template @@ -2386,12 +2386,12 @@ flip( Cell_handle c, int i, int j ) // flips edge i,j of cell c // c will be deleted { - CGAL_triangulation_precondition( (dimension() == 3) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (0<=j) && (j<4) && ( i != j ) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); // checks that the edge is flippable ie degree 3 int degree = 0; @@ -2436,24 +2436,24 @@ flip_flippable( Cell_handle c, int i, int j ) // flips edge i,j of cell c // c will be deleted { - CGAL_triangulation_precondition( (dimension() == 3) + CGAL_precondition( (dimension() == 3) && (0<=i) && (i<4) && (0<=j) && (j<4) && ( i != j ) && (number_of_vertices() >= 6) ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_expensive_precondition( is_cell(c) ); // checks that the edge is flippable ie degree 3 - CGAL_triangulation_precondition_code( int degree = 0; ); - CGAL_triangulation_precondition_code + CGAL_precondition_code( int degree = 0; ); + CGAL_precondition_code ( Cell_circulator ccir = incident_cells(c,i,j); ); - CGAL_triangulation_precondition_code( Cell_circulator cdone = ccir; ); - CGAL_triangulation_precondition_code( do { + CGAL_precondition_code( Cell_circulator cdone = ccir; ); + CGAL_precondition_code( do { ++degree; ++ccir; } while ( ccir != cdone ); ); - CGAL_triangulation_precondition( degree == 3 ); + CGAL_precondition( degree == 3 ); int next = next_around_edge(i,j); Cell_handle c1 = c->neighbor( next ); @@ -2472,8 +2472,8 @@ flip_flippable( Cell_handle c, int i, int j ) // checks that the edge is flippable, // is the future cells do not already exist - CGAL_triangulation_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(i)) ); - CGAL_triangulation_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(j)) ); + CGAL_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(i)) ); + CGAL_expensive_precondition( !is_cell(v1,v2,v3,c->vertex(j)) ); flip_really(c,i,j,c1,v1,i1,j1,next1,c2,v2,i2,j2,next2,v3); } @@ -2559,7 +2559,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, { m = 2; C.resize(m); - // CGAL_triangulation_assertion( n == 2 ); + // CGAL_assertion( n == 2 ); for (int i=0; i < 2; i++) { Cell_handle c = create_face(V[i], Vertex_handle(), Vertex_handle()); C[i] = c; @@ -2575,7 +2575,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, { m = 1; C.resize(m); - // CGAL_triangulation_assertion( n == 1 ); + // CGAL_assertion( n == 1 ); Cell_handle c = create_face(V[0], Vertex_handle(), Vertex_handle()); C[0] = c; V[0]->set_cell(c); @@ -2617,7 +2617,7 @@ print_cells(std::ostream& os, const Unique_hash_map write(os, V[it->vertex(j)]); } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = cells_begin(); it != cells_end(); ++it) { @@ -2660,7 +2660,7 @@ print_cells(std::ostream& os, const Unique_hash_map } } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = facets_begin(); it != facets_end(); ++it) { @@ -2703,7 +2703,7 @@ print_cells(std::ostream& os, const Unique_hash_map } } } - CGAL_triangulation_assertion( i == m ); + CGAL_assertion( i == m ); // write the neighbors for(it = edges_begin(); it != edges_end(); ++it) { @@ -2732,7 +2732,7 @@ Triangulation_data_structure_3::insert_first_finite_cell( Vertex_handle &v0, Vertex_handle &v1, Vertex_handle &v2, Vertex_handle &v3, Vertex_handle v_infinite) { - CGAL_triangulation_precondition( + CGAL_precondition( (v_infinite == Vertex_handle() && dimension() == -2) || (v_infinite != Vertex_handle() && dimension() == -1)); @@ -2778,9 +2778,9 @@ typename Triangulation_data_structure_3::Vertex_handle Triangulation_data_structure_3:: insert_in_cell(Cell_handle c) { - CGAL_triangulation_precondition( dimension() == 3 ); - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_expensive_precondition( is_cell(c) ); + CGAL_precondition( dimension() == 3 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_expensive_precondition( is_cell(c) ); Vertex_handle v = create_vertex(); @@ -2824,8 +2824,8 @@ Triangulation_data_structure_3:: insert_in_facet(Cell_handle c, int i) { // inserts v in the facet opposite to vertex i of cell c - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_precondition( dimension() >= 2 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_precondition( dimension() >= 2 ); Vertex_handle v = create_vertex(); @@ -2833,8 +2833,8 @@ insert_in_facet(Cell_handle c, int i) case 3: { - CGAL_triangulation_expensive_precondition( is_cell(c) ); - CGAL_triangulation_precondition( i == 0 || i == 1 || + CGAL_expensive_precondition( is_cell(c) ); + CGAL_precondition( i == 0 || i == 1 || i == 2 || i == 3 ); // c will be modified to have v replacing vertex(i+3) int i1,i2,i3; @@ -2905,7 +2905,7 @@ insert_in_facet(Cell_handle c, int i) } case 2: { - CGAL_triangulation_expensive_precondition( is_facet(c,i) ); + CGAL_expensive_precondition( is_facet(c,i) ); Cell_handle n = c->neighbor(2); Cell_handle cnew = create_face(c->vertex(0),c->vertex(1),v); set_adjacency(cnew, 2, n, n->index(c)); @@ -2933,15 +2933,15 @@ Triangulation_data_structure_3:: insert_in_edge(Cell_handle c, int i, int j) // inserts a vertex in the edge of cell c with vertices i and j { - CGAL_triangulation_precondition( c != Cell_handle() ); - CGAL_triangulation_precondition( i != j ); - CGAL_triangulation_precondition( dimension() >= 1 ); + CGAL_precondition( c != Cell_handle() ); + CGAL_precondition( i != j ); + CGAL_precondition( dimension() >= 1 ); switch ( dimension() ) { case 3: { - CGAL_triangulation_expensive_precondition( is_cell(c) ); - CGAL_triangulation_precondition( i>=0 && i<=3 && j>=0 && j<=3 ); + CGAL_expensive_precondition( is_cell(c) ); + CGAL_precondition( i>=0 && i<=3 && j>=0 && j<=3 ); std::vector cells; cells.reserve(32); @@ -2957,7 +2957,7 @@ insert_in_edge(Cell_handle c, int i, int j) } case 2: { - CGAL_triangulation_expensive_precondition( is_edge(c,i,j) ); + CGAL_expensive_precondition( is_edge(c,i,j) ); Vertex_handle v = create_vertex(); int k=3-i-j; // index of the third vertex of the facet @@ -2996,7 +2996,7 @@ insert_in_edge(Cell_handle c, int i, int j) default: // case 1: { Vertex_handle v = create_vertex(); - CGAL_triangulation_expensive_precondition( is_edge(c,i,j) ); + CGAL_expensive_precondition( is_edge(c,i,j) ); Cell_handle cnew = create_face(v, c->vertex(1), Vertex_handle()); c->vertex(1)->set_cell(cnew); c->set_vertex(1,v); @@ -3019,15 +3019,15 @@ insert_increase_dimension(Vertex_handle star) // = nullptr only used to insert the 1st vertex (dimension -2 to dimension -1) // changes the dimension { - CGAL_triangulation_precondition( dimension() < 3); + CGAL_precondition( dimension() < 3); Vertex_handle v = create_vertex(); int dim = dimension(); if (dim != -2) { - CGAL_triangulation_precondition( star != Vertex_handle() ); + CGAL_precondition( star != Vertex_handle() ); // In this case, this precondition is not relatively expensive. - CGAL_triangulation_precondition( is_vertex(star) ); + CGAL_precondition( is_vertex(star) ); } // this is set now, so that it becomes allowed to reorient @@ -3188,13 +3188,13 @@ void Triangulation_data_structure_3:: remove_decrease_dimension(Vertex_handle v, Vertex_handle w) { - CGAL_triangulation_expensive_precondition( is_valid() ); - CGAL_triangulation_precondition( dimension() >= -1 ); - CGAL_triangulation_precondition( dimension() != 1 || + CGAL_expensive_precondition( is_valid() ); + CGAL_precondition( dimension() >= -1 ); + CGAL_precondition( dimension() != 1 || number_of_vertices() == 3); - CGAL_triangulation_precondition( number_of_vertices() > + CGAL_precondition( number_of_vertices() > (size_type) dimension() + 1 ); - CGAL_triangulation_precondition( degree(v) == number_of_vertices()-1 ); + CGAL_precondition( degree(v) == number_of_vertices()-1 ); if (dimension() <= 0) { delete_cell(v->cell()); @@ -3235,7 +3235,7 @@ remove_decrease_dimension(Vertex_handle v, Vertex_handle w) } delete_vertex(v); set_dimension(dimension()-1); - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } template @@ -3243,9 +3243,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_from_maximal_dimension_simplex(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() >= 1); - CGAL_triangulation_precondition(degree(v) == (size_type) dimension() + 1); - CGAL_triangulation_precondition(number_of_vertices() > + CGAL_precondition(dimension() >= 1); + CGAL_precondition(degree(v) == (size_type) dimension() + 1); + CGAL_precondition(number_of_vertices() > (size_type) dimension() + 1); if (number_of_vertices() == (size_type) dimension() + 2) { @@ -3267,9 +3267,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_2(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 1); - CGAL_triangulation_precondition(degree(v) == 2); - CGAL_triangulation_precondition(number_of_vertices() >= 4); + CGAL_precondition(dimension() == 1); + CGAL_precondition(degree(v) == 2); + CGAL_precondition(number_of_vertices() >= 4); // Cells to be killed. Cell_handle c0, c1; @@ -3306,9 +3306,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_3(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 2); - CGAL_triangulation_precondition(degree(v) == 3); - CGAL_triangulation_precondition(number_of_vertices() >= 5); + CGAL_precondition(dimension() == 2); + CGAL_precondition(degree(v) == 3); + CGAL_precondition(number_of_vertices() >= 5); // Cells to be killed. Cell_handle c0, c1, c2; @@ -3350,9 +3350,9 @@ typename Triangulation_data_structure_3::Cell_handle Triangulation_data_structure_3:: remove_degree_4(Vertex_handle v) { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(degree(v) == 4); - CGAL_triangulation_precondition(number_of_vertices() >= 6); + CGAL_precondition(dimension() == 3); + CGAL_precondition(degree(v) == 4); + CGAL_precondition(number_of_vertices() >= 6); // Cells to be killed. Cell_handle c0, c1, c2, c3; @@ -3400,11 +3400,11 @@ void Triangulation_data_structure_3:: decrease_dimension(Cell_handle c, int i) { - CGAL_triangulation_expensive_precondition( is_valid() );; - CGAL_triangulation_precondition( dimension() >= 2); - CGAL_triangulation_precondition( number_of_vertices() > + CGAL_expensive_precondition( is_valid() );; + CGAL_precondition( dimension() >= 2); + CGAL_precondition( number_of_vertices() > (size_type) dimension() + 1 ); - CGAL_triangulation_precondition( degree(c->vertex(i)) == number_of_vertices()-1 ); + CGAL_precondition( degree(c->vertex(i)) == number_of_vertices()-1 ); Vertex_handle v = c->vertex(i); Vertex_handle w = c->vertex(i); @@ -3530,7 +3530,7 @@ decrease_dimension(Cell_handle c, int i) v1->set_cell(c2); } - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } @@ -3556,7 +3556,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 4) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3566,7 +3566,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3584,7 +3584,7 @@ is_valid(bool verbose, int level ) const if ( cell_count - facet_count + edge_count - vertex_count != 0 ) { if (verbose) std::cerr << "Euler relation unsatisfied" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3596,7 +3596,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 3) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3607,7 +3607,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3619,7 +3619,7 @@ is_valid(bool verbose, int level ) const if (verbose) std::cerr << "Euler relation unsatisfied - edges/vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3631,7 +3631,7 @@ is_valid(bool verbose, int level ) const if (verbose) std::cerr << "Euler relation unsatisfied - facets/vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3642,7 +3642,7 @@ is_valid(bool verbose, int level ) const if(number_of_vertices() <= 1) { if (verbose) std::cerr << "wrong number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3652,7 +3652,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } size_type edge_count; @@ -3662,7 +3662,7 @@ is_valid(bool verbose, int level ) const if ( edge_count != vertex_count ) { if (verbose) std::cerr << "false number of edges" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3672,7 +3672,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() < 2 ) { if (verbose) std::cerr << "fewer than 2 vertices but dimension 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } CGAL_FALLTHROUGH; @@ -3682,7 +3682,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() < 1 ) { if (verbose) std::cerr << "no vertex but dimension -1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } // vertex count @@ -3692,7 +3692,7 @@ is_valid(bool verbose, int level ) const if ( number_of_vertices() != vertex_count ) { if (verbose) std::cerr << "false number of vertices" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3712,7 +3712,7 @@ is_valid(Vertex_handle v, bool verbose, int level) const if ( ! result ) { if ( verbose ) std::cerr << "invalid vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); } return result; } @@ -3732,14 +3732,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(0) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle()) { if (verbose) std::cerr << "vertex 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->neighbor(0) != Cell_handle() || @@ -3747,7 +3747,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->neighbor(2) != Cell_handle()) { if (verbose) std::cerr << "one neighbor != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3758,35 +3758,35 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(0) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->neighbor (0) == Cell_handle() ) { if (verbose) std::cerr << "neighbor 0 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle() ) { if (verbose) std::cerr << "vertex 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->neighbor(1) != Cell_handle() || c->neighbor(2) != Cell_handle() ) { if (verbose) std::cerr << "neighbor 1 or 2 != nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! c->neighbor(0)->has_vertex(c->vertex(0)) ) { if (verbose) std::cerr << "neighbor 0 does not have vertex 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -3802,7 +3802,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( v0 == Vertex_handle() || v1 == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0 or 1 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); @@ -3810,7 +3810,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n0 == Cell_handle() || n1 == Cell_handle() ) { if (verbose) std::cerr << "neighbor 0 or 1 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3818,14 +3818,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << "neighbor 1 does not have vertex 0 as vertex 1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( v1 != n0->vertex(0) ) { if (verbose) std::cerr << "neighbor 0 does not have vertex 1 as vertex 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3833,14 +3833,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << "neighbor 0 does not have this as neighbor 1" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( n1->neighbor(0) != c ) { if (verbose) std::cerr << "neighbor 1 does not have this as neighbor 0" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3854,7 +3854,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->vertex(2) == Vertex_handle() ) { if (verbose) std::cerr << "vertex 0, 1, or 2 nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); @@ -3867,14 +3867,14 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n == Cell_handle() ) { if (verbose) std::cerr << "neighbor " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex(cw(i)),in ) ) { if (verbose) std::cerr << "vertex " << cw(i) << " not vertex of neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } in = cw(in); @@ -3883,7 +3883,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << "neighbor " << i << " does not have this as neighbor " << in << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( c->vertex(ccw(i)) != n->vertex(cw(in)) ) { @@ -3891,7 +3891,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << "vertex " << ccw(i) << " is not vertex " << cw(in) << " of neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3905,7 +3905,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( c->vertex(i) == Vertex_handle() ) { if (verbose) std::cerr << "vertex " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } is_valid(c->vertex(i),verbose,level); @@ -3916,7 +3916,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( n == Cell_handle() ) { if (verbose) std::cerr << "neighbor " << i << " nullptr" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3929,7 +3929,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (in == 5) { if (verbose) std::cerr << "neighbor of c has not c as neighbor" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3938,28 +3938,28 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) { std::cerr << "vertex " << ((i+1)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex((i+2)&3),j2n) ) { if (verbose) { std::cerr << "vertex " << ((i+2)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( ! n->has_vertex(c->vertex((i+3)&3),j3n) ) { if (verbose) { std::cerr << "vertex " << ((i+3)&3) << " not vertex of neighbor " << i << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } if ( in+j1n+j2n+j3n != 6) { if (verbose) { std::cerr << "sum of the indices != 6 " << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -3970,7 +3970,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3979,7 +3979,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3988,7 +3988,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -3999,7 +3999,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4008,7 +4008,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4017,7 +4017,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if (verbose) std::cerr << " pb orientation with neighbor " << i << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -4037,7 +4037,7 @@ copy_tds(const TDS_src& tds, const ConvertVertex& convert_vertex, const ConvertCell& convert_cell) { - CGAL_triangulation_expensive_precondition( vert == Vertex_handle() + CGAL_expensive_precondition( vert == Vertex_handle() || tds.is_vertex(vert) ); clear(); @@ -4086,7 +4086,7 @@ copy_tds(const TDS_src& tds, F[cit2]->set_neighbor(j, F[cit2->neighbor(j)] ); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); return (vert != typename TDS_src::Vertex_handle()) ? V[vert] : Vertex_handle(); } @@ -4149,7 +4149,7 @@ void Triangulation_data_structure_3:: swap(Tds & tds) { - CGAL_triangulation_expensive_precondition(tds.is_valid() && is_valid()); + CGAL_expensive_precondition(tds.is_valid() && is_valid()); std::swap(_dimension, tds._dimension); cells().swap(tds.cells()); @@ -4178,7 +4178,7 @@ count_vertices(size_type & i, bool verbose, int level) const if ( ! is_valid(it,verbose,level) ) { if (verbose) std::cerr << "invalid vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4198,7 +4198,7 @@ count_facets(size_type & i, bool verbose, int level) const if ( ! is_valid((*it).first,verbose, level) ) { if (verbose) std::cerr << "invalid facet" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4218,7 +4218,7 @@ count_edges(size_type & i, bool verbose, int level) const if ( ! is_valid((*it).first,verbose, level) ) { if (verbose) std::cerr << "invalid edge" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; @@ -4238,7 +4238,7 @@ count_cells(size_type & i, bool verbose, int level) const if ( ! is_valid(it,verbose, level) ) { if (verbose) std::cerr << "invalid cell" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } ++i; diff --git a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h index 27ebcb68950..852ceefb8cb 100644 --- a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -19,7 +19,7 @@ #include -#include +#include #include namespace CGAL { @@ -66,7 +66,7 @@ public: Vertex_handle vertex(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3 ); + CGAL_precondition( i >= 0 && i <= 3 ); CGAL_assume( i >= 0 && i <= 3 ); return V[i]; } @@ -90,13 +90,13 @@ public: if (v == V[0]) { return 0; } if (v == V[1]) { return 1; } if (v == V[2]) { return 2; } - CGAL_triangulation_assertion( v == V[3] ); + CGAL_assertion( v == V[3] ); return 3; } Cell_handle neighbor(int i) const { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); return N[i]; } @@ -119,7 +119,7 @@ public: if (n == N[0]) return 0; if (n == N[1]) return 1; if (n == N[2]) return 2; - CGAL_triangulation_assertion( n == N[3] ); + CGAL_assertion( n == N[3] ); return 3; } @@ -127,14 +127,14 @@ public: void set_vertex(int i, Vertex_handle v) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); + CGAL_precondition( i >= 0 && i <= 3); V[i] = v; } void set_neighbor(int i, Cell_handle n) { - CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != n.operator->() ); + CGAL_precondition( i >= 0 && i <= 3); + CGAL_precondition( this != n.operator->() ); N[i] = n; } @@ -160,10 +160,10 @@ public: void set_neighbors(Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) { - CGAL_triangulation_precondition( this != n0.operator->() ); - CGAL_triangulation_precondition( this != n1.operator->() ); - CGAL_triangulation_precondition( this != n2.operator->() ); - CGAL_triangulation_precondition( this != n3.operator->() ); + CGAL_precondition( this != n0.operator->() ); + CGAL_precondition( this != n1.operator->() ); + CGAL_precondition( this != n2.operator->() ); + CGAL_precondition( this != n3.operator->() ); N[0] = n0; N[1] = n1; N[2] = n2; diff --git a/TDS_3/include/CGAL/Triangulation_utils_3.h b/TDS_3/include/CGAL/Triangulation_utils_3.h index 8b99c725a65..2f6646a2087 100644 --- a/TDS_3/include/CGAL/Triangulation_utils_3.h +++ b/TDS_3/include/CGAL/Triangulation_utils_3.h @@ -16,7 +16,7 @@ #include -#include +#include namespace CGAL { @@ -63,13 +63,13 @@ struct Triangulation_utils_3 { static int ccw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return ccw_map[i]; } static int cw(const int i) { - CGAL_triangulation_precondition( i >= 0 && i < 3); + CGAL_precondition( i >= 0 && i < 3); return cw_map[i]; } @@ -77,9 +77,9 @@ struct Triangulation_utils_3 { // index of the next cell when turning around the // oriented edge vertex(i) vertex(j) in 3d - CGAL_triangulation_precondition( ( i >= 0 && i < 4 ) && - ( j >= 0 && j < 4 ) && - ( i != j ) ); + CGAL_precondition( ( i >= 0 && i < 4 ) && + ( j >= 0 && j < 4 ) && + ( i != j ) ); return tab_next_around_edge[i][j]; } @@ -88,8 +88,8 @@ struct Triangulation_utils_3 { // indexes of the jth vertex of the facet of a cell // opposite to vertx i - CGAL_triangulation_precondition( ( i >= 0 && i < 4 ) && - ( j >= 0 && j < 3 ) ); + CGAL_precondition( ( i >= 0 && i < 4 ) && + ( j >= 0 && j < 3 ) ); return tab_vertex_triple_index[i][j]; } diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_of_one_subdomain.cpp b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_of_one_subdomain.cpp index ec9f56138e0..097b7955fb5 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_of_one_subdomain.cpp +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_of_one_subdomain.cpp @@ -10,19 +10,34 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3 Remeshing_triangulation; -struct Cells_of_subdomain +template +struct Cells_of_subdomain_pmap { private: + using Cell_handle = typename Tr::Cell_handle; + const int m_subdomain; public: - Cells_of_subdomain(const int& subdomain) + using key_type = Cell_handle; + using value_type = bool; + using reference = bool; + using category = boost::read_write_property_map_tag; + + Cells_of_subdomain_pmap(const int& subdomain) : m_subdomain(subdomain) {} - bool operator()(Remeshing_triangulation::Cell_handle c) const + friend value_type get(const Cells_of_subdomain_pmap& map, + const key_type& c) { - return m_subdomain == c->subdomain_index(); + return (map.m_subdomain == c->subdomain_index()); + } + friend void put(Cells_of_subdomain_pmap&, + const key_type&, + const value_type) + { + ; //nothing to do : subdomain indices are updated in remeshing } }; @@ -35,7 +50,8 @@ int main(int argc, char* argv[]) CGAL::Tetrahedral_remeshing::generate_input_two_subdomains(nbv, tr); CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length, - CGAL::parameters::cell_is_selected_map(Cells_of_subdomain(2))); + CGAL::parameters::cell_is_selected_map( + Cells_of_subdomain_pmap(2))); return EXIT_SUCCESS; } diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h index c107aec320a..77caca7318f 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h @@ -747,10 +747,11 @@ void merge_surface_patch_indices(const typename C3t3::Facet& f1, } } -template +template typename C3t3::Vertex_handle collapse(const typename C3t3::Cell_handle ch, const int to, const int from, + CellSelector& cell_selector, C3t3& c3t3) { typedef typename C3t3::Triangulation Tr; @@ -916,8 +917,7 @@ collapse(const typename C3t3::Cell_handle ch, for (Cell_handle cell_to_remove : cells_to_remove) { // remove cell - if (c3t3.is_in_complex(cell_to_remove)) - c3t3.remove_from_complex(cell_to_remove); + treat_before_delete(cell_to_remove, cell_selector, c3t3); c3t3.triangulation().tds().delete_cell(cell_to_remove); } @@ -930,9 +930,10 @@ collapse(const typename C3t3::Cell_handle ch, } -template +template typename C3t3::Vertex_handle collapse(typename C3t3::Edge& edge, const Collapse_type& collapse_type, + CellSelector& cell_selector, C3t3& c3t3) { typedef typename C3t3::Vertex_handle Vertex_handle; @@ -956,7 +957,7 @@ typename C3t3::Vertex_handle collapse(typename C3t3::Edge& edge, vh0->set_point(new_position); vh1->set_point(new_position); - vh = collapse(edge.first, edge.second, edge.third, c3t3); + vh = collapse(edge.first, edge.second, edge.third, cell_selector, c3t3); c3t3.set_dimension(vh, (std::min)(dim_vh0, dim_vh1)); } else //Collapse at vertex @@ -964,7 +965,7 @@ typename C3t3::Vertex_handle collapse(typename C3t3::Edge& edge, if (collapse_type == TO_V1) { vh0->set_point(p1); - vh = collapse(edge.first, edge.third, edge.second, c3t3); + vh = collapse(edge.first, edge.third, edge.second, cell_selector, c3t3); c3t3.set_dimension(vh, (std::min)(dim_vh0, dim_vh1)); } else //Collapse at v0 @@ -972,7 +973,7 @@ typename C3t3::Vertex_handle collapse(typename C3t3::Edge& edge, if (collapse_type == TO_V0) { vh1->set_point(p0); - vh = collapse(edge.first, edge.second, edge.third, c3t3); + vh = collapse(edge.first, edge.second, edge.third, cell_selector, c3t3); c3t3.set_dimension(vh, (std::min)(dim_vh0, dim_vh1)); } else @@ -1136,7 +1137,7 @@ typename C3t3::Vertex_handle collapse_edge(typename C3t3::Edge& edge, if (in_cx) nb_valid_collapse++; #endif - return collapse(edge, collapse_type, c3t3); + return collapse(edge, collapse_type, cell_selector, c3t3); } } #ifdef CGAL_DEBUG_TET_REMESHING_IN_PLUGIN diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/compute_c3t3_statistics.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/compute_c3t3_statistics.h index a2c8191fa8f..190d6e6e320 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/compute_c3t3_statistics.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/compute_c3t3_statistics.h @@ -55,11 +55,11 @@ void compute_statistics(const Triangulation& tr, double max_dihedral_angle = 0.; double min_dihedral_angle = 180.; - for (Facet fit : tr.finite_facets()) + for (Facet f : tr.finite_facets()) { - const Cell_handle cell = fit.first; - const int& index = fit.second; - if (!cell_selector(cell) || !cell_selector(cell->neighbor(index))) + const Cell_handle cell = f.first; + const int& index = f.second; + if (!get(cell_selector, cell) || !get(cell_selector, cell->neighbor(index))) continue; const Point& pa = point(cell->vertex((index + 1) & 3)->point()); @@ -92,7 +92,7 @@ void compute_statistics(const Triangulation& tr, ++cit) { const Subdomain_index& si = cit->subdomain_index(); - if (si == Subdomain_index() || !cell_selector(cit)) + if (si == Subdomain_index() || !get(cell_selector, cit)) continue; ++nb_tets; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h index 91a629ac875..4fbe1180756 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/flip_edges.h @@ -88,12 +88,13 @@ void update_c3t3_facets(C3t3& c3t3, } } -template +template Sliver_removal_result flip_3_to_2(typename C3t3::Edge& edge, C3t3& c3t3, const std::vector& vertices_around_edge, const Flip_Criterion& criterion, - IncCellsVectorMap& inc_cells) + IncCellsVectorMap& inc_cells, + Cell_selector& cell_selector) { typedef typename C3t3::Triangulation Tr; typedef typename C3t3::Facet Facet; @@ -324,7 +325,7 @@ Sliver_removal_result flip_3_to_2(typename C3t3::Edge& edge, // Update c3t3 update_c3t3_facets(c3t3, cells_to_update, outer_mirror_facets); - c3t3.remove_from_complex(cell_to_remove); + treat_before_delete(cell_to_remove, cell_selector, c3t3); tr.tds().delete_cell(cell_to_remove); /********************VALIDITY CHECK***************************/ @@ -704,11 +705,15 @@ void find_best_flip_to_improve_dh(C3t3& c3t3, } } -template +template Sliver_removal_result flip_n_to_m(C3t3& c3t3, typename C3t3::Edge& edge, typename C3t3::Vertex_handle vh, IncCellsVectorMap& inc_cells, + Cell_selector& cell_selector, Visitor& visitor, bool check_validity = false) { @@ -863,6 +868,7 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, //Subdomain index? typename C3t3::Subdomain_index subdomain = to_remove[0]->subdomain_index(); + bool selected = get(cell_selector, to_remove[0]); visitor.before_flip(to_remove[0]); #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG @@ -883,7 +889,8 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, new_cell->set_vertex(fi.second, vh); - c3t3.add_to_complex(new_cell, subdomain); + treat_new_cell(new_cell, subdomain, cell_selector, selected, c3t3); + visitor.after_flip(new_cell); cells_to_update.push_back(new_cell); } @@ -952,7 +959,7 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, //Remove cells for (Cell_handle ch : to_remove) { - c3t3.remove_from_complex(ch); + treat_before_delete(ch, cell_selector, c3t3); tr.tds().delete_cell(ch); } @@ -1009,12 +1016,13 @@ Sliver_removal_result flip_n_to_m(C3t3& c3t3, } -template +template Sliver_removal_result flip_n_to_m(typename C3t3::Edge& edge, C3t3& c3t3, const std::vector& boundary_vertices, const Flip_Criterion& criterion, IncCellsVectorMap& inc_cells, + CellSelector& cell_selector, Visitor& visitor) { typedef typename C3t3::Vertex_handle Vertex_handle; @@ -1063,7 +1071,8 @@ Sliver_removal_result flip_n_to_m(typename C3t3::Edge& edge, if (curr_max_cosdh <= curr_cost_vpair.first) return NO_BEST_CONFIGURATION; - result = flip_n_to_m(c3t3, edge, curr_cost_vpair.second.first, inc_cells, visitor); + result = flip_n_to_m(c3t3, edge, curr_cost_vpair.second.first, inc_cells, + cell_selector, visitor); if (result != NOT_FLIPPABLE) flip_performed = true; @@ -1073,11 +1082,12 @@ Sliver_removal_result flip_n_to_m(typename C3t3::Edge& edge, return result; } -template +template Sliver_removal_result find_best_flip(typename C3t3::Edge& edge, C3t3& c3t3, const Flip_Criterion& criterion, IncCellsVectorMap& inc_cells, + Cell_selector& cell_selector, Visitor& visitor) { typedef typename C3t3::Triangulation Tr; @@ -1140,7 +1150,7 @@ Sliver_removal_result find_best_flip(typename C3t3::Edge& edge, { std::vector vertices; vertices.insert(vertices.end(), vertices_around_edge.begin(), vertices_around_edge.end()); - res = flip_3_to_2(edge, c3t3, vertices, criterion, inc_cells); + res = flip_3_to_2(edge, c3t3, vertices, criterion, inc_cells, cell_selector); } } else @@ -1152,7 +1162,7 @@ Sliver_removal_result find_best_flip(typename C3t3::Edge& edge, { std::vector vertices; vertices.insert(vertices.end(), boundary_vertices.begin(), boundary_vertices.end()); - res = flip_n_to_m(edge, c3t3, vertices, criterion, inc_cells, visitor); + res = flip_n_to_m(edge, c3t3, vertices, criterion, inc_cells, cell_selector, visitor); //return n_to_m_flip(edge, boundary_vertices, flip_criterion); } } @@ -1161,10 +1171,11 @@ Sliver_removal_result find_best_flip(typename C3t3::Edge& edge, } -template +template std::size_t flip_all_edges(const std::vector& edges, C3t3& c3t3, const Flip_Criterion& criterion, + Cell_selector& cell_selector, Visitor& visitor) { typedef typename C3t3::Triangulation Tr; @@ -1195,7 +1206,8 @@ std::size_t flip_all_edges(const std::vector& edges, { Edge edge(ch, i0, i1); - Sliver_removal_result res = find_best_flip(edge, c3t3, criterion, inc_cells, visitor); + Sliver_removal_result res + = find_best_flip(edge, c3t3, criterion, inc_cells, cell_selector, visitor); if (res == INVALID_CELL || res == INVALID_VERTEX || res == INVALID_ORIENTATION) { std::cout << "FLIP PROBLEM!!!!" << std::endl; @@ -1222,7 +1234,7 @@ std::size_t flip_all_edges(const std::vector& edges, template void flip_edges(C3T3& c3t3, const bool protect_boundaries, - CellSelector cell_selector, + CellSelector& cell_selector, Visitor& visitor) { CGAL_USE(protect_boundaries); @@ -1238,8 +1250,6 @@ void flip_edges(C3T3& c3t3, //const Flip_Criterion criterion = VALENCE_MIN_DH_BASED; - //collect long edges - //compute vertices normals map? // typedef typename C3T3::Surface_patch_index Surface_patch_index; @@ -1273,7 +1283,7 @@ void flip_edges(C3T3& c3t3, #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_flips = #endif - flip_all_edges(inside_edges, c3t3, MIN_ANGLE_BASED, visitor); + flip_all_edges(inside_edges, c3t3, MIN_ANGLE_BASED, cell_selector, visitor); //} #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index 745f89bb1d2..24874936248 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -142,6 +142,20 @@ private: return n; } + template + std::string debug_to_string(const Patch_index i) + { + return std::to_string(i); + } + + template + std::string debug_to_string(const std::pair& pi) + { + std::string str = std::to_string(pi.first); + str.append("_").append(std::to_string(pi.second)); + return str; + } + template void compute_vertices_normals(const C3t3& c3t3, VertexNormalsMap& normals_map, @@ -283,7 +297,8 @@ private: for (auto& kv : ons_map) { std::ostringstream oss; - oss << "dump_normals_normalized_" << kv.first << ".polylines.txt"; + oss << "dump_normals_normalized_[" + << debug_to_string(kv.first) << "].polylines.txt"; std::ofstream ons(oss.str()); for (auto s : kv.second) ons << "2 " << s.source() << " " << s.target() << std::endl; @@ -414,10 +429,11 @@ public: #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE std::cout << "Smooth vertices..."; std::cout.flush(); -#endif + std::size_t nb_done_3d = 0; std::size_t nb_done_2d = 0; std::size_t nb_done_1d = 0; +#endif FT total_move = 0.; Tr& tr = c3t3.triangulation(); @@ -451,7 +467,7 @@ public: inc_cells(nbv, boost::container::small_vector()); for (const Cell_handle c : tr.finite_cell_handles()) { - const bool cell_is_selected = cell_selector(c); + const bool cell_is_selected = get(cell_selector, c); for (int i = 0; i < 4; ++i) { @@ -540,8 +556,11 @@ public: #endif // move vertex const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_1d++; +#endif + } } else if (neighbors[vid] > 0) { @@ -574,8 +593,11 @@ public: #endif // move vertex const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_1d++; +#endif + } } } } @@ -647,8 +669,11 @@ public: os_surf << "2 " << current_pos << " " << final_position << std::endl; #endif const typename Tr::Point new_pos(final_position.x(), final_position.y(), final_position.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_2d++; +#endif + } } else if (neighbors[vid] > 0) { @@ -660,8 +685,11 @@ public: if (boost::optional mls_projection = project(si, current_pos)) { const typename Tr::Point new_pos(CGAL::ORIGIN + *mls_projection); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_2d++; +#endif + } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_surf0 << "2 " << current_pos << " " << new_pos << std::endl; @@ -715,8 +743,11 @@ public: #endif const Vector_3 p = smoothed_positions[vid] / static_cast(neighbors[vid]); typename Tr::Point new_pos(p.x(), p.y(), p.z()); - if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)) + if(check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){ +#ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE nb_done_3d++; +#endif + } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG os_vol << " " << point(v->point()) << std::endl; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h index 86e7aa27856..5106fb1835b 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h @@ -33,8 +33,9 @@ namespace Tetrahedral_remeshing { namespace internal { -template +template typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, + CellSelector cell_selector, C3t3& c3t3) { typedef typename C3t3::Triangulation Tr; @@ -69,8 +70,16 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, } CGAL_assertion(dimension > 0); - std::unordered_map> cells_info; - std::unordered_map, boost::hash> facets_info; + struct Cell_info { + Subdomain_index subdomain_index_; + bool selected_; + }; + struct Facet_info { + Vertex_handle opp_vertex_; + Surface_patch_index patch_index_; + }; + boost::unordered_map> cells_info; + boost::unordered_map> facets_info; // check orientation and collect incident cells to avoid circulating twice boost::container::small_vector inc_cells; @@ -114,23 +123,21 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, //keys are the opposite facets to the ones not containing e, //because they will not be modified const Subdomain_index subdomain = c3t3.subdomain_index(c); + const bool selected = get(cell_selector, c); const Facet opp_facet1 = tr.mirror_facet(Facet(c, index_v1)); const Facet opp_facet2 = tr.mirror_facet(Facet(c, index_v2)); // volume data - cells_info.insert(std::make_pair(opp_facet1, subdomain)); - cells_info.insert(std::make_pair(opp_facet2, subdomain)); - if (c3t3.is_in_complex(c)) - c3t3.remove_from_complex(c); + cells_info.insert(std::make_pair(opp_facet1, Cell_info{subdomain, selected})); + cells_info.insert(std::make_pair(opp_facet2, Cell_info{subdomain, selected})); + treat_before_delete(c, cell_selector, c3t3); // surface data for facets of the cells to be split const int findex = CGAL::Triangulation_utils_3::next_around_edge(index_v1, index_v2); Surface_patch_index patch = c3t3.surface_patch_index(c, findex); Vertex_handle opp_vertex = c->vertex(findex); - facets_info.insert(std::make_pair(opp_facet1, - std::make_pair(opp_vertex, patch))); - facets_info.insert(std::make_pair(opp_facet2, - std::make_pair(opp_vertex, patch))); + facets_info.insert(std::make_pair(opp_facet1, Facet_info{opp_vertex, patch})); + facets_info.insert(std::make_pair(opp_facet2, Facet_info{opp_vertex, patch})); if(c3t3.is_in_complex(c, findex)) c3t3.remove_from_complex(c, findex); @@ -151,28 +158,26 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, //get subdomain info back CGAL_assertion(cells_info.find(mfi) != cells_info.end()); - Subdomain_index n_index = cells_info.at(mfi); - if (Subdomain_index() != n_index) - c3t3.add_to_complex(new_cell, n_index); - else - new_cell->set_subdomain_index(Subdomain_index()); + Cell_info c_info = cells_info.at(mfi); + treat_new_cell(new_cell, c_info.subdomain_index_, + cell_selector, c_info.selected_, c3t3); // get surface info back CGAL_assertion(facets_info.find(mfi) != facets_info.end()); - const std::pair v_and_opp_patch = facets_info.at(mfi); + const Facet_info v_and_opp_patch = facets_info.at(mfi); // facet opposite to new_v (status wrt c3t3 is unchanged) new_cell->set_surface_patch_index(new_cell->index(new_v), mfi.first->surface_patch_index(mfi.second)); // new half-facet (added or not to c3t3 depending on the stored surface patch index) - if (Surface_patch_index() == v_and_opp_patch.second) - new_cell->set_surface_patch_index(new_cell->index(v_and_opp_patch.first), + if (Surface_patch_index() == v_and_opp_patch.patch_index_) + new_cell->set_surface_patch_index(new_cell->index(v_and_opp_patch.opp_vertex_), Surface_patch_index()); else c3t3.add_to_complex(new_cell, - new_cell->index(v_and_opp_patch.first), - v_and_opp_patch.second); + new_cell->index(v_and_opp_patch.opp_vertex_), + v_and_opp_patch.patch_index_); // newly created internal facet for (int i = 0; i < 4; ++i) @@ -299,7 +304,7 @@ void split_long_edges(C3T3& c3t3, continue; visitor.before_split(tr, edge); - Vertex_handle vh = split_edge(edge, c3t3); + Vertex_handle vh = split_edge(edge, cell_selector, c3t3); if(vh != Vertex_handle()) visitor.after_split(tr, vh); diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h index b4f1093393d..0d68c959ccb 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_adaptive_remeshing_impl.h @@ -58,29 +58,20 @@ public: template struct All_cells_selected { - typedef typename Tr::Cell_handle argument_type; - typedef typename Tr::Cell::Subdomain_index Subdomain_index; + using key_type = typename Tr::Cell_handle; + using value_type = bool; + using reference = bool; + using category = boost::read_write_property_map_tag; - typedef bool result_type; - - result_type operator()(const argument_type c) const + friend value_type get(const All_cells_selected&, const key_type& c) { - return c->subdomain_index() != Subdomain_index(); + using SI = typename Tr::Cell::Subdomain_index; + return c->subdomain_index() != SI(); } + friend void put(All_cells_selected&, const key_type&, const value_type) + {} //nothing to do : subdomain indices are updated in remeshing}; }; -template -struct No_constraint_pmap -{ -public: - typedef Primitive key_type; - typedef bool value_type; - typedef value_type reference; - typedef boost::read_write_property_map_tag category; - - friend value_type get(No_constraint_pmap, key_type) { return false; } - friend void put(No_constraint_pmap, key_type, value_type) {} -}; templatesubdomain_index(); if(!input_is_c3t3()) m_c3t3.remove_from_complex(cit); - m_c3t3.add_to_complex(cit, index); + if(Subdomain_index() != index) + m_c3t3.add_to_complex(cit, index); #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG ++nbc; @@ -421,10 +417,7 @@ private: if (!input_is_c3t3()) { for (int i = 0; i < 4; ++i) - { - if (cit->vertex(i)->in_dimension() == -1) - cit->vertex(i)->set_dimension(3); - } + cit->vertex(i)->set_dimension(3); } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG else if (input_is_c3t3() && m_c3t3.is_in_complex(cit)) @@ -453,8 +446,7 @@ private: for (int j = 0; j < 3; ++j) { Vertex_handle vij = f.first->vertex(Tr::vertex_triple_index(i, j)); - if (vij->in_dimension() == -1 || vij->in_dimension() > 2) - vij->set_dimension(2); + vij->set_dimension(2); } #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG ++nbf; @@ -486,12 +478,10 @@ private: m_c3t3.add_to_complex(e, 1); Vertex_handle v = e.first->vertex(e.second); - if (v->in_dimension() == -1 || v->in_dimension() > 1) - v->set_dimension(1); + v->set_dimension(1); v = e.first->vertex(e.third); - if (v->in_dimension() == -1 || v->in_dimension() > 1) - v->set_dimension(1); + v->set_dimension(1); #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG ++nbe; @@ -512,8 +502,7 @@ private: if(!m_c3t3.is_in_complex(vit)) m_c3t3.add_to_complex(vit, ++corner_id); - if (vit->in_dimension() == -1 || vit->in_dimension() > 0) - vit->set_dimension(0); + vit->set_dimension(0); vit->set_index(corner_id); @@ -535,6 +524,7 @@ private: CGAL::Tetrahedral_remeshing::debug::dump_vertices_by_dimension( m_c3t3.triangulation(), "c3t3_vertices_"); + CGAL::Tetrahedral_remeshing::debug::check_surface_patch_indices(m_c3t3); #endif } diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index 1be3eae9b0b..5814fc4fd28 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -441,7 +441,7 @@ bool is_boundary(const C3T3& c3t3, const CellSelector& cell_selector) { return c3t3.is_in_complex(f) - || cell_selector(f.first) != cell_selector(f.first->neighbor(f.second)); + || get(cell_selector, f.first) != get(cell_selector, f.first->neighbor(f.second)); } template @@ -497,7 +497,7 @@ bool is_boundary_vertex(const typename C3t3::Vertex_handle& v, { if (c3t3.is_in_complex(f)) return true; - if (cell_selector(f.first) ^ cell_selector(f.first->neighbor(f.second))) + if (get(cell_selector, f.first) ^ get(cell_selector, f.first->neighbor(f.second))) return true; } return false; @@ -767,7 +767,7 @@ bool is_outside(const typename C3t3::Edge & edge, if (c3t3.is_in_complex(circ)) return false; // does circ belong to the selection? - if (cell_selector(circ)) + if (get(cell_selector, circ)) return false; ++circ; @@ -789,7 +789,7 @@ bool is_selected(const typename C3t3::Vertex_handle v, for(Cell_handle c : cells) { - if (cell_selector(c)) + if (get(cell_selector, c)) return true; } return false; @@ -814,7 +814,7 @@ bool is_internal(const typename C3t3::Edge& edge, return false; if (si != circ->subdomain_index()) return false; - if (!cell_selector(circ)) + if (!get(cell_selector, circ)) return false; if (c3t3.is_in_complex( circ, @@ -836,7 +836,7 @@ bool is_selected(const typename C3T3::Triangulation::Edge& e, Cell_circulator done = circ; do { - if (cell_selector(circ)) + if (get(cell_selector, circ)) return true; } while (++circ != done); @@ -1135,6 +1135,38 @@ void get_edge_info(const typename C3t3::Edge& edge, } } +namespace internal +{ + template + void treat_before_delete(typename C3t3::Cell_handle c, + CellSelector& cell_selector, + C3t3& c3t3) + { + if (c3t3.is_in_complex(c)) + c3t3.remove_from_complex(c); + if (get(cell_selector, c)) + put(cell_selector, c, false); + } + + template + void treat_new_cell(typename C3t3::Cell_handle c, + const typename C3t3::Subdomain_index& subdomain, + CellSelector& cell_selector, + const bool selected, + C3t3& c3t3) + { + //update C3t3 + using Subdomain_index = typename C3t3::Subdomain_index; + if (Subdomain_index() != subdomain) + c3t3.add_to_complex(c, subdomain); + else + c->set_subdomain_index(Subdomain_index()); + + //update cell_selector property map + put(cell_selector, c, selected); + } +} + namespace debug { @@ -1592,11 +1624,9 @@ void dump_cells_with_small_dihedral_angle(const Tr& tr, std::vector cells; std::vector indices; - for (typename Tr::Finite_cells_iterator cit = tr.finite_cells_begin(); - cit != tr.finite_cells_end(); ++cit) + for (Cell_handle c : tr.finite_cell_handles()) { - Cell_handle c = cit; - if (c->subdomain_index() != Subdomain_index() && cell_select(c)) + if (c->subdomain_index() != Subdomain_index() && get(cell_select, c)) { double dh = min_dihedral_angle(tr, c); if (dh < angle_bound) diff --git a/Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h b/Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h index b0374e64dd2..4a2dd01166b 100644 --- a/Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h +++ b/Tetrahedral_remeshing/include/CGAL/tetrahedral_remeshing.h @@ -26,6 +26,8 @@ #include #include +#include + #ifdef CGAL_DUMP_REMESHING_STEPS #include #endif @@ -224,24 +226,22 @@ void tetrahedral_isotropic_remeshing( Tetrahedral_remeshing::internal::All_cells_selected

    ()); typedef std::pair Edge_vv; - typedef Tetrahedral_remeshing::internal::No_constraint_pmap No_edge; typedef typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - No_edge//default + Constant_property_map//default > ::type ECMap; ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - No_edge()); + Constant_property_map(false)); typedef typename Tr::Facet Facet; - typedef Tetrahedral_remeshing::internal::No_constraint_pmap No_facet; typedef typename internal_np::Lookup_named_param_def < internal_np::facet_is_constrained_t, NamedParameters, - No_facet//default + Constant_property_map//default > ::type FCMap; FCMap fcmap = choose_parameter(get_parameter(np, internal_np::facet_is_constrained), - No_facet()); + Constant_property_map(false)); typedef typename internal_np::Lookup_named_param_def < internal_np::visitor_t, @@ -392,34 +392,33 @@ void tetrahedral_isotropic_remeshing( = choose_parameter(get_parameter(np, internal_np::smooth_constrained_edges), false); + typedef typename Tr::Cell_handle Cell_handle; typedef typename internal_np::Lookup_named_param_def < internal_np::cell_selector_t, NamedParameters, - Tetrahedral_remeshing::internal::All_cells_selected//default + Constant_property_map//default > ::type SelectionFunctor; SelectionFunctor cell_select = choose_parameter(get_parameter(np, internal_np::cell_selector), - Tetrahedral_remeshing::internal::All_cells_selected()); + Constant_property_map(true)); typedef std::pair Edge_vv; - typedef Tetrahedral_remeshing::internal::No_constraint_pmap No_edge; typedef typename internal_np::Lookup_named_param_def < internal_np::edge_is_constrained_t, NamedParameters, - No_edge//default + Constant_property_map//default > ::type ECMap; ECMap ecmap = choose_parameter(get_parameter(np, internal_np::edge_is_constrained), - No_edge()); + Constant_property_map(false)); typedef typename Tr::Facet Facet; - typedef Tetrahedral_remeshing::internal::No_constraint_pmap No_facet; typedef typename internal_np::Lookup_named_param_def < internal_np::facet_is_constrained_t, NamedParameters, - No_facet//default + Constant_property_map//default > ::type FCMap; FCMap fcmap = choose_parameter(get_parameter(np, internal_np::facet_is_constrained), - No_facet()); + Constant_property_map(false)); typedef typename internal_np::Lookup_named_param_def < internal_np::visitor_t, diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp index cf75b94c0a5..1e415320b5e 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_mesh_and_remesh_image.cpp @@ -39,7 +39,7 @@ int main() std::cerr << "Error: Cannot read file " << filename << std::endl; return EXIT_FAILURE; } - Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, 1e-9); + Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain(image, relative_error_bound = 1e-9); // Mesh criteria Facet_criteria facet_criteria(25, 20, 2); // angle, size, approximation diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp index 0d90df4938b..699820db5b4 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_of_one_subdomain.cpp @@ -48,20 +48,33 @@ void generate_input_two_subdomains(const std::size_t nbv, Remeshing_triangulatio #endif } -struct Cells_of_subdomain +template +struct Cells_of_subdomain_pmap { private: + using Cell_handle = typename Tr::Cell_handle; + const int m_subdomain; public: - Cells_of_subdomain(const int& subdomain) + using key_type = Cell_handle; + using value_type = bool; + using reference = bool; + using category = boost::read_write_property_map_tag; + + Cells_of_subdomain_pmap(const int& subdomain) : m_subdomain(subdomain) {} - bool operator()(Remeshing_triangulation::Cell_handle c) const + friend value_type get( + const Cells_of_subdomain_pmap& map, const key_type& c) { - return m_subdomain == c->subdomain_index(); + return (map.m_subdomain == c->subdomain_index()); } + friend void put( + Cells_of_subdomain_pmap&, const key_type&, const value_type) + {} //nothing to do : subdomain indices are updated in remeshing + }; int main(int argc, char* argv[]) @@ -75,7 +88,8 @@ int main(int argc, char* argv[]) generate_input_two_subdomains(1000, tr); CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length, - CGAL::parameters::cell_is_selected_map(Cells_of_subdomain(2))); + CGAL::parameters::cell_is_selected_map( + Cells_of_subdomain_pmap(2))); return EXIT_SUCCESS; } diff --git a/Three/doc/Three/Three.txt b/Three/doc/Three/Three.txt index 5d44b6c8eac..548f2e12893 100644 --- a/Three/doc/Three/Three.txt +++ b/Three/doc/Three/Three.txt @@ -392,7 +392,7 @@ Notice that an external plugin will not be automatically loaded in the Polyhedro \section example Examples -All the examples are de-activated in the cmake list outside of our testsuite. To tesr them, one must add `-DRUNNING_CGAL_AUTO_TEST=ON` to the cmake call. +All the examples are de-activated in the cmake list outside of our testsuite. To test them, one must add `-DCGAL_TEST_SUITE=ON` to the cmake call. \subsection example1 Creating a Basic Plugin \cgalExample{Three_examples/Basic_plugin.cpp} diff --git a/Three/include/CGAL/Three/Edge_container.h b/Three/include/CGAL/Three/Edge_container.h index 1db3c7ebaef..1de5f9be436 100644 --- a/Three/include/CGAL/Three/Edge_container.h +++ b/Three/include/CGAL/Three/Edge_container.h @@ -63,8 +63,8 @@ struct DEMO_FRAMEWORK_EXPORT Edge_container :public Primitive_container //! \brief initGL creates the `Vbo`s and `Vao`s of this `Edge_container`. //! \attention It must be called within a valid OpenGL context. The `draw()` function of an item is always a safe place to call this. //! - //! \todo Is it a good idea to call InitGL of each item in the scene so the developper doesn't have to worry about this in each draw() of each item ? - //!`. + //! \todo Is it a good idea to call InitGL of each item in the scene so the developer doesn't have to worry about this in each draw() of each item ? + //! //! \param viewer the active `Viewer_interface`. //! void initGL(Viewer_interface *viewer) Q_DECL_OVERRIDE; diff --git a/Three/include/CGAL/Three/Point_container.h b/Three/include/CGAL/Three/Point_container.h index 5527a76d8fc..5407ac40692 100644 --- a/Three/include/CGAL/Three/Point_container.h +++ b/Three/include/CGAL/Three/Point_container.h @@ -59,8 +59,8 @@ struct DEMO_FRAMEWORK_EXPORT Point_container :public Primitive_container //! \brief initGL creates the `Vbo`s and `Vao`s of this `Point_container`. //! \attention It must be called within a valid OpenGL context. The `draw()` function of an item is always a safe place to call this. //! - //! \todo Is it a good idea to call InitGL of each item in the scene so the developper doesn't have to worry about this in each draw() of each item ? - //!`. + //! \todo Is it a good idea to call InitGL of each item in the scene so the developer doesn't have to worry about this in each draw() of each item ? + //! //! \param viewer the active `Viewer_interface`. //! void initGL(Viewer_interface *viewer) Q_DECL_OVERRIDE; diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 89200e09dae..2b8ca29f8fc 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -1364,6 +1364,7 @@ Triangulation_data_structure else read(is, index); s->set_vertex(j, vertices[index]); + s->vertex(j)->set_full_cell(s); } // read other non-combinatorial information for the full_cells is >> (*s); diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index aeb3d8a5e50..c726891424f 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -22,8 +22,9 @@ if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("test_tds.cpp") create_single_source_cgal_program("test_torture.cpp") create_single_source_cgal_program("test_insert_if_in_star.cpp") + create_single_source_cgal_program("simple_io_test.cpp") foreach(target test_triangulation test_delaunay test_regular test_tds - test_torture test_insert_if_in_star) + test_torture test_insert_if_in_star simple_io_test) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() diff --git a/Triangulation/test/Triangulation/simple_io_test.cpp b/Triangulation/test/Triangulation/simple_io_test.cpp new file mode 100644 index 00000000000..2db4b5f8345 --- /dev/null +++ b/Triangulation/test/Triangulation/simple_io_test.cpp @@ -0,0 +1,21 @@ +#include +#include +#include + +int main() +{ + typedef CGAL::Delaunay_triangulation>> T; + T dt1(2), dt2(2); + + std::vector points; + points.emplace_back(1,0); + points.emplace_back(0,1); + points.emplace_back(2,2); + dt1.insert(points.begin(), points.end()); + + std::stringstream f; + f << dt1 << std::endl; + std::cout << f.str(); + f >> dt2; + assert(dt2.is_valid(true)); +} diff --git a/Triangulation/test/Triangulation/test_tds.cpp b/Triangulation/test/Triangulation/test_tds.cpp index e1d4ceeb54b..a9e0154b16c 100644 --- a/Triangulation/test/Triangulation/test_tds.cpp +++ b/Triangulation/test/Triangulation/test_tds.cpp @@ -104,6 +104,7 @@ void test(const int d, const string & type) CGAL::IO::set_binary_mode(fi); TDS input_tds(d); fi >> input_tds; + assert( input_tds.is_valid(true) ); fi.close(); // TEST Copy Constructor diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index 9d294ac7ec2..56a07c13fa8 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -163,7 +163,7 @@ public: : Ctr(gt) { insert_constraints(lc.begin(), lc.end()); - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } template @@ -173,7 +173,7 @@ public: : Ctr(gt) { insert_constraints(it, last); - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } virtual ~Constrained_Delaunay_triangulation_2() {} @@ -448,7 +448,7 @@ public: OutputItFaces fit, OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition( dimension() == 2); + CGAL_precondition( dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p,lt,li, start); @@ -467,7 +467,7 @@ public: pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit,eit); } @@ -702,7 +702,7 @@ flip (Face_handle& f, int i) // The following precondition prevents the test suit // of triangulation to work on constrained Delaunay triangulation - //CGAL_triangulation_precondition(is_flipable(f,i)); + //CGAL_precondition(is_flipable(f,i)); this->_tds.flip(f, i); // restore constraint status @@ -945,9 +945,9 @@ remove(Vertex_handle v) // remove a vertex and updates the constrained edges of the new faces // precondition : there is no incident constraints { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( ! is_infinite(v)); - CGAL_triangulation_precondition( ! are_there_incident_constraints(v)); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( ! is_infinite(v)); + CGAL_precondition( ! are_there_incident_constraints(v)); if (dimension() <= 1) Ctr::remove(v); else remove_2D(v); return; @@ -1016,13 +1016,13 @@ Constrained_Delaunay_triangulation_2:: is_valid(bool verbose, int level) const { bool result = Ctr::is_valid(verbose, level); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); Finite_faces_iterator fit= finite_faces_begin(); for (; fit != finite_faces_end(); fit++) { for(int i=0;i<3;i++) { result = result && !is_flipable(fit,i, false); - CGAL_triangulation_assertion( result ); + CGAL_assertion( result ); } } return result; diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 37637b2909f..11531498530 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -204,7 +204,7 @@ public: for( ;lcit != lc.end(); lcit++) { insert( (*lcit).first, (*lcit).second); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } template @@ -216,7 +216,7 @@ public: for ( ; it != last; it++) { insert_constraint((*it).first, (*it).second); } - CGAL_triangulation_postcondition( is_valid() ); + CGAL_postcondition( is_valid() ); } //TODO Is that destructor correct ? @@ -335,7 +335,7 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb, OutputIterator out) // if a vertex vc of t lies on segment ab // of if ab intersect some constrained edges { - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); Vertex_handle vi; Face_handle fr; @@ -810,7 +810,7 @@ insert_constraint(Vertex_handle vaa, Vertex_handle vbb) while(! stack.empty()){ boost::tie(vaa,vbb) = stack.top(); stack.pop(); - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_2::insert_constraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() @@ -1073,9 +1073,9 @@ intersect(Face_handle f, int i, const Point& pc = f->vertex(cw(i))->point(); const Point& pd = f->vertex(ccw(i))->point(); Point pi; - CGAL_triangulation_assertion_code( bool ok = ) + CGAL_assertion_code( bool ok = ) intersection(geom_traits(), pa, pb, pc, pd, pi, itag ); - CGAL_triangulation_assertion(ok); + CGAL_assertion(ok); Vertex_handle vi = virtual_insert(pi, Triangulation::EDGE, f, i); return vi; } @@ -1308,7 +1308,7 @@ update_constraints_incident(Vertex_handle va, //dimension() ==2 int cwi, ccwi, indf; Face_circulator fc=incident_faces(va), done(fc); - CGAL_triangulation_assertion(fc != nullptr); + CGAL_assertion(fc != nullptr); do { indf = fc->index(va); cwi=cw(indf); @@ -1356,7 +1356,7 @@ update_constraints_opposite(Vertex_handle va) // update status of edges opposite to a // after insertion of a { - CGAL_triangulation_assertion(dimension()==2); + CGAL_assertion(dimension()==2); Face_handle f=va->face(), start=f; int indf; do { @@ -1463,9 +1463,9 @@ remove(Vertex_handle v) // remove a vertex and updates the constrained edges of the new faces // precondition : there is no incident constraints { - CGAL_triangulation_precondition( v != Vertex_handle() ); - CGAL_triangulation_precondition( ! is_infinite(v)); - CGAL_triangulation_precondition( ! are_there_incident_constraints(v)); + CGAL_precondition( v != Vertex_handle() ); + CGAL_precondition( ! is_infinite(v)); + CGAL_precondition( ! are_there_incident_constraints(v)); if (number_of_vertices() == 1) remove_first(v); else if (number_of_vertices() == 2) remove_second(v); diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h index 382d408abfb..941de300ded 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_face_base_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include namespace CGAL { @@ -109,7 +109,7 @@ inline void Constrained_triangulation_face_base_2:: set_constraint(int i, bool b) { - CGAL_triangulation_precondition( i == 0 || i == 1 || i == 2); + CGAL_precondition( i == 0 || i == 1 || i == 2); C[i] = b; } diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 5a88fdc9efa..50ca1f4bfec 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -232,7 +232,7 @@ public: , hierarchy(Vh_less_xy(this)) { insert_constraints(first, last); - CGAL_triangulation_postcondition( this->is_valid() ); + CGAL_postcondition( this->is_valid() ); } @@ -242,7 +242,7 @@ public: , hierarchy(Vh_less_xy(this)) { insert_constraints(constraints.begin(), constraints.end()); - CGAL_triangulation_postcondition( this->is_valid() ); + CGAL_postcondition( this->is_valid() ); } //Helping void clear() { Base::clear(); hierarchy.clear(); } @@ -898,7 +898,7 @@ insert_subconstraint(Vertex_handle vaa, while(! stack.empty()){ boost::tie(vaa,vbb) = stack.top(); stack.pop(); - CGAL_triangulation_precondition( vaa != vbb); + CGAL_precondition( vaa != vbb); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS std::cerr << CGAL::internal::cdt_2_indent_level << "CT_plus_2::insert_subconstraint, stack pop=( #" << vaa->time_stamp() << "= " << vaa->point() @@ -1055,7 +1055,7 @@ copy_triangulation(const Constrained_triangulation_plus_2 &ctp) Vertex_iterator vit = ctp.vertices_begin(); Vertex_iterator vvit = this->vertices_begin(); for( ; vit != ctp.vertices_end(); ++vit, ++vvit) { - CGAL_triangulation_assertion(vit->point() == vvit->point()); + CGAL_assertion(vit->point() == vvit->point()); vmap[vit] = vvit; } hierarchy.copy(ctp.hierarchy, vmap); @@ -1167,12 +1167,12 @@ intersect(Face_handle f, int i, Vertex_handle vcc, vdd; vcc = f->vertex(cw(i)); vdd = f->vertex(ccw(i)); - CGAL_triangulation_assertion_code( bool b1 = ) + CGAL_assertion_code( bool b1 = ) hierarchy.enclosing_constraint(vcc,vdd,vc,vd); - CGAL_triangulation_assertion_code( bool b2 = ) + CGAL_assertion_code( bool b2 = ) hierarchy.enclosing_constraint(vaa,vbb,va,vb); - CGAL_triangulation_assertion(b1); - CGAL_triangulation_assertion(b2); + CGAL_assertion(b1); + CGAL_assertion(b2); const Point& pa = va->point(); const Point& pb = vb->point(); @@ -1189,9 +1189,9 @@ intersect(Face_handle f, int i, Point pi(ORIGIN); // initialize although we are sure that it will be // set by the intersection, but to quiet a warning Intersection_tag itag = Intersection_tag(); - CGAL_triangulation_assertion_code( bool ok = ) + CGAL_assertion_code( bool ok = ) intersection(geom_traits(), pa, pb, pc, pd, pi, itag ); - CGAL_triangulation_assertion(ok); + CGAL_assertion(ok); Vertex_handle vi = insert(pi, Triangulation::EDGE, f, i); #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS diff --git a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h index 134027f99c0..f730bb08efc 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -88,7 +88,7 @@ public: Delaunay_triangulation_2( const Delaunay_triangulation_2 &tr) : Triangulation_2(tr) - { CGAL_triangulation_postcondition(is_valid()); } + { CGAL_postcondition(is_valid()); } Delaunay_triangulation_2(Delaunay_triangulation_2&&) = default; Delaunay_triangulation_2& operator=(const Delaunay_triangulation_2&) = default; @@ -404,7 +404,7 @@ public: OutputItBoundaryEdges eit, Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition(this->dimension() == 2); + CGAL_precondition(this->dimension() == 2); int li; Locate_type lt; Face_handle fh = this->locate(p,lt,li, start); @@ -422,7 +422,7 @@ public: pit = propagate_conflicts(p,fh,2,pit); return pit; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return std::make_pair(fit,eit); } @@ -674,7 +674,7 @@ is_valid(bool verbose, int level) const result = result && ON_POSITIVE_SIDE != side_of_oriented_circle(it, this->mirror_vertex(it,i)->point(), false); } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } return result; @@ -705,7 +705,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: nearest_vertex_2D(const Point& p, Face_handle f) const { - CGAL_triangulation_precondition(this->dimension() == 2); + CGAL_precondition(this->dimension() == 2); f = this->locate(p,f); typename Geom_traits::Compare_distance_2 @@ -775,8 +775,8 @@ typename Delaunay_triangulation_2::Point Delaunay_triangulation_2:: dual(Face_handle f) const { - CGAL_triangulation_precondition(this->_tds.is_face(f)); - CGAL_triangulation_precondition(this->dimension()==2); + CGAL_precondition(this->_tds.is_face(f)); + CGAL_precondition(this->dimension()==2); return circumcenter(f); } @@ -785,12 +785,12 @@ Object Delaunay_triangulation_2:: dual(const Edge &e) const { - CGAL_triangulation_precondition(this->_tds.is_edge(e.first,e.second)); + CGAL_precondition(this->_tds.is_edge(e.first,e.second)); typedef typename Geom_traits::Line_2 Line; typedef typename Geom_traits::Ray_2 Ray; - CGAL_triangulation_precondition (!this->is_infinite(e)); + CGAL_precondition (!this->is_infinite(e)); if(this->dimension()== 1) { const Point& p = (e.first)->vertex(cw(e.second))->point(); const Point& q = (e.first)->vertex(ccw(e.second))->point(); @@ -1031,8 +1031,8 @@ void Delaunay_triangulation_2:: remove_and_give_new_faces(Vertex_handle v, OutputItFaces fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!this->is_infinite(v)); if(this->number_of_vertices() == 1) this->remove_first(v); else if(this->number_of_vertices() == 2) this->remove_second(v); @@ -1071,8 +1071,8 @@ remove(Vertex_handle v) { int d; - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!this->is_infinite(v)); if(this->dimension() <= 1) { Triangulation::remove(v); return; } @@ -2119,7 +2119,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2167,7 +2167,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f = v->face(); int i = f->index(v); if(i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2177,7 +2177,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if(i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2249,7 +2249,7 @@ typename Delaunay_triangulation_2::Vertex_handle Delaunay_triangulation_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -2264,9 +2264,9 @@ bool Delaunay_triangulation_2:: is_delaunay_after_displacement(Vertex_handle v, const Point &p) const { - CGAL_triangulation_precondition(!this->is_infinite(v)); - CGAL_triangulation_precondition(this->dimension() == 2); - CGAL_triangulation_precondition(!this->test_dim_down(v)); + CGAL_precondition(!this->is_infinite(v)); + CGAL_precondition(this->dimension() == 2); + CGAL_precondition(!this->test_dim_down(v)); if(v->point() == p) return true; Point ant = v->point(); v->set_point(p); @@ -2320,7 +2320,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, const Point &p, OutputItFaces oif) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2374,7 +2374,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f = v->face(); int i = f->index(v); if(i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2385,7 +2385,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if(i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index fe4b02f7f41..145b387263f 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -563,7 +564,7 @@ public: Face_handle start = Face_handle()) const { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); int li; Locate_type lt; Face_handle fh = locate(p,lt,li, start); @@ -640,7 +641,7 @@ public: } return make_triple(fit, eit, vit); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return make_triple(fit, eit, vit); } @@ -771,7 +772,7 @@ copy_triangulation_() for(; hvit != hidden_vertices_end() ; ++hvit){ hvit->face()->vertex_list().push_back(hvit); } - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } template < class Gt, class Tds > @@ -838,7 +839,7 @@ power_test(const Face_handle& f, int i, const Weighted_point &p) const // p is supposed to be on edge(f,i) // return ON_NEGATIVE_SIDE if p is above(f,i) // (p has to be hidden) - CGAL_triangulation_precondition(!is_infinite(f,i) && + CGAL_precondition(!is_infinite(f,i) && orientation(f->vertex(ccw(i))->point(), f->vertex(cw(i))->point(), p) == COLLINEAR); @@ -857,7 +858,7 @@ power_test(const Weighted_point &p0, const Weighted_point &p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2) == POSITIVE); using namespace boost; @@ -887,7 +888,7 @@ power_test(const Weighted_point &p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -920,7 +921,7 @@ is_valid_face(Face_handle fh) const bool result = true; if(is_infinite(fh)) result = result && fh->vertex_list().empty(); if(!result) { show_face(fh);} - CGAL_triangulation_assertion(result); + CGAL_assertion(result); typename Vertex_list::iterator vlit = fh->vertex_list().begin(), vldone = fh->vertex_list().end(); @@ -928,7 +929,7 @@ is_valid_face(Face_handle fh) const result = result && power_test(fh,(*vlit)->point()) == ON_NEGATIVE_SIDE; result = result &&((*vlit)->face() == fh); if(!result) show_face(fh); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; } @@ -978,7 +979,7 @@ is_valid_vertex(Vertex_handle vh) const // show_face(vh->face()); // } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1022,7 +1023,7 @@ is_valid(bool verbose, int /* level */) const it2->point(), it3->point()); result = result && s == COLLINEAR ; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); ++it1 ; ++it2; ++it3; } } @@ -1030,18 +1031,18 @@ is_valid(bool verbose, int /* level */) const case 2 : for(Finite_faces_iterator it=finite_faces_begin(); it!=finite_faces_end(); it++) { - CGAL_triangulation_assertion(! is_infinite(it)); + CGAL_assertion(! is_infinite(it)); Orientation s = orientation(it->vertex(0)->point(), it->vertex(1)->point(), it->vertex(2)->point()); - CGAL_triangulation_assertion(s == LEFT_TURN); + CGAL_assertion(s == LEFT_TURN); result = result && (s == LEFT_TURN); for(int i = 0 ; i < 3 ; i++) { if(!is_infinite(it->vertex(i))) result = result && ON_POSITIVE_SIDE != power_test(it->neighbor(i), it->vertex(i)->point()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } } @@ -1053,7 +1054,7 @@ is_valid(bool verbose, int /* level */) const Orientation s = orientation(pc->point(), qc->point(), rc->point()); - CGAL_triangulation_assertion(s != LEFT_TURN); + CGAL_assertion(s != LEFT_TURN); result = result && (s != LEFT_TURN); ++pc ; ++qc ; ++rc; } while(pc != start); @@ -1063,7 +1064,7 @@ is_valid(bool verbose, int /* level */) const result = result && (number_of_faces() == 2*(number_of_vertices()+1) - 4 - degree(infinite_vertex())); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; } @@ -1075,7 +1076,7 @@ is_valid(bool verbose, int /* level */) const } result = result && (Base::number_of_vertices() == number_of_vertices() + number_of_hidden_vertices()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1167,7 +1168,7 @@ typename Regular_triangulation_2::Bare_point Regular_triangulation_2:: weighted_circumcenter(Face_handle f) const { - CGAL_triangulation_precondition(dimension() == 2 || !is_infinite(f)); + CGAL_precondition(dimension() == 2 || !is_infinite(f)); return weighted_circumcenter(f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point()); @@ -1194,7 +1195,7 @@ dual(const Edge &e) const typedef typename Geom_traits::Ray_2 Ray; typedef typename Geom_traits::Segment_2 Segment; - CGAL_triangulation_precondition(! is_infinite(e)); + CGAL_precondition(! is_infinite(e)); if(dimension() == 1){ const Weighted_point& p = (e.first)->vertex(cw(e.second))->point(); const Weighted_point& q = (e.first)->vertex(ccw(e.second))->point(); @@ -1354,7 +1355,7 @@ typename Regular_triangulation_2::Vertex_handle Regular_triangulation_2:: reinsert(Vertex_handle v, Face_handle start) { - CGAL_triangulation_assertion(v->is_hidden()); + CGAL_assertion(v->is_hidden()); v->set_hidden(false); _hidden_vertices--; @@ -1385,8 +1386,8 @@ void Regular_triangulation_2:: exchange_hidden(Vertex_handle va, Vertex_handle vb) { - CGAL_triangulation_assertion(vb->is_hidden()); - CGAL_triangulation_assertion(vb == vb->face()->vertex_list().back()); + CGAL_assertion(vb->is_hidden()); + CGAL_assertion(vb == vb->face()->vertex_list().back()); // //to debug // std::cerr << "from exchange hidden 1" << std::endl; @@ -1411,7 +1412,7 @@ void Regular_triangulation_2:: exchange_incidences(Vertex_handle va, Vertex_handle vb) { - CGAL_triangulation_assertion(!vb->is_hidden()); + CGAL_assertion(!vb->is_hidden()); std::list faces; if(dimension() == 0) { faces.push_back(vb->face()); @@ -1421,7 +1422,7 @@ exchange_incidences(Vertex_handle va, Vertex_handle vb) faces.push_back(vb->face()->neighbor(1-i)); } else { - CGAL_triangulation_assertion(dimension() == 2); + CGAL_assertion(dimension() == 2); Face_circulator fc = incident_faces(vb), done(fc); do { faces.push_back(fc); @@ -1486,7 +1487,7 @@ void Regular_triangulation_2:: regularize(Vertex_handle v) { - CGAL_triangulation_precondition(v != infinite_vertex()); + CGAL_precondition(v != infinite_vertex()); Faces_around_stack faces_around; if(dimension() < 1) return; @@ -1553,8 +1554,8 @@ void Regular_triangulation_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); if(v->is_hidden()) return remove_hidden(v); @@ -1821,7 +1822,7 @@ void Regular_triangulation_2:: update_hidden_points_2_2(const Face_handle& f1, const Face_handle& f2) { - CGAL_triangulation_assertion(f1->has_neighbor(f2)); + CGAL_assertion(f1->has_neighbor(f2)); Vertex_list p_list; p_list.splice(p_list.begin(), f1->vertex_list()); @@ -1862,7 +1863,7 @@ update_hidden_points_2_2(const Face_handle& f1, const Face_handle& f2) int idx2 = f1->index(f2); Vertex_handle v0=f1->vertex(ccw(idx2)); Vertex_handle v1=f1->vertex(cw(idx2)); - CGAL_triangulation_assertion(!is_infinite(v0) && !is_infinite(v1)); + CGAL_assertion(!is_infinite(v0) && !is_infinite(v1)); while(! p_list.empty()) { @@ -1883,7 +1884,7 @@ Regular_triangulation_2:: update_hidden_points_1_3(const Face_handle& f1, const Face_handle& f2, const Face_handle& f3) { - CGAL_triangulation_assertion(f1->has_neighbor(f2) && + CGAL_assertion(f1->has_neighbor(f2) && f2->has_neighbor(f3) && f3->has_neighbor(f1)); @@ -1903,9 +1904,9 @@ update_hidden_points_1_3(const Face_handle& f1, const Face_handle& f2, v0 = f1->vertex(3-(idx2+idx3)), v1 = f2->vertex(f2->index(f1)); - CGAL_triangulation_assertion(f2->has_vertex(v0) && f1->has_vertex(v0)); - CGAL_triangulation_assertion(f3->has_vertex(v1)); - CGAL_triangulation_assertion(! is_infinite(v0)); + CGAL_assertion(f2->has_vertex(v0) && f1->has_vertex(v0)); + CGAL_assertion(f3->has_vertex(v1)); + CGAL_assertion(! is_infinite(v0)); // if two of f1, f2,and f3 are infinite // the list goes entirely to the third finite face @@ -2216,7 +2217,7 @@ typename Regular_triangulation_2::Vertex_handle Regular_triangulation_2:: finite_vertex() const { - CGAL_triangulation_precondition(number_of_vertices() >= 1); + CGAL_precondition(number_of_vertices() >= 1); return(finite_vertices_begin()); } diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h index 4e0447c39c3..db27f39b00d 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 3d2a6e73629..5b5725f86de 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -737,7 +737,7 @@ bool well_oriented(Vertex_handle v) const } bool from_convex_hull(Vertex_handle v) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); Vertex_circulator vc = incident_vertices(v), done(vc); do { if(is_infinite(vc)) return true; } while(++vc != done); return false; @@ -864,7 +864,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: finite_vertex() const { - CGAL_triangulation_precondition (number_of_vertices() >= 1); + CGAL_precondition (number_of_vertices() >= 1); return (finite_vertices_begin()); } @@ -895,50 +895,78 @@ is_valid(bool verbose, int level) const if (dimension() <= 0 || (dimension()==1 && number_of_vertices() == 2 ) ) return result; - if (dimension() == 1) { + if (dimension() == 1) + { Finite_vertices_iterator it1 = finite_vertices_begin(), it2(it1), it3(it1); ++it2; ++it3; ++it3; while( it3 != finite_vertices_end()) { - Orientation s = orientation(it1->point(), - it2->point(), - it3->point()); - result = result && s == COLLINEAR ; - CGAL_triangulation_assertion(result); + Orientation s = orientation(point(it1), point(it2), point(it3)); + result = result && (s == COLLINEAR) ; + if(verbose && (s != COLLINEAR)) + { + std::cerr << "Error: " << point(it1) << " " + << point(it2) << " and " + << point(it3) << " are not collinear" << std::endl; + } + + CGAL_assertion(result); ++it1 ; ++it2; ++it3; } } - else { //dimension() == 2 - for(Finite_faces_iterator it=finite_faces_begin(); - it!=finite_faces_end(); it++) { - CGAL_triangulation_assertion( ! is_infinite(it)); - Orientation s = orientation(it->vertex(0)->point(), - it->vertex(1)->point(), - it->vertex(2)->point()); - CGAL_triangulation_assertion( s == LEFT_TURN ); + else //dimension() == 2 + { + for(Finite_faces_iterator it=finite_faces_begin(); it!=finite_faces_end(); it++) + { + CGAL_assertion( ! is_infinite(it)); + Orientation s = orientation(point(it, 0), point(it, 1), point(it, 2)); result = result && ( s == LEFT_TURN ); + + if(verbose && (s != LEFT_TURN)) + { + std::cerr << "Error: " << point(it, 0) << " " + << point(it, 1) << " and " + << point(it, 2) << " form a badly oriented face" << std::endl; + } + + CGAL_assertion(result); } Vertex_circulator start = incident_vertices(infinite_vertex()); Vertex_circulator pc(start); Vertex_circulator qc(start); ++qc; Vertex_circulator rc(start); ++rc; ++rc; - do { - Orientation s = orientation(pc->point(), - qc->point(), - rc->point()); - CGAL_triangulation_assertion( s != LEFT_TURN ); + do + { + Orientation s = orientation(point(pc), point(qc), point(rc)); + CGAL_assertion( s != LEFT_TURN ); result = result && ( s != LEFT_TURN ); + + if(verbose && (s == LEFT_TURN)) + { + std::cerr << "Error: " << point(pc) << " " + << point(qc) << " and " + << point(rc) << " form a badly oriented infinite face" << std::endl; + } + ++pc ; ++qc ; ++rc; } while(pc != start); // check number of faces. This cannot be done by the Tds // which does not know the number of components nor the genus - result = result && (number_of_faces() == 2*(number_of_vertices()+1) - - 4 - - degree(infinite_vertex())); - CGAL_triangulation_assertion( result); + const bool genus_check = number_of_faces() == 2*(number_of_vertices()+1) - 4 - degree(infinite_vertex()); + result = result && genus_check; + if(verbose && !genus_check) + { + std::cerr << "Error: Genus check fail " << number_of_faces() + << " vs " << 2*(number_of_vertices()+1) - 4 - degree(infinite_vertex()) + << " (nv = " << number_of_vertices() + << " nf = " << number_of_faces() + << " and degree(infinite_vertex()) = " << degree(infinite_vertex()) << std::endl; + } + + CGAL_assertion( result); } return result; } @@ -1080,9 +1108,9 @@ const typename Triangulation_2::Point& Triangulation_2:: point(Face_handle f, int i) const { - CGAL_triangulation_precondition( dimension() >= 0 ); - CGAL_triangulation_precondition( i >= 0 && i <= dimension() ); - CGAL_triangulation_precondition( ! is_infinite(f->vertex(i)) ); + CGAL_precondition( dimension() >= 0 ); + CGAL_precondition( i >= 0 && i <= dimension() ); + CGAL_precondition( ! is_infinite(f->vertex(i)) ); return f->vertex(i)->point(); } @@ -1091,8 +1119,8 @@ const typename Triangulation_2::Point& Triangulation_2:: point(Vertex_handle v) const { - CGAL_triangulation_precondition( dimension() >= 0 ); - CGAL_triangulation_precondition( ! is_infinite(v) ); + CGAL_precondition( dimension() >= 0 ); + CGAL_precondition( ! is_infinite(v) ); return v->point(); } @@ -1101,7 +1129,7 @@ typename Triangulation_2::Segment Triangulation_2:: segment(Face_handle f, int i) const { - CGAL_triangulation_precondition( ! is_infinite(f,i)); + CGAL_precondition( ! is_infinite(f,i)); typename Gt::Construct_segment_2 construct_segment = geom_traits().construct_segment_2_object(); return construct_segment(construct_point(f->vertex(ccw(i))->point()), @@ -1113,7 +1141,7 @@ typename Triangulation_2::Segment Triangulation_2:: segment(const Edge& e) const { - CGAL_triangulation_precondition(! is_infinite(e)); + CGAL_precondition(! is_infinite(e)); typename Gt::Construct_segment_2 construct_segment = geom_traits().construct_segment_2_object(); return construct_segment(construct_point(e.first->vertex(ccw(e.second))->point()), @@ -1149,7 +1177,7 @@ typename Triangulation_2::Triangle Triangulation_2:: triangle(Face_handle f) const { - CGAL_triangulation_precondition( ! is_infinite(f) ); + CGAL_precondition( ! is_infinite(f) ); typename Gt::Construct_triangle_2 construct_triangle = geom_traits().construct_triangle_2_object(); return construct_triangle(construct_point(f->vertex(0)->point()), @@ -1162,13 +1190,13 @@ void Triangulation_2:: flip(Face_handle f, int i) { - CGAL_triangulation_precondition ( f != Face_handle() ); - CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2); - CGAL_triangulation_precondition( dimension()==2); + CGAL_precondition ( f != Face_handle() ); + CGAL_precondition (i == 0 || i == 1 || i == 2); + CGAL_precondition( dimension()==2); - CGAL_triangulation_precondition( !is_infinite(f) && + CGAL_precondition( !is_infinite(f) && !is_infinite(f->neighbor(i)) ); - CGAL_triangulation_precondition( + CGAL_precondition( orientation(f->vertex(i)->point(), f->vertex(cw(i))->point(), mirror_vertex(f,i)->point()) == RIGHT_TURN && @@ -1184,7 +1212,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_first(const Point& p) { - CGAL_triangulation_precondition(number_of_vertices() == 0); + CGAL_precondition(number_of_vertices() == 0); Vertex_handle v = _tds.insert_second(); v->set_point(p); return v; @@ -1195,7 +1223,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_second(const Point& p) { - CGAL_triangulation_precondition(number_of_vertices() == 1); + CGAL_precondition(number_of_vertices() == 1); Vertex_handle v = _tds.insert_dim_up(infinite_vertex(), true); v->set_point(p); return v; @@ -1206,7 +1234,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_in_edge(const Point& p, Face_handle f,int i) { - CGAL_triangulation_exactness_precondition( + CGAL_exactness_precondition( orientation(f->vertex(cw(i))->point(), p, f->vertex(ccw(i))->point()) == COLLINEAR && collinear_between(f->vertex(cw(i))->point(), p, @@ -1221,7 +1249,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_in_face(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(oriented_side(f,p) == ON_POSITIVE_SIDE); + CGAL_precondition(oriented_side(f,p) == ON_POSITIVE_SIDE); Vertex_handle v= _tds.insert_in_face(f); v->set_point(p); return v; @@ -1232,7 +1260,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(is_infinite(f) && dimension() >= 1); + CGAL_precondition(is_infinite(f) && dimension() >= 1); Vertex_handle v; if (dimension() == 1) v=insert_outside_convex_hull_1(p, f); @@ -1248,8 +1276,8 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull_1(const Point& p, Face_handle f) { - CGAL_triangulation_precondition( is_infinite(f) && dimension()==1); - CGAL_triangulation_precondition( + CGAL_precondition( is_infinite(f) && dimension()==1); + CGAL_precondition( orientation(mirror_vertex(f, f->index(infinite_vertex()))->point(), f->vertex(1- f->index(infinite_vertex()))->point(), p) == COLLINEAR && @@ -1266,11 +1294,11 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_convex_hull_2(const Point& p, Face_handle f) { - CGAL_triangulation_precondition(is_infinite(f)); + CGAL_precondition(is_infinite(f)); int li = f->index(infinite_vertex()); - CGAL_triangulation_precondition( + CGAL_precondition( orientation(p, f->vertex(ccw(li))->point(), f->vertex(cw(li))->point()) == LEFT_TURN); @@ -1331,14 +1359,14 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: insert_outside_affine_hull(const Point& p) { - CGAL_triangulation_precondition(dimension() < 2); + CGAL_precondition(dimension() < 2); bool conform = false; if (dimension() == 1) { Face_handle f = (*finite_edges_begin()).first; Orientation orient = orientation( f->vertex(0)->point(), f->vertex(1)->point(), p); - CGAL_triangulation_precondition(orient != COLLINEAR); + CGAL_precondition(orient != COLLINEAR); conform = ( orient == COUNTERCLOCKWISE); } Vertex_handle v = _tds.insert_dim_up( infinite_vertex(), conform); @@ -1384,7 +1412,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int li) case VERTEX: return loc->vertex(li); } - CGAL_triangulation_assertion(false); // locate step failed + CGAL_assertion(false); // locate step failed return Vertex_handle(); } @@ -1431,8 +1459,8 @@ void Triangulation_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); if (number_of_vertices() == 1) remove_first(v); @@ -1463,7 +1491,7 @@ test_dim_down(Vertex_handle v) const //it goes down to 1 iff // 1) any finite face is incident to v // 2) all vertices are collinear - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); bool dim1 = true; Finite_faces_iterator fit = finite_faces_begin(); while (dim1==true && fit != finite_faces_end()) { @@ -1564,8 +1592,8 @@ void Triangulation_2:: remove_and_give_new_faces(Vertex_handle v, OutputItFaces fit) { - CGAL_triangulation_precondition( v != Vertex_handle()); - CGAL_triangulation_precondition( !is_infinite(v)); + CGAL_precondition( v != Vertex_handle()); + CGAL_precondition( !is_infinite(v)); if(number_of_vertices() == 1) remove_first(v); else if(number_of_vertices() == 2) remove_second(v); @@ -2161,7 +2189,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: move_if_no_collision(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = dimension(); @@ -2192,7 +2220,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2202,7 +2230,7 @@ move_if_no_collision(Vertex_handle v, const Point &p) Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if (i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2264,7 +2292,7 @@ typename Triangulation_2::Vertex_handle Triangulation_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -2282,7 +2310,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, const Point &p, OutputItFaces oif) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = this->dimension(); @@ -2318,7 +2346,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f = v->face(); int i = f->index(v); if (i==0) {f = f->neighbor(1);} - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Face_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -2329,7 +2357,7 @@ move_if_no_collision_and_give_new_faces(Vertex_handle v, Face_handle f_ins = inserted->face(); i = f_ins->index(inserted); if (i==0) {f_ins = f_ins->neighbor(1);} - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Face_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -2551,7 +2579,7 @@ march_locate_1D(const Point& t, return (*eit).first; } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Face_handle(); } @@ -2563,7 +2591,7 @@ march_locate_2D_LFC(Face_handle start, Locate_type& lt, int& li) const { - // CGAL_triangulation_precondition( ! is_infinite(start) ); + // CGAL_precondition( ! is_infinite(start) ); const Point& p = start->vertex(0)->point(); const Point& q = start->vertex(1)->point(); const Point& r = start->vertex(2)->point(); @@ -2641,7 +2669,7 @@ march_locate_2D_LFC(Face_handle start, } } while (--fc != done); //should not arrive there; - CGAL_triangulation_assertion(fc != done); + CGAL_assertion(fc != done); } while(! lfc.locate(t, lt, li) ){ @@ -2685,7 +2713,7 @@ compare_walks(const Point& p, show_face(c2); std::cerr << std::endl; } - CGAL_triangulation_assertion(b); + CGAL_assertion(b); } @@ -2698,7 +2726,7 @@ march_locate_2D(Face_handle c, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(! is_infinite(c)); + CGAL_assertion(! is_infinite(c)); boost::rand48 rng; @@ -2874,7 +2902,7 @@ march_locate_2D(Face_handle c, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(! is_infinite(c)); + CGAL_assertion(! is_infinite(c)); boost::uniform_smallint<> three(0, 2); boost::variate_generator > die3(rng, three); @@ -2898,7 +2926,7 @@ march_locate_2D(Face_handle c, const Point & p0 = c->vertex( i )->point(); const Point & p1 = c->vertex( ccwi )->point(); Orientation o0, o1, o2; - CGAL_triangulation_assertion(orientation(p0,p1,c->vertex( cwi )->point())==POSITIVE); + CGAL_assertion(orientation(p0,p1,c->vertex( cwi )->point())==POSITIVE); if(c->neighbor(cwi) == prev){ o0 = POSITIVE; } else { @@ -3403,7 +3431,7 @@ typename Triangulation_2::Line_face_circulator Triangulation_2:: line_walk(const Point& p, const Point& q, Face_handle f) const { - CGAL_triangulation_precondition( (dimension() == 2) && ! xy_equal(p,q)); + CGAL_precondition( (dimension() == 2) && ! xy_equal(p,q)); Line_face_circulator lfc = (f == Face_handle()) ? Line_face_circulator(p, q, this) : Line_face_circulator(p, q, f, this); @@ -3442,7 +3470,7 @@ bounded_side(const Point &p0, const Point &p1, const Point &p2, const Point &p) const { // return position of point p with respect to triangle p0p1p2 - CGAL_triangulation_precondition( orientation(p0, p1, p2) != COLLINEAR); + CGAL_precondition( orientation(p0, p1, p2) != COLLINEAR); Orientation o1 = orientation(p0, p1, p), o2 = orientation(p1, p2, p), o3 = orientation(p2, p0, p); @@ -3474,7 +3502,7 @@ Oriented_side Triangulation_2:: oriented_side(Face_handle f, const Point &p) const { - CGAL_triangulation_precondition ( dimension()==2); + CGAL_precondition ( dimension()==2); return oriented_side(f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point(), @@ -3487,7 +3515,7 @@ Triangulation_2:: side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, const Point &p, bool perturb) const { - //CGAL_triangulation_precondition( orientation(p0, p1, p2) == POSITIVE ); + //CGAL_precondition( orientation(p0, p1, p2) == POSITIVE ); // no reason for such precondition and it invalidates fast removal in Delaunay typename Gt::Side_of_oriented_circle_2 pred = geom_traits().side_of_oriented_circle_2_object(); @@ -3518,7 +3546,7 @@ side_of_oriented_circle(const Point &p0, const Point &p1, const Point &p2, if (points[i] == &p0 && (o = orientation(p,p1,p2)) != COLLINEAR ) return Oriented_side(o); } - // CGAL_triangulation_assertion(false); + // CGAL_assertion(false); //no reason for such precondition and it invalidates fast removal in Delaunay return ON_NEGATIVE_SIDE; } @@ -3638,7 +3666,7 @@ typename Triangulation_2::Point_2 Triangulation_2:: circumcenter(Face_handle f) const { - CGAL_triangulation_precondition (dimension()==2); + CGAL_precondition (dimension()==2); return circumcenter((f->vertex(0))->point(), (f->vertex(1))->point(), (f->vertex(2))->point()); @@ -3785,10 +3813,223 @@ std::istream& operator>>(std::istream& is, Triangulation_2 &tr) { tr.file_input(is); - CGAL_triangulation_assertion(tr.is_valid()); + CGAL_assertion(tr.is_valid()); return is; } +namespace internal { + +// Internal function used by operator==. +template < class GT, class TDS1, class TDS2, typename FMAP, typename VMAP > +bool +test_next(const Triangulation_2& t1, + const Triangulation_2& t2, + typename Triangulation_2::Face_handle f1, + typename Triangulation_2::Face_handle f2, + FMAP& Fmap, + VMAP& Vmap) +{ + // This function tests and registers the 3 neighbors of f1/f2, + // and recursively calls itself over them. + // We don't use the call stack as it may overflow + // Returns false if an inequality has been found. + + // Precondition: f1, f2 have been registered as well as their 3 vertices. + CGAL_precondition(t1.dimension() >= 2); + CGAL_precondition(Fmap[f1] == f2); + CGAL_precondition(Vmap.find(f1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(f1->vertex(1)) != Vmap.end()); + CGAL_precondition(t1.dimension() == 1 || Vmap.find(f1->vertex(2)) != Vmap.end()); + + typedef Triangulation_2 Tr1; + typedef Triangulation_2 Tr2; + typedef typename Tr1::Vertex_handle Vertex_handle1; + typedef typename Tr1::Face_handle Face_handle1; + typedef typename Tr2::Vertex_handle Vertex_handle2; + typedef typename Tr2::Face_handle Face_handle2; + + typedef typename VMAP::const_iterator Vit; + typedef typename FMAP::const_iterator Fit; + + typedef typename Tr1::Geom_traits::Construct_point_2 Construct_point_2; + typedef typename Tr1::Geom_traits::Compare_xy_2 Compare_xy_2; + + Compare_xy_2 cmp1 = t1.geom_traits().compare_xy_2_object(); + Construct_point_2 cp = t1.geom_traits().construct_point_2_object(); + + std::vector > face_stack; + face_stack.emplace_back(f1, f2); + + while(! face_stack.empty()) + { + Face_handle1 f1 = face_stack.back().first; + Face_handle2 f2 = face_stack.back().second; + face_stack.pop_back(); + + for(int i=0; i <= t1.dimension(); ++i) + { + Face_handle1 n1 = f1->neighbor(i); + Fit fit = Fmap.find(n1); + Vertex_handle1 v1 = f1->vertex(i); + Vertex_handle2 v2 = Vmap[v1]; + Face_handle2 n2 = f2->neighbor(f2->index(v2)); + if(fit != Fmap.end()) + { + // n1 was already registered. + if(fit->second != n2) + return false; + + continue; + } + + // n1 has not yet been registered. + // We check that the new vertices match geometrically. + // And we register them. + Vertex_handle1 vn1 = n1->vertex(n1->index(f1)); + Vertex_handle2 vn2 = n2->vertex(n2->index(f2)); + Vit vit = Vmap.find(vn1); + if(vit != Vmap.end()) + { + // vn1 already registered + if(vit->second != vn2) + return false; + } + else + { + if(t2.is_infinite(vn2)) + return false; // vn1 can't be infinite, + + // since it would have been registered. + if(cmp1(cp(vn1->point()), cp(vn2->point())) != 0) + return false; + + // We register vn1/vn2. + Vmap.emplace(vn1, vn2); + } + + // We register n1/n2. + Fmap.emplace(n1, n2); + face_stack.emplace_back(n1, n2); + } + } + + return true; +} + +} // namespace internal + +template < class GT, class TDS1, class TDS2 > +bool +operator==(const Triangulation_2& t1, + const Triangulation_2& t2) +{ + typedef typename Triangulation_2::Vertex_handle Vertex_handle1; + typedef typename Triangulation_2::Face_handle Face_handle1; + typedef typename Triangulation_2::Vertex_handle Vertex_handle2; + typedef typename Triangulation_2::Face_handle Face_handle2; + + typedef typename Triangulation_2::Point Point; + + typedef typename Triangulation_2::Geom_traits::Equal_2 Equal_2; + typedef typename Triangulation_2::Geom_traits::Compare_xy_2 Compare_xy_2; + typedef typename Triangulation_2::Geom_traits::Construct_point_2 Construct_point_2; + + Equal_2 equal = t1.geom_traits().equal_2_object(); + Compare_xy_2 cmp1 = t1.geom_traits().compare_xy_2_object(); + Compare_xy_2 cmp2 = t2.geom_traits().compare_xy_2_object(); + Construct_point_2 cp = t1.geom_traits().construct_point_2_object(); + + // Some quick checks. + if(t1.dimension() != t2.dimension() || + t1.number_of_vertices() != t2.number_of_vertices() || + t1.number_of_faces() != t2.number_of_faces()) + return false; + + int dim = t1.dimension(); + // Special case for dimension < 1. + // The triangulation is uniquely defined in these cases. + if(dim == -1) + return true; + + // Special case for dimensions 0 and 1. + if(dim < 2) + { + // It's enough to test that the points are the same, + // since the triangulation is uniquely defined in this case. + std::vector V1 (t1.points_begin(), t1.points_end()); + std::vector V2 (t2.points_begin(), t2.points_end()); + + std::sort(V1.begin(), V1.end(), + [&cmp1, &cp](const Point& p1, const Point& p2){ return cmp1(cp(p1), cp(p2))==SMALLER; }); + + std::sort(V2.begin(), V2.end(), + [&cmp2, &cp](const Point& p1, const Point& p2){ return cmp2(cp(p1), cp(p2))==SMALLER; }); + + return V1 == V2; + } + + // We will store the mapping between the 2 triangulations vertices and faces in 2 maps. + std::unordered_map Vmap; + std::unordered_map Fmap; + + // Handle the infinite vertex. + Vertex_handle1 v1 = t1.infinite_vertex(); + Vertex_handle2 iv2 = t2.infinite_vertex(); + Vmap.emplace(v1, iv2); + + // We pick one infinite face of t1, and try to match it against the infinite faces of t2. + Face_handle1 f = v1->face(); + Vertex_handle1 v2 = f->vertex((f->index(v1)+1)%(dim+1)); + Vertex_handle1 v3 = f->vertex((f->index(v1)+2)%(dim+1)); + const Point& p2 = v2->point(); + const Point& p3 = v3->point(); + + std::vector ifs; + auto fc = t2.incident_faces(iv2), done(fc); + do { + ifs.push_back(fc); + } while(++fc != done); + + for(typename std::vector::const_iterator fit = ifs.begin(); + fit != ifs.end(); ++fit) + { + int inf = (*fit)->index(iv2); + + if(equal(cp(p2), cp((*fit)->vertex((inf+1)%(dim+1))->point()))) + Vmap.emplace(v2, (*fit)->vertex((inf+1)%(dim+1))); + else if(dim == 2 && equal(cp(p2), cp((*fit)->vertex((inf+2)%(dim+1))->point()))) + Vmap.emplace(v2, (*fit)->vertex((inf+2)%(dim+1))); + else + continue; // None matched v2. + + if(equal(cp(p3), cp((*fit)->vertex((inf+1)%(dim+1))->point()))) + Vmap.emplace(v3, (*fit)->vertex((inf+1)%(dim+1))); + else if(dim == 2 && equal(cp(p3), cp((*fit)->vertex((inf+2)%(dim+1))->point()))) + Vmap.emplace(v3, (*fit)->vertex((inf+2)%(dim+1))); + else + continue; // None matched v3. + + // Found it ! + Fmap.emplace(f, *fit); + break; + } + + if(Fmap.size() == 0) + return false; + + // We now have one face, we need to propagate recursively. + return internal::test_next(t1, t2, Fmap.begin()->first, Fmap.begin()->second, Fmap, Vmap); +} + +template < class GT, class Tds1, class Tds2 > +inline +bool +operator!=(const Triangulation_2& t1, + const Triangulation_2& t2) +{ + return ! (t1 == t2); +} + } //namespace CGAL #include diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h index f6bb630f203..fd9ecd9244d 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace CGAL { @@ -345,7 +345,7 @@ Constraint_hierarchy_2:: context(T va, T vb) { H_context_iterator hcit, past; - if(!get_contexts(va,vb, hcit ,past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, hcit ,past)) CGAL_assertion(false); return *hcit; } @@ -355,7 +355,7 @@ Constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) { H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != nullptr); + CGAL_assertion(hcl != nullptr); return hcl->size(); } @@ -365,7 +365,7 @@ Constraint_hierarchy_2:: contexts_begin(T va, T vb) { H_context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return first; } @@ -375,7 +375,7 @@ Constraint_hierarchy_2:: contexts_end(T va, T vb) { H_context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return last; } @@ -385,7 +385,7 @@ Constraint_hierarchy_2:: vertices_in_constraint_begin(T va, T vb) { H_c_iterator cit = c_to_sc_map.find(make_edge(va,vb)); - CGAL_triangulation_assertion( cit != c_to_sc_map.end()); + CGAL_assertion( cit != c_to_sc_map.end()); return cit->second->begin(); } @@ -395,7 +395,7 @@ Constraint_hierarchy_2:: vertices_in_constraint_end(T va, T vb) { H_c_iterator cit = c_to_sc_map.find(make_edge(va,vb)); - CGAL_triangulation_assertion( cit != c_to_sc_map.end()); + CGAL_assertion( cit != c_to_sc_map.end()); return cit->second->end(); } @@ -444,7 +444,7 @@ Constraint_hierarchy_2:: remove_constraint(T va, T vb){ H_edge he = make_edge(va, vb); typename H_c_to_sc_map::iterator c_to_sc_it = c_to_sc_map.find(he); - CGAL_triangulation_assertion(c_to_sc_it != c_to_sc_map.end()); + CGAL_assertion(c_to_sc_it != c_to_sc_map.end()); H_vertex_list *hvl = c_to_sc_it->second; @@ -454,7 +454,7 @@ remove_constraint(T va, T vb){ ++it){ typename H_sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); H_context_list* hcl = scit->second; // and remove the contraint from the context list of the subcontraint @@ -534,7 +534,7 @@ next_along_sc(T va, T vb, T& w) const // find the next vertex after vb along any enclosing constrained // return false if there is no .... H_context_iterator ctxtit, past; - if(!get_contexts(va, vb, ctxtit, past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); H_vertex_it pos; for( ; ctxtit != past; ctxtit++){ @@ -564,9 +564,9 @@ remove_Steiner(T v, T va, T vb) CGAL_precondition(!is_constrained_vertex(v)); H_context_list* hcl1 = get_contexts(va, v); - CGAL_triangulation_assertion(hcl1 != nullptr); + CGAL_assertion(hcl1 != nullptr); H_context_list* hcl2 = get_contexts(v, vb); - CGAL_triangulation_assertion(hcl2 != nullptr); + CGAL_assertion(hcl2 != nullptr); H_vertex_it pos; for(H_context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ @@ -600,7 +600,7 @@ void Constraint_hierarchy_2:: add_Steiner(T va, T vb, T vc){ H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != nullptr); + CGAL_assertion(hcl != nullptr); H_context_list* hcl2 = new H_context_list; @@ -701,7 +701,7 @@ Constraint_hierarchy_2:: oriented_end(T va, T vb, T& vc) const { H_context_iterator ctxt, past; - if(!get_contexts(va,vb, ctxt, past) ) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); if(*(ctxt->pos) == va) vc = ctxt->enclosing->back(); else diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index 130b2a181de..a6c2bf44571 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #ifdef CGAL_CDT_2_DEBUG_INTERSECTIONS # include @@ -423,7 +423,7 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const va = *pos; pos = hcit->pos; ++pos; - CGAL_triangulation_assertion(vbb == *pos); + CGAL_assertion(vbb == *pos); while(!pos.input()){ ++pos; } @@ -451,7 +451,7 @@ Polyline_constraint_hierarchy_2:: context(T va, T vb) { Context_iterator hcit, past; - if(!get_contexts(va,vb, hcit ,past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, hcit ,past)) CGAL_assertion(false); return *hcit; } @@ -461,8 +461,8 @@ Polyline_constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) const { Context_list* hcl = nullptr; - CGAL_triangulation_assertion_code( bool found = ) get_contexts(va,vb,hcl); - CGAL_triangulation_assertion(found); + CGAL_assertion_code( bool found = ) get_contexts(va,vb,hcl); + CGAL_assertion(found); return hcl->size(); } @@ -472,7 +472,7 @@ Polyline_constraint_hierarchy_2:: contexts_begin(T va, T vb) const { Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return first; } @@ -482,7 +482,7 @@ Polyline_constraint_hierarchy_2:: contexts_end(T va, T vb) const { Context_iterator first, last; - if( !get_contexts(va,vb,first,last)) CGAL_triangulation_assertion(false); + if( !get_contexts(va,vb,first,last)) CGAL_assertion(false); return last; } @@ -495,7 +495,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -511,7 +511,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -527,7 +527,7 @@ swap(Constraint_id first, Constraint_id second){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -553,7 +553,7 @@ remove_constraint(Constraint_id cid){ ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and remove the context of the constraint @@ -680,7 +680,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -705,7 +705,7 @@ Polyline_constraint_hierarchy_2::concatenate(Constraint_id firs ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and update pos in the context of the constraint @@ -733,7 +733,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -757,7 +757,7 @@ Polyline_constraint_hierarchy_2::concatenate2(Constraint_id fir ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and update pos in the context of the constraint @@ -798,7 +798,7 @@ Polyline_constraint_hierarchy_2::split(Constraint_id first, Ver ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -832,7 +832,7 @@ Polyline_constraint_hierarchy_2::split2(Constraint_id first, Ve ++succ != end; ++it){ typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); - CGAL_triangulation_assertion(scit != sc_to_c_map.end()); + CGAL_assertion(scit != sc_to_c_map.end()); Context_list* hcl = scit->second; // and replace the context of the constraint @@ -985,7 +985,7 @@ next_along_sc(T va, T vb, T& w) const // find the next vertex after vb along any enclosing constrained // return false if there is no .... Context_iterator ctxtit, past; - if(!get_contexts(va, vb, ctxtit, past)) CGAL_triangulation_assertion(false); + if(!get_contexts(va, vb, ctxtit, past)) CGAL_assertion(false); Vertex_it pos; for( ; ctxtit != past; ctxtit++){ @@ -1016,8 +1016,8 @@ remove_Steiner(T v, T va, T vb) Context_list* hcl1; Context_list* hcl2; - if(!get_contexts(va,v,hcl1)) CGAL_triangulation_assertion(false); - if(!get_contexts(v,vb,hcl2)) CGAL_triangulation_assertion(false); + if(!get_contexts(va,v,hcl1)) CGAL_assertion(false); + if(!get_contexts(v,vb,hcl2)) CGAL_assertion(false); Vertex_it pos; for(Context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ @@ -1169,7 +1169,7 @@ Polyline_constraint_hierarchy_2:: oriented_end(T va, T vb, T& vc) const { Context_iterator ctxt, past; - if(!get_contexts(va,vb, ctxt, past) ) CGAL_triangulation_assertion(false); + if(!get_contexts(va,vb, ctxt, past) ) CGAL_assertion(false); if(*(ctxt->pos) == va) vc = ctxt->enclosing->back(); else diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h index 0f7800637a2..5cd70bb2a6b 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include namespace CGAL { @@ -92,7 +92,7 @@ public: bool operator==(const Face_handle& fh) const { return fh == pos; } bool operator!=(const Face_handle& fh) const { return fh != pos; } - bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator==(std::nullptr_t CGAL_assertion_code(n)) const; bool operator!=(std::nullptr_t n) const; bool is_empty() const; bool collinear_outside() const; @@ -139,7 +139,7 @@ Triangulation_line_face_circulator_2(const Face_handle& face, : pos(face), _tr(t), s(state), i(index), p(pp), q(qq) { - CGAL_triangulation_precondition(! t->xy_equal(p, q)); + CGAL_precondition(! t->xy_equal(p, q)); } @@ -153,7 +153,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, // dir // or null iterator { - CGAL_triangulation_precondition((!_tr->is_infinite(v)) && + CGAL_precondition((!_tr->is_infinite(v)) && (_tr->dimension() == 2) && (! _tr->xy_equal(v->point(),dir))); p=v->point(); @@ -188,7 +188,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, // reset vt and conclude. vt is still finite and [pqt] still LEFT_TURN ic = fc->index(v); vt= fc->vertex(cw(ic)); - CGAL_triangulation_assertion (_tr->orientation(p,q, vt->point())== + CGAL_assertion (_tr->orientation(p,q, vt->point())== LEFT_TURN ); if (_tr->is_infinite(vr)) { --fc; @@ -318,7 +318,7 @@ Triangulation_line_face_circulator_2(const Point& pp, // incident to p // if ff is infinite, the walk begin at the first finite face traversed { - CGAL_triangulation_precondition(_tr->is_infinite(ff) || + CGAL_precondition(_tr->is_infinite(ff) || _tr->oriented_side(ff,p) != ON_NEGATIVE_SIDE); int j; if(_tr->is_infinite(pos)){ @@ -416,7 +416,7 @@ void Triangulation_line_face_circulator_2:: increment() { - CGAL_triangulation_precondition(pos != Face_handle()); + CGAL_precondition(pos != Face_handle()); if(s == vertex_vertex || s == edge_vertex) { Orientation o; do{ @@ -469,7 +469,7 @@ void Triangulation_line_face_circulator_2:: decrement() { - CGAL_triangulation_precondition(pos != Face_handle()); + CGAL_precondition(pos != Face_handle()); if(s == vertex_vertex || s == vertex_edge) { if(s == vertex_vertex){ i = cw(i); @@ -538,7 +538,7 @@ locate(const Point& t, Locate_type <, int &li) case vertex_vertex: { if(_tr->is_infinite(pos->vertex(i))){ - CGAL_triangulation_assertion( + CGAL_assertion( _tr->orientation( pos->vertex(cw(i))->point(), pos->vertex(ccw(i))->point(), t) != LEFT_TURN); @@ -589,7 +589,7 @@ Triangulation_line_face_circulator_2& Triangulation_line_face_circulator_2:: operator++() { - CGAL_triangulation_precondition( pos != Face_handle()) ; + CGAL_precondition( pos != Face_handle()) ; increment(); return *this; } @@ -600,7 +600,7 @@ Triangulation_line_face_circulator_2& Triangulation_line_face_circulator_2:: operator--() { - CGAL_triangulation_precondition(pos != Face_handle()) ; + CGAL_precondition(pos != Face_handle()) ; decrement(); return *this; } @@ -632,7 +632,7 @@ inline bool Triangulation_line_face_circulator_2:: operator==(const Line_face_circulator& lfc) const { - CGAL_triangulation_precondition( pos != Face_handle() && + CGAL_precondition( pos != Face_handle() && lfc.pos != Face_handle()); return ( _tr == lfc._tr && ( _tr==nullptr || (pos == lfc.pos && s== lfc.s && p==lfc.p && q==lfc.q) ) ); @@ -657,9 +657,9 @@ is_empty() const template < class Triangulation > inline bool Triangulation_line_face_circulator_2:: -operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return pos == Face_handle(); } @@ -668,7 +668,7 @@ inline bool Triangulation_line_face_circulator_2:: operator!=(std::nullptr_t n) const { - CGAL_triangulation_assertion( n == nullptr); + CGAL_assertion( n == nullptr); return !(*this == n); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h b/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h index ac015011f68..4ed05abecc1 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_traits_3.h @@ -22,7 +22,7 @@ #include #include -#include +#include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_face_base_2.h b/Triangulation_2/include/CGAL/Triangulation_face_base_2.h index 7335b7c2c74..ea91ec002cf 100644 --- a/Triangulation_2/include/CGAL/Triangulation_face_base_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_face_base_2.h @@ -17,7 +17,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h index dd96f0f5e35..48333eab34a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -252,7 +252,7 @@ private: Vertex_handle nearest_vertex_dispatch(const Point&, Face_handle, Tag_true) const { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Vertex_handle(); } @@ -267,7 +267,7 @@ private: // helping function to copy_triangulation // the version to be used with Tag_true is templated to avoid - // systematique instanciation + // systematic instantiation template void add_hidden_vertices_into_map(Tag, std::map& V) @@ -582,7 +582,7 @@ template typename Triangulation_hierarchy_2::Vertex_handle Triangulation_hierarchy_2:: move(Vertex_handle v, const Point &p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); Vertex_handle w = move_if_no_collision(v,p); if(w != v) { remove(v); diff --git a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h index 7bc3856bc9d..d8aa3ccf92f 100644 --- a/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_constrained_triangulation_2.h @@ -57,7 +57,7 @@ public: protected: void compute_face(Facet_const_handle fh) { - CGAL::IO::Color c = get(ipm, fh)? CGAL::yellow() : CGAL::white(); + CGAL::IO::Color c = get(ipm, fh)? CGAL::IO::yellow() : CGAL::IO::white(); face_begin(c); add_point_in_face(fh->vertex(0)->point()); @@ -69,7 +69,7 @@ protected: void compute_edge(Edge_const_handle eh) { - CGAL::IO::Color c = t2.is_constrained(*eh)? CGAL::green() : CGAL::black(); + CGAL::IO::Color c = t2.is_constrained(*eh)? CGAL::IO::green() : CGAL::IO::black(); add_segment(eh->first->vertex(eh->first->cw(eh->second))->point(), eh->first->vertex(eh->first->ccw(eh->second))->point(), c); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index 15caad00e68..0aee5fb2e42 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -132,12 +132,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1.number_of_vertices() == 0 ); Triangul T3(T1); - assert(T3.tds().vertices().size() == T1.tds().vertices().size()); - assert(T3.tds().faces().size() == T1.tds().faces().size()); + assert(T3 == T1); Triangul T4 = T1; - assert(T4.tds().vertices().size() == T1.tds().vertices().size()); - assert(T4.tds().faces().size() == T1.tds().faces().size()); + assert(T4 == T1); T3.swap(T1); @@ -159,6 +157,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T0_0.number_of_vertices() == 0 ); assert( T0_0.number_of_faces() == 0); assert( T0_0.is_valid() ); + assert( T0_0 == T0_0 ); Triangul T0_1; Vertex_handle v0_1_0 = T0_1.insert(p0); assert( v0_1_0 != nullptr ); @@ -166,10 +165,18 @@ _test_cls_triangulation_2( const Triangul & ) assert( T0_1.number_of_vertices() == 1 ); assert( T0_1.number_of_faces() == 0); assert( T0_1.is_valid() ); + assert( T0_0 != T0_1 ); Triangul T0_1b(T0_1); - assert(T0_1b.tds().vertices().size() == T0_1.tds().vertices().size()); - assert(T0_1b.tds().faces().size() == T0_1.tds().faces().size()); + assert(T0_1b == T0_1); + + Triangul T0_1c; + v0_1_0 = T0_1c.insert(p1); assert( v0_1_0 != nullptr ); + assert( T0_1c.dimension() == 0 ); + assert( T0_1c.number_of_vertices() == 1 ); + assert( T0_1c.number_of_faces() == 0); + assert( T0_1c.is_valid() ); + assert( T0_1 != T0_1c ); // test insert_first() Triangul T0_2; @@ -192,10 +199,10 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_2.number_of_vertices() == 2 ); assert( T1_2.number_of_faces() == 0 ); assert( T1_2.is_valid() ); + assert( T1_2 != T0_1 ); Triangul T1_2b(T1_2); - assert(T1_2b.tds().vertices().size() == T1_2.tds().vertices().size()); - assert(T1_2b.tds().faces().size() == T1_2.tds().faces().size()); + assert(T1_2b == T1_2); // p1,p3,p2 [endpoints first] Triangul T1_3_0; @@ -206,6 +213,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_3_0.number_of_vertices() == 3 ); assert( T1_3_0.number_of_faces() == 0 ); assert( T1_3_0.is_valid() ); + assert( T1_3_0 != T1_2 ); // p1,p2,p3 [middle point first] Triangul T1_3_1; @@ -216,6 +224,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_3_1.number_of_vertices() == 3 ); assert( T1_3_1.number_of_faces() == 0 ); assert( T1_3_1.is_valid() ); + assert( T1_3_1 == T1_3_0 ); Triangul T1_5; Vertex_handle v1_5_1 = T1_5.insert(p1); @@ -227,6 +236,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_5.number_of_vertices() == 5 ); assert( T1_5.number_of_faces() == 0 ); assert( T1_5.is_valid() ); + assert( T1_5 != T1_3_1 ); // test insert_second() Triangul T1_6 = T0_2; @@ -298,11 +308,13 @@ _test_cls_triangulation_2( const Triangul & ) // test generic iterator insert #ifndef CGAL_CFG_NO_MEMBER_TEMPLATES - Triangul T2_4; T2_4.insert( Point_iterator(T2_1.finite_vertices_begin()), - Point_iterator(T2_1.finite_vertices_end()) ); + Triangul T2_4; + T2_4.insert( Point_iterator(T2_1.finite_vertices_begin()), + Point_iterator(T2_1.finite_vertices_end()) ); assert( T2_4.dimension() == 2 ); assert( T2_4.number_of_vertices() == 11 ); assert( T2_4.is_valid() ); + assert( T2_4 == T2_1 ); #endif // test list iterator insert @@ -320,6 +332,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T2_6.dimension() == 2 ); assert( T2_6.number_of_vertices() == 10 ); assert( T2_6.is_valid() ); + assert( T2_5 == T2_6 ); // test grid insert Triangul T2_7; @@ -496,21 +509,25 @@ _test_cls_triangulation_2( const Triangul & ) assert( T1_5_2.dimension() == 1 ); assert( T1_5_2.number_of_vertices() == 5 ); assert( T1_5_2.is_valid() ); + assert( T1_5_2 == T1_5 ); // test copy_constructor with non-empty 2-triangulation Triangul T2_8_1(T2_8); assert( T2_8_1.is_valid()); + assert( T2_8 == T2_8); + Triangul T2_1_1( T2_1 ); assert( T2_1_1.dimension() == 2 ); assert( T2_1_1.number_of_vertices() == 11 ); assert( T2_1_1.is_valid() ); + assert( T2_1_1 == T2_1 ); // test assignment operator Triangul T2_1_4 = T2_1; assert( T2_1_4.dimension() == 2 ); assert( T2_1_4.number_of_vertices() == 11 ); assert( T2_1_4.is_valid() ); - + assert( T2_1_4 == T2_1 ); /*********************************************/ /****** FINITE/INFINITE VERTICES/FACES *******/ diff --git a/Triangulation_3/demo/Triangulation_3/documentation/about.html b/Triangulation_3/demo/Triangulation_3/documentation/about.html index 1954aa1d7fa..d6077d7b567 100644 --- a/Triangulation_3/demo/Triangulation_3/documentation/about.html +++ b/Triangulation_3/demo/Triangulation_3/documentation/about.html @@ -2,7 +2,7 @@

    CGAL Triangulation_3 Demo

    Copyright ©2010-2011
    - INRIA Sophia Antipolis - Mediterranee

    + INRIA Sophia Antipolis - Mediterranee

    This application illustrates an interactive demo for 3D Delaunay Triangulation package of CGAL.

    See also the package manual:
    diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h index a8880931919..f0c1bf08440 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h @@ -195,7 +195,7 @@ Given a pair `(p,i)`, the vertex `v` storing `p` also stores `i`, that is `v.point() == p` and `v.info() == i`. If several pairs have the same point, only one vertex is created, one of the objects of type `Vertex::Info` will be stored in the vertex. \pre `Vertex` must be model of the concept `TriangulationVertexBaseWithInfo_3`. -\tparam (WeightedPointWithInfoInputIterator must be an input iterator with value type `std::pair`. +\tparam WeightedPointWithInfoInputIterator must be an input iterator with value type `std::pair`. */ template < class WeightedPointWithInfoInputIterator > std::ptrdiff_t diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 094950e1fe9..0099a304430 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -548,7 +548,7 @@ public: OutputIteratorInternalFacets ifit, bool *could_lock_zone = nullptr) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); std::vector cells; cells.reserve(32); @@ -621,7 +621,7 @@ public: vertices_on_conflict_zone_boundary(const Point&p, Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole. std::vector facets; @@ -667,7 +667,7 @@ public: template < typename InputIterator > size_type remove(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); size_type n = number_of_vertices(); #ifdef CGAL_TRIANGULATION_3_PROFILING @@ -794,7 +794,7 @@ protected: nearest_vertex(const Point& p, Vertex_handle v, Vertex_handle w) const { // In case of equality, v is returned. - CGAL_triangulation_precondition(v != w); + CGAL_precondition(v != w); if(is_infinite(v)) return w; @@ -1301,7 +1301,7 @@ remove(Vertex_handle v) Vertex_remover remover(tmp); Tr_Base::remove(v, remover); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -1313,7 +1313,7 @@ remove(Vertex_handle v, bool *could_lock_zone) Vertex_remover remover(tmp); bool ret = Tr_Base::remove(v, remover, could_lock_zone); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return ret; } @@ -1327,7 +1327,7 @@ move_if_no_collision(Vertex_handle v, const Point& p) Vertex_inserter inserter(*this); Vertex_handle res = Tr_Base::move_if_no_collision(v,p,remover,inserter); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -1336,7 +1336,7 @@ typename Delaunay_triangulation_3::Vertex_handle Delaunay_triangulation_3:: move(Vertex_handle v, const Point& p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -1356,7 +1356,7 @@ remove_and_give_new_cells(Vertex_handle v, OutputItCells fit) Vertex_remover remover(tmp); Tr_Base::remove_and_give_new_cells(v,remover,fit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -1373,7 +1373,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, Tr_Base::move_if_no_collision_and_give_new_cells(v,p, remover,inserter,fit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -1383,7 +1383,7 @@ Delaunay_triangulation_3:: side_of_oriented_sphere(const Point& p0, const Point& p1, const Point& p2, const Point& p3, const Point& p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2, p3) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2, p3) == POSITIVE); Oriented_side os = geom_traits().side_of_oriented_sphere_3_object()(p0, p1, p2, p3, p); @@ -1416,7 +1416,7 @@ side_of_oriented_sphere(const Point& p0, const Point& p1, const Point& p2, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -1427,8 +1427,8 @@ coplanar_side_of_bounded_circle(const Point& p0, const Point& p1, const Point& p2, const Point& p, bool perturb) const { // In dim==2, we should even be able to assert orient == POSITIVE. - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) - != COLLINEAR); + CGAL_precondition(coplanar_orientation(p0, p1, p2) + != COLLINEAR); Bounded_side bs = geom_traits().coplanar_side_of_bounded_circle_3_object()(p0, p1, p2, p); @@ -1478,7 +1478,7 @@ side_of_sphere(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, const Point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); if(is_infinite(v0)) { @@ -1538,12 +1538,12 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const // ON_BOUNDED_SIDE for a point in the open half-plane // ON_UNBOUNDED_SIDE elsewhere - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); int i3 = 5; if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); // the triangulation is supposed to be valid, ie the facet // with vertices 0 1 2 in this order is positively oriented if(! c->has_vertex(infinite_vertex(), i3)) @@ -1556,8 +1556,8 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const // is positively oriented Vertex_handle v1 = c->vertex(ccw(i3)), v2 = c->vertex(cw(i3)); - CGAL_triangulation_assertion(coplanar_orientation(v1->point(), v2->point(), - mirror_vertex(c, i3)->point()) == NEGATIVE); + CGAL_assertion(coplanar_orientation(v1->point(), v2->point(), + mirror_vertex(c, i3)->point()) == NEGATIVE); Orientation o = coplanar_orientation(v1->point(), v2->point(), p); if(o != COLLINEAR) return Bounded_side(o); @@ -1570,7 +1570,7 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const } // else dimension == 3 - CGAL_triangulation_precondition(i >= 0 && i < 4); + CGAL_precondition(i >= 0 && i < 4); if((! c->has_vertex(infinite_vertex(),i3)) || (i3 != i)) { // finite facet @@ -1579,10 +1579,10 @@ side_of_circle(Cell_handle c, int i, const Point& p, bool perturb) const int i0 = (i>0) ? 0 : 1; int i1 = (i>1) ? 1 : 2; int i2 = (i>2) ? 2 : 3; - CGAL_triangulation_precondition(coplanar(c->vertex(i0)->point(), - c->vertex(i1)->point(), - c->vertex(i2)->point(), - p)); + CGAL_precondition(coplanar(c->vertex(i0)->point(), + c->vertex(i1)->point(), + c->vertex(i2)->point(), + p)); return coplanar_side_of_bounded_circle(c->vertex(i0)->point(), c->vertex(i1)->point(), c->vertex(i2)->point(), @@ -1615,7 +1615,7 @@ Delaunay_triangulation_3:: nearest_vertex_in_cell(const Point& p, Cell_handle c) const { // Returns the finite vertex of the cell c which is the closest to p. - CGAL_triangulation_precondition(dimension() >= 0); + CGAL_precondition(dimension() >= 0); Vertex_handle nearest = nearest_vertex(p, c->vertex(0), c->vertex(1)); if(dimension() >= 2) @@ -1690,9 +1690,9 @@ bool Delaunay_triangulation_3:: is_delaunay_after_displacement(Vertex_handle v, const Point& p) const { - CGAL_triangulation_precondition(!this->is_infinite(v)); - CGAL_triangulation_precondition(this->dimension() == 2); - CGAL_triangulation_precondition(!this->test_dim_down(v)); + CGAL_precondition(!this->is_infinite(v)); + CGAL_precondition(this->dimension() == 2); + CGAL_precondition(!this->test_dim_down(v)); if(v->point() == p) return true; @@ -1766,7 +1766,7 @@ bool Delaunay_triangulation_3:: is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i)); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1803,7 +1803,7 @@ bool Delaunay_triangulation_3:: is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i,j)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i,j)); typename Geom_traits::Side_of_bounded_sphere_3 side_of_bounded_sphere = geom_traits().side_of_bounded_sphere_3_object(); @@ -1830,8 +1830,8 @@ typename Delaunay_triangulation_3::Point Delaunay_triangulation_3:: dual(Cell_handle c) const { - CGAL_triangulation_precondition(dimension()==3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension()==3); + CGAL_precondition(! is_infinite(c)); return c->circumcenter(geom_traits()); } @@ -1840,12 +1840,12 @@ typename Delaunay_triangulation_3::Object Delaunay_triangulation_3:: dual(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_object(construct_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point())); @@ -1890,12 +1890,12 @@ typename Delaunay_triangulation_3::Line Delaunay_triangulation_3:: dual_support(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_equidistant_line(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point()); @@ -1916,7 +1916,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1925,7 +1925,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "no infinite vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1946,7 +1946,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -1972,7 +1972,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2009,7 +2009,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << c->vertex(i)->point() << ", " ; std::cerr << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } switch(dimension()) @@ -2025,7 +2025,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2043,7 +2043,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h index 44c6acdc299..db201ab0372 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_3.h @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h index 7c43de82703..5f4b99aa943 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h @@ -21,7 +21,7 @@ #include -#include +#include #include namespace CGAL { diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 10444aee9fc..482cb41c176 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -195,14 +195,14 @@ public: Regular_triangulation_3(const Regular_triangulation_3& rt) : Tr_Base(rt), hidden_point_visitor(this) { - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } Regular_triangulation_3(Regular_triangulation_3&& rt) noexcept(noexcept(Tr_Base(std::move(rt)))) : Tr_Base(std::move(rt)), hidden_point_visitor(this) { - CGAL_triangulation_postcondition(is_valid()); + CGAL_postcondition(is_valid()); } ~Regular_triangulation_3() = default; @@ -646,7 +646,7 @@ public: const Facet *this_facet_must_be_in_the_cz = nullptr, bool *the_facet_is_in_its_cz = nullptr) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); std::vector cells; cells.reserve(32); @@ -720,7 +720,7 @@ public: OutputIterator vertices_inside_conflict_zone(const Weighted_point&p, Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole, and the cells of the hole std::vector cells; @@ -778,7 +778,7 @@ public: Cell_handle c, OutputIterator res) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); // Get the facets on the boundary of the hole. std::vector facets; @@ -848,7 +848,7 @@ public: template < typename InputIterator > size_type remove(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); size_type n = number_of_vertices(); #ifdef CGAL_TRIANGULATION_3_PROFILING @@ -900,7 +900,7 @@ public: Vertex_remover remover(tmp); Tr_Base::remove_and_give_new_cells(v, remover, cit); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } // Displacement works only for regular triangulation @@ -1057,7 +1057,7 @@ protected: Vertex_handle w) const { // In case of equality, v is returned. - CGAL_triangulation_precondition(v != w); + CGAL_precondition(v != w); if(is_infinite(v)) return w; @@ -1069,21 +1069,21 @@ protected: Oriented_side power_test(const Weighted_point& p, const Weighted_point& q) const { - CGAL_triangulation_precondition(this->equal(p, q)); + CGAL_precondition(this->equal(p, q)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q); } Oriented_side power_test(const Weighted_point& p, const Weighted_point& q, const Weighted_point& r) const { - CGAL_triangulation_precondition(this->collinear(p, q, r)); + CGAL_precondition(this->collinear(p, q, r)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q, r); } Oriented_side power_test(const Weighted_point& p, const Weighted_point& q, const Weighted_point& r, const Weighted_point& s) const { - CGAL_triangulation_precondition(this->coplanar(p, q, r, s)); + CGAL_precondition(this->coplanar(p, q, r, s)); return geom_traits().power_side_of_oriented_power_sphere_3_object()(p, q, r, s); } @@ -1243,7 +1243,7 @@ protected: // Sequential version // "dummy" is here to allow the specialization (see below) - // See http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/285ab1eec49e1cb6 + // See https://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/285ab1eec49e1cb6 template class Hidden_point_visitor { @@ -1669,7 +1669,7 @@ nearest_power_vertex_in_cell(const Bare_point& p, Cell_handle c) const // Returns the finite vertex of the cell c with smaller // power distance to p. { - CGAL_triangulation_precondition(dimension() >= 1); + CGAL_precondition(dimension() >= 1); Vertex_handle nearest = nearest_power_vertex(p, c->vertex(0), c->vertex(1)); if(dimension() >= 2) { @@ -1735,8 +1735,8 @@ typename Regular_triangulation_3::Bare_point Regular_triangulation_3:: dual(Cell_handle c) const { - CGAL_triangulation_precondition(dimension()==3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension()==3); + CGAL_precondition(! is_infinite(c)); return c->weighted_circumcenter(geom_traits()); } @@ -1767,7 +1767,7 @@ Regular_triangulation_3:: dual_ray(Cell_handle c, int i, Ray& ray) const { Cell_handle n = c->neighbor(i); - CGAL_triangulation_precondition((!is_infinite(c) != !is_infinite(n))); // xor + CGAL_precondition((!is_infinite(c) != !is_infinite(n))); // xor // either n or c is infinite int in; if(is_infinite(c)) @@ -1853,7 +1853,7 @@ dual_ray_exact(const Facet& facet, Ray& ray) const Cell_handle c = facet.first; int i = facet.second; Cell_handle n = c->neighbor(i); - CGAL_triangulation_precondition(!is_infinite(c) != !is_infinite(n)); // xor + CGAL_precondition(!is_infinite(c) != !is_infinite(n)); // xor // either n or c is infinite int in; if(is_infinite(c)) @@ -1911,12 +1911,12 @@ typename Regular_triangulation_3::Object Regular_triangulation_3:: dual(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension()>=2); - CGAL_triangulation_precondition(! is_infinite(c,i)); + CGAL_precondition(dimension()>=2); + CGAL_precondition(! is_infinite(c,i)); if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); return construct_object(construct_weighted_circumcenter(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point())); @@ -1975,7 +1975,7 @@ side_of_oriented_power_sphere(const Weighted_point& p0, const Weighted_point& p3, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(orientation(p0, p1, p2, p3) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p2, p3) == POSITIVE); using namespace boost; @@ -2008,7 +2008,7 @@ side_of_oriented_power_sphere(const Weighted_point& p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -2017,7 +2017,7 @@ Bounded_side Regular_triangulation_3:: side_of_power_sphere(Cell_handle c, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); int i3; if(! c->has_vertex(infinite_vertex(), i3)) { @@ -2065,7 +2065,7 @@ side_of_bounded_power_circle(const Weighted_point& p0, const Weighted_point& p2, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) != 0); + CGAL_precondition(coplanar_orientation(p0, p1, p2) != 0); if(coplanar_orientation(p0, p1, p2) == POSITIVE) return Bounded_side (side_of_oriented_power_circle(p0, p1, p2, p, perturb)); @@ -2084,7 +2084,7 @@ side_of_oriented_power_circle(const Weighted_point& p0, const Weighted_point& p2, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(coplanar_orientation(p0, p1, p2) == POSITIVE); + CGAL_precondition(coplanar_orientation(p0, p1, p2) == POSITIVE); using namespace boost; @@ -2116,7 +2116,7 @@ side_of_oriented_power_circle(const Weighted_point& p0, return o; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_NEGATIVE_SIDE; } @@ -2126,11 +2126,11 @@ Regular_triangulation_3:: side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() >= 2); + CGAL_precondition(dimension() >= 2); int i3 = 5; if(dimension() == 2) { - CGAL_triangulation_precondition(i == 3); + CGAL_precondition(i == 3); // the triangulation is supposed to be valid, ie the facet // with vertices 0 1 2 in this order is positively oriented if(! c->has_vertex(infinite_vertex(), i3)) @@ -2143,7 +2143,7 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, // is positively oriented Vertex_handle v1 = c->vertex(ccw(i3)), v2 = c->vertex(cw(i3)); - CGAL_triangulation_assertion( + CGAL_assertion( coplanar_orientation(v1->point(), v2->point(), mirror_vertex(c, i3)->point()) == NEGATIVE); Orientation o = coplanar_orientation(v1->point(), v2->point(), p); @@ -2157,7 +2157,7 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, } // dim 2 // else dimension == 3 - CGAL_triangulation_precondition((i >= 0) && (i < 4)); + CGAL_precondition((i >= 0) && (i < 4)); if((! c->has_vertex(infinite_vertex(),i3)) || (i3 != i)) { // finite facet @@ -2166,9 +2166,9 @@ side_of_power_circle(Cell_handle c, int i, const Weighted_point& p, int i0 = (i>0) ? 0 : 1; int i1 = (i>1) ? 1 : 2; int i2 = (i>2) ? 2 : 3; - CGAL_triangulation_precondition(this->coplanar(c->vertex(i0)->point(), - c->vertex(i1)->point(), - c->vertex(i2)->point(), p)); + CGAL_precondition(this->coplanar(c->vertex(i0)->point(), + c->vertex(i1)->point(), + c->vertex(i2)->point(), p)); return side_of_bounded_power_circle(c->vertex(i0)->point(), c->vertex(i1)->point(), c->vertex(i2)->point(), @@ -2218,7 +2218,7 @@ side_of_bounded_power_segment(const Weighted_point& p0, ; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_UNBOUNDED_SIDE; } @@ -2227,7 +2227,7 @@ Bounded_side Regular_triangulation_3:: side_of_power_segment(Cell_handle c, const Weighted_point& p, bool perturb) const { - CGAL_triangulation_precondition(dimension() == 1); + CGAL_precondition(dimension() == 1); if(! is_infinite(c,0,1)) return side_of_bounded_power_segment(c->vertex(0)->point(), c->vertex(1)->point(), @@ -2240,7 +2240,7 @@ side_of_power_segment(Cell_handle c, const Weighted_point& p, bool perturb) cons // Either we compare weights, or we use the finite neighboring edge Cell_handle finite_neighbor = c->neighbor(c->index(infinite_vertex())); - CGAL_triangulation_assertion(!is_infinite(finite_neighbor,0,1)); + CGAL_assertion(!is_infinite(finite_neighbor,0,1)); return side_of_bounded_power_segment(finite_neighbor->vertex(0)->point(), finite_neighbor->vertex(1)->point(), p, perturb); @@ -2269,7 +2269,7 @@ bool Regular_triangulation_3:: is_Gabriel(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i)); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_orthogonal_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -2307,7 +2307,7 @@ bool Regular_triangulation_3:: is_Gabriel(Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(dimension() == 3 && !is_infinite(c,i,j)); + CGAL_precondition(dimension() == 3 && !is_infinite(c,i,j)); typename Geom_traits::Power_side_of_bounded_power_sphere_3 side_of_bounded_orthogonal_sphere = geom_traits().power_side_of_bounded_power_sphere_3_object(); @@ -2416,7 +2416,7 @@ Regular_triangulation_3:: insert_in_hole(const Weighted_point& p, CellIt cell_begin, CellIt cell_end, Cell_handle begin, int i) { - CGAL_triangulation_precondition(cell_begin != cell_end); + CGAL_precondition(cell_begin != cell_end); get_hidden_point_visitor().process_cells_in_conflict(cell_begin,cell_end); @@ -2435,7 +2435,7 @@ Regular_triangulation_3:: insert_in_hole(const Weighted_point& p, CellIt cell_begin, CellIt cell_end, Cell_handle begin, int i, Vertex_handle newv) { - CGAL_triangulation_precondition(cell_begin != cell_end); + CGAL_precondition(cell_begin != cell_end); get_hidden_point_visitor().process_cells_in_conflict(cell_begin,cell_end); @@ -2542,7 +2542,7 @@ remove(Vertex_handle v) if(hv != Vertex_handle()) c = hv->cell(); } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } template < class Gt, class Tds, class Lds > @@ -2629,7 +2629,7 @@ remove(Vertex_handle v, bool *could_lock_zone) } } - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); } } @@ -2649,7 +2649,7 @@ move_if_no_collision(Vertex_handle v, const Weighted_point& p) Vertex_inserter inserter(*this); Vertex_handle res = Tr_Base::move_if_no_collision(v,p,remover,inserter); - CGAL_triangulation_expensive_postcondition(is_valid()); + CGAL_expensive_postcondition(is_valid()); return res; } @@ -2658,7 +2658,7 @@ typename Regular_triangulation_3::Vertex_handle Regular_triangulation_3:: move(Vertex_handle v, const Weighted_point& p) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -2678,7 +2678,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid base triangulation" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -2701,7 +2701,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty sphere " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2727,7 +2727,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty circle " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -2755,7 +2755,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "non-empty edge " << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h index b79b2111a05..3a73305b380 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 25d4f462201..336f7f1bd24 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -24,16 +24,8 @@ # include #endif -#include -#include -#include -#include -#include -#include -#include - #include -#include +#include #include #include @@ -77,6 +69,14 @@ # include #endif +#include +#include +#include +#include +#include +#include +#include + #define CGAL_TRIANGULATION_3_USE_THE_4_POINTS_CONSTRUCTOR namespace CGAL { @@ -660,8 +660,8 @@ public: // --------------- s ---------------- t -------------- // BEFORE SOURCE MIDDLE TARGET AFTER - CGAL_triangulation_precondition(!equal(s, t)); - CGAL_triangulation_precondition(collinear(s, p, t)); + CGAL_precondition(!equal(s, t)); + CGAL_precondition(collinear(s, p, t)); Comparison_result ps = compare_xyz(p, s); if(ps == EQUAL) @@ -736,7 +736,7 @@ public: : Base(tr.get_lock_data_structure()), _gt(tr._gt) { infinite = _tds.copy_tds(tr._tds, tr.infinite); - CGAL_triangulation_expensive_postcondition(*this == tr); + CGAL_expensive_postcondition(*this == tr); } Triangulation_3(Triangulation_3&& tr) = default; @@ -758,7 +758,7 @@ public: const GT& gt = GT(), Lock_data_structure *lock_ds = nullptr) : Base(lock_ds), _gt(gt) { - CGAL_triangulation_precondition(orientation(p0, p1, p3, p4) == POSITIVE); + CGAL_precondition(orientation(p0, p1, p3, p4) == POSITIVE); init_tds(p0, p1, p3, p4); } @@ -807,15 +807,15 @@ public: Cell_handle infinite_cell() const { - CGAL_triangulation_assertion(infinite_vertex()->cell()->has_vertex(infinite_vertex())); + CGAL_assertion(infinite_vertex()->cell()->has_vertex(infinite_vertex())); return infinite_vertex()->cell(); } // GEOMETRIC ACCESS FUNCTIONS Tetrahedron tetrahedron(const Cell_handle c) const { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(! is_infinite(c)); + CGAL_precondition(dimension() == 3); + CGAL_precondition(! is_infinite(c)); return construct_tetrahedron(c->vertex(0)->point(), c->vertex(1)->point(), c->vertex(2)->point(), @@ -848,31 +848,31 @@ public: void set_point(Cell_handle c, int i, const Point& p) { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(i >= 0 && i <= dimension()); - CGAL_triangulation_precondition(! is_infinite(c->vertex(i))); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(i >= 0 && i <= dimension()); + CGAL_precondition(! is_infinite(c->vertex(i))); c->vertex(i)->point() = p; } const Point& point(Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(i >= 0 && i <= dimension()); - CGAL_triangulation_precondition(! is_infinite(c->vertex(i))); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(i >= 0 && i <= dimension()); + CGAL_precondition(! is_infinite(c->vertex(i))); return c->vertex(i)->point(); } void set_point(Vertex_handle v, const Point& p) { - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(! is_infinite(v)); v->point() = p; } const Point& point(Vertex_handle v) const { - CGAL_triangulation_precondition(number_of_vertices() > 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(number_of_vertices() > 0); + CGAL_precondition(! is_infinite(v)); return v->point(); } @@ -880,7 +880,7 @@ public: bool is_infinite(const Vertex_handle v) const { return v == infinite_vertex(); } bool is_infinite(const Cell_handle c) const { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); return c->has_vertex(infinite_vertex()); } @@ -1060,7 +1060,7 @@ public: const Facet& f, Locate_type& lt, int& li, int& lj) const { - CGAL_triangulation_precondition(f.second == 3); + CGAL_precondition(f.second == 3); return side_of_facet(p, f.first, lt, li, lj); } Bounded_side side_of_segment(const Point& p, @@ -1073,8 +1073,8 @@ public: const Edge& e, Locate_type& lt, int& li) const { - CGAL_triangulation_precondition(e.second == 0); - CGAL_triangulation_precondition(e.third == 1); + CGAL_precondition(e.second == 0); + CGAL_precondition(e.third == 1); return side_of_edge(p, e.first, lt, li); } @@ -1329,7 +1329,7 @@ protected: const Facet *this_facet_must_be_in_the_cz = nullptr, bool *the_facet_is_in_its_cz = nullptr) const { - CGAL_triangulation_precondition(dimension()>=2); + CGAL_precondition(dimension()>=2); if(the_facet_is_in_its_cz) *the_facet_is_in_its_cz = false; @@ -1344,7 +1344,7 @@ protected: } } - CGAL_triangulation_precondition(tester(d)); + CGAL_precondition(tester(d)); // To store the boundary cells, in case we need to rollback typedef boost::container::small_vector SV; @@ -1443,9 +1443,9 @@ protected: template < class Conflict_test > Vertex_handle insert_conflict(Cell_handle c, const Conflict_test& tester) { - CGAL_triangulation_precondition(dimension() >= 2); - CGAL_triangulation_precondition(c != Cell_handle()); - CGAL_triangulation_precondition(tester(c)); + CGAL_precondition(dimension() >= 2); + CGAL_precondition(c != Cell_handle()); + CGAL_precondition(tester(c)); std::vector cells; cells.reserve(32); @@ -1569,7 +1569,7 @@ protected: // at this time, it should be implemented here. void flip_2D(Cell_handle f, int i) { - CGAL_triangulation_precondition(dimension()==2); + CGAL_precondition(dimension()==2); Cell_handle n = f->neighbor(i); int ni = this->_tds.mirror_index(f,i); // ni = n->index(f); @@ -1737,7 +1737,7 @@ private: { // tests whether removing the cluster of vertices // marked as "to remove", decreases the dimension of the triangulation - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); int k=0; Vertex_handle v[4]; for(Finite_vertices_iterator fit = finite_vertices_begin(); @@ -2348,7 +2348,7 @@ public: convert_cell(c, *C[j]); } - CGAL_triangulation_assertion( is_valid(false) ); + CGAL_assertion( is_valid(false) ); return is; } }; @@ -2413,7 +2413,7 @@ std::istream& operator>> (std::istream& is, Triangulation_3& tr) if(!(is >> *(C[j]))) return is; - CGAL_triangulation_assertion(tr.is_valid(false)); + CGAL_assertion(tr.is_valid(false)); return is; } @@ -2460,8 +2460,8 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& for(Vertex_iterator it = tr.vertices_begin(), end = tr.vertices_end(); it != end; ++it) TV[i++] = it; - CGAL_triangulation_assertion(i == n+1); - CGAL_triangulation_assertion(tr.is_infinite(TV[0])); + CGAL_assertion(i == n+1); + CGAL_assertion(tr.is_infinite(TV[0])); Unique_hash_map V; V[tr.infinite_vertex()] = 0; @@ -2578,10 +2578,10 @@ typename Triangulation_3::Triangle Triangulation_3:: triangle(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); - CGAL_triangulation_precondition(! is_infinite(Facet(c, i))); + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_precondition(! is_infinite(Facet(c, i))); if((i&1)==0) return construct_triangle(c->vertex((i+2)&3)->point(), c->vertex((i+1)&3)->point(), @@ -2597,11 +2597,11 @@ typename Triangulation_3::Segment Triangulation_3:: segment(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && - j >= 0 && j <= dimension()); - CGAL_triangulation_precondition(! is_infinite(Edge(c, i, j))); + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && + j >= 0 && j <= dimension()); + CGAL_precondition(! is_infinite(Edge(c, i, j))); return construct_segment(c->vertex(i)->point(), c->vertex(j)->point()); } @@ -2611,9 +2611,9 @@ bool Triangulation_3:: is_infinite(const Cell_handle c, int i) const { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); return is_infinite(c->vertex(i<=0 ? 1 : 0)) || is_infinite(c->vertex(i<=1 ? 2 : 1)) || is_infinite(c->vertex(i<=2 ? 3 : 2)); @@ -2625,9 +2625,9 @@ bool Triangulation_3:: is_infinite(const Cell_handle c, int i, int j) const { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && j >= 0 && j <= dimension()); return is_infinite(c->vertex(i)) || is_infinite(c->vertex(j)); } @@ -2790,7 +2790,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, // from the rest of the triangulation // lt = OUTSIDE_AFFINE_HULL if p is not coplanar with the triangulation - CGAL_triangulation_expensive_assertion(start == Cell_handle() || tds().is_simplex(start)); + CGAL_expensive_assertion(start == Cell_handle() || tds().is_simplex(start)); if(could_lock_zone) *could_lock_zone = true; @@ -2812,8 +2812,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, { case 3: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); // We implement the remembering visibility/stochastic walk. @@ -2931,9 +2931,9 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, (o[1] != COPLANAR) ? 1 : 2; lj = (o[li+1] != COPLANAR) ? li+1 : (o[li+2] != COPLANAR) ? li+2 : li+3; - CGAL_triangulation_assertion(collinear(p, - c->vertex(li)->point(), - c->vertex(lj)->point())); + CGAL_assertion(collinear(p, + c->vertex(li)->point(), + c->vertex(lj)->point())); break; } case 3: @@ -2950,8 +2950,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, case 2: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); Cell_handle c = start; boost::uniform_smallint<> three(0, 2); @@ -2990,7 +2990,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, const Point& p1 = c->vertex(ccw(i))->point(); const Point& p2 = c->vertex(cw(i))->point(); Orientation o[3]; - CGAL_triangulation_assertion(coplanar_orientation(p0,p1,p2) == POSITIVE); + CGAL_assertion(coplanar_orientation(p0,p1,p2) == POSITIVE); o[0] = coplanar_orientation(p0,p1,p); if(o[0] == NEGATIVE) { @@ -3047,8 +3047,8 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, } case 1: { - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); Cell_handle c = start; //first tests whether p is collinear with the current triangulation @@ -3114,7 +3114,7 @@ exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, } default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Cell_handle(); } } @@ -3128,8 +3128,8 @@ Triangulation_3:: inexact_locate(const Point& t, Cell_handle start, int n_of_turns, bool *could_lock_zone) const { - CGAL_triangulation_expensive_assertion(start == Cell_handle() || - tds().is_simplex(start)); + CGAL_expensive_assertion(start == Cell_handle() || + tds().is_simplex(start)); if(could_lock_zone) *could_lock_zone = true; @@ -3155,8 +3155,8 @@ inexact_locate(const Point& t, Cell_handle start, int n_of_turns, if(start->has_vertex(infinite, ind_inf)) start = start->neighbor(ind_inf); - CGAL_triangulation_precondition(start != Cell_handle()); - CGAL_triangulation_precondition(! start->has_vertex(infinite)); + CGAL_precondition(start != Cell_handle()); + CGAL_precondition(! start->has_vertex(infinite)); // We implement the remembering visibility walk. // In this phase, no need to be stochastic @@ -3242,7 +3242,7 @@ side_of_tetrahedron(const Point& p, // - ON_BOUNDARY if p lies on one of the facets // - ON_UNBOUNDED_SIDE if p lies strictly outside the tetrahedron - CGAL_triangulation_precondition(orientation(p0,p1,p2,p3) == POSITIVE); + CGAL_precondition(orientation(p0,p1,p2,p3) == POSITIVE); Orientation o0,o1,o2,o3; if(((o0 = orientation(p,p1,p2,p3)) == NEGATIVE) || @@ -3306,7 +3306,7 @@ side_of_tetrahedron(const Point& p, default: { // impossible : cannot be on 4 facets for a real tetrahedron - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3330,7 +3330,7 @@ side_of_cell(const Point& p, // two cases) // lt only has meaning when ON_BOUNDED_SIDE or ON_BOUNDARY - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); if(! is_infinite(c)) { return side_of_tetrahedron(p, @@ -3401,14 +3401,14 @@ side_of_cell(const Point& p, } default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } // switch side } // case ZERO default: { - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } // switch o @@ -3432,10 +3432,10 @@ side_of_triangle(const Point& p, // - ON_BOUNDARY if p lies on one of the edges // - ON_UNBOUNDED_SIDE if p lies strictly outside the triangle - CGAL_triangulation_precondition(coplanar(p,p0,p1,p2)); + CGAL_precondition(coplanar(p,p0,p1,p2)); Orientation o012 = coplanar_orientation(p0,p1,p2); - CGAL_triangulation_precondition(o012 != COLLINEAR); + CGAL_precondition(o012 != COLLINEAR); Orientation o0; // edge p0 p1 Orientation o1; // edge p1 p2 @@ -3485,7 +3485,7 @@ side_of_triangle(const Point& p, default: { // cannot happen - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return ON_BOUNDARY; } } @@ -3512,15 +3512,15 @@ side_of_facet(const Point& p, // When they mean anything, li and lj refer to indices in the cell c // giving the facet (c,i). - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); if(! is_infinite(c,3)) { // The following precondition is useless because it is written // in side_of_facet - // CGAL_triangulation_precondition(coplanar (p, - // c->vertex(0)->point, - // c->vertex(1)->point, - // c->vertex(2)->point)); + // CGAL_precondition(coplanar (p, + // c->vertex(0)->point, + // c->vertex(1)->point, + // c->vertex(2)->point)); int i_t, j_t; Bounded_side side = side_of_triangle(p, c->vertex(0)->point(), @@ -3544,7 +3544,7 @@ side_of_facet(const Point& p, int inf = c->index(infinite); // The following precondition is useless because it is written // in side_of_facet - // CGAL_triangulation_precondition(coplanar (p, + // CGAL_precondition(coplanar (p, // c->neighbor(inf)->vertex(0)->point(), // c->neighbor(inf)->vertex(1)->point(), // c->neighbor(inf)->vertex(2)->point())); @@ -3553,8 +3553,8 @@ side_of_facet(const Point& p, Vertex_handle v1 = c->vertex(i1), v2 = c->vertex(i2); - CGAL_triangulation_assertion(coplanar_orientation(v1->point(), v2->point(), - mirror_vertex(c, inf)->point()) == POSITIVE); + CGAL_assertion(coplanar_orientation(v1->point(), v2->point(), + mirror_vertex(c, inf)->point()) == POSITIVE); switch(coplanar_orientation(v1->point(), v2->point(), p)) { @@ -3603,8 +3603,8 @@ side_of_segment(const Point& p, // - ON_BOUNDARY if p equals p0 or p1 // - ON_UNBOUNDED_SIDE if p lies strictly outside the edge - CGAL_triangulation_precondition(! equal(p0, p1)); - CGAL_triangulation_precondition(collinear(p, p0, p1)); + CGAL_precondition(! equal(p0, p1)); + CGAL_precondition(collinear(p, p0, p1)); switch(collinear_position(p0, p, p1)) { @@ -3643,7 +3643,7 @@ side_of_edge(const Point& p, // lt only has meaning when ON_BOUNDED_SIDE and ON_BOUNDARY // li refer to indices in the cell c - CGAL_triangulation_precondition(dimension() == 1); + CGAL_precondition(dimension() == 1); if(! is_infinite(c,0,1)) return side_of_segment(p, c->vertex(0)->point(), c->vertex(1)->point(), lt, li); @@ -3669,8 +3669,8 @@ bool Triangulation_3:: flip(Cell_handle c, int i) { - CGAL_triangulation_precondition((dimension() == 3) && (0<=i) && (i<4) && - (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && (0<=i) && (i<4) && + (number_of_vertices() >= 5)); Cell_handle n = c->neighbor(i); int in = n->index(c); @@ -3727,41 +3727,41 @@ void Triangulation_3:: flip_flippable(Cell_handle c, int i) { - CGAL_triangulation_precondition((dimension() == 3) && (0<=i) && (i<4) && - (number_of_vertices() >= 5)); - CGAL_triangulation_precondition_code(Cell_handle n = c->neighbor(i);); - CGAL_triangulation_precondition_code(int in = n->index(c);); - CGAL_triangulation_precondition((! is_infinite(c)) &&(! is_infinite(n))); + CGAL_precondition((dimension() == 3) && (0<=i) && (i<4) && + (number_of_vertices() >= 5)); + CGAL_precondition_code(Cell_handle n = c->neighbor(i);); + CGAL_precondition_code(int in = n->index(c);); + CGAL_precondition((! is_infinite(c)) &&(! is_infinite(n))); if(i%2 == 1) { - CGAL_triangulation_precondition(orientation(c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+3)&3)->point(), - c->vertex((i+1)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+3)&3)->point(), + c->vertex((i+1)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); } else { - CGAL_triangulation_precondition(orientation(c->vertex((i+2)&3)->point(), - c->vertex((i+1)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+3)&3)->point(), - c->vertex((i+2)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex((i+1)&3)->point(), - c->vertex((i+3)&3)->point(), - n->vertex(in)->point(), - c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+2)&3)->point(), + c->vertex((i+1)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+3)&3)->point(), + c->vertex((i+2)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex((i+1)&3)->point(), + c->vertex((i+3)&3)->point(), + n->vertex(in)->point(), + c->vertex(i)->point()) == POSITIVE); } _tds.flip_flippable(c, i); @@ -3774,10 +3774,10 @@ flip(Cell_handle c, int i, int j) { // Flips the edge (i,j) of cell c - CGAL_triangulation_precondition((dimension() == 3) && - (0<=i) && (i<4) && (0<=j) && - (j<4) &&(i != j) && - (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && + (0<=i) && (i<4) && (0<=j) && + (j<4) &&(i != j) && + (number_of_vertices() >= 5)); // Checks that degree 3 and not on the convex hull int degree = 0; @@ -3825,32 +3825,32 @@ flip_flippable(Cell_handle c, int i, int j) #if !defined CGAL_TRIANGULATION_NO_PRECONDITIONS && \ !defined CGAL_NO_PRECONDITIONS && !defined NDEBUG - CGAL_triangulation_precondition((dimension() == 3) && - (0<=i) && (i<4) && (0<=j) && (j<4) && - (i != j) && (number_of_vertices() >= 5)); + CGAL_precondition((dimension() == 3) && + (0<=i) && (i<4) && (0<=j) && (j<4) && + (i != j) && (number_of_vertices() >= 5)); int degree = 0; Cell_circulator ccir = incident_cells(c,i,j); Cell_circulator cdone = ccir; do { - CGAL_triangulation_precondition(! is_infinite(ccir)); + CGAL_precondition(! is_infinite(ccir)); ++degree; ++ccir; } while(ccir != cdone); - CGAL_triangulation_precondition(degree == 3); + CGAL_precondition(degree == 3); Cell_handle n = c->neighbor(next_around_edge(i, j)); int in = n->index(c->vertex(i)); int jn = n->index(c->vertex(j)); - CGAL_triangulation_precondition(orientation(c->vertex(next_around_edge(i,j))->point(), - c->vertex(next_around_edge(j,i))->point(), - n->vertex(next_around_edge(jn,in))->point(), - c->vertex(j)->point()) == POSITIVE); - CGAL_triangulation_precondition(orientation(c->vertex(i)->point(), - c->vertex(next_around_edge(j,i))->point(), - n->vertex(next_around_edge(jn,in))->point(), - c->vertex(next_around_edge(i,j))->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex(next_around_edge(i,j))->point(), + c->vertex(next_around_edge(j,i))->point(), + n->vertex(next_around_edge(jn,in))->point(), + c->vertex(j)->point()) == POSITIVE); + CGAL_precondition(orientation(c->vertex(i)->point(), + c->vertex(next_around_edge(j,i))->point(), + n->vertex(next_around_edge(jn,in))->point(), + c->vertex(next_around_edge(i,j))->point()) == POSITIVE); #endif _tds.flip_flippable(c, i, j); @@ -4088,17 +4088,17 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_cell(const Point& p, Cell_handle c) { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition_code( + CGAL_precondition(dimension() == 3); + CGAL_precondition_code( Locate_type lt; int i; int j; ); - CGAL_triangulation_precondition(side_of_tetrahedron(p, - c->vertex(0)->point(), - c->vertex(1)->point(), - c->vertex(2)->point(), - c->vertex(3)->point(), - lt,i,j) == ON_BOUNDED_SIDE); + CGAL_precondition(side_of_tetrahedron(p, + c->vertex(0)->point(), + c->vertex(1)->point(), + c->vertex(2)->point(), + c->vertex(3)->point(), + lt,i,j) == ON_BOUNDED_SIDE); Vertex_handle v = _tds.insert_in_cell(c); v->set_point(p); @@ -4111,21 +4111,21 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_facet(const Point& p, Cell_handle c, int i) { - CGAL_triangulation_precondition(dimension() == 2 || dimension() == 3); - CGAL_triangulation_precondition((dimension() == 2 && i == 3) || - (dimension() == 3 && i >= 0 && i <= 3)); - CGAL_triangulation_exactness_precondition_code( + CGAL_precondition(dimension() == 2 || dimension() == 3); + CGAL_precondition((dimension() == 2 && i == 3) || + (dimension() == 3 && i >= 0 && i <= 3)); + CGAL_exactness_precondition_code( Locate_type lt; int li; int lj; ); - CGAL_triangulation_exactness_precondition(coplanar(p, c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point()) && - side_of_triangle(p, - c->vertex((i+1)&3)->point(), - c->vertex((i+2)&3)->point(), - c->vertex((i+3)&3)->point(), - lt, li, lj) == ON_BOUNDED_SIDE); + CGAL_exactness_precondition(coplanar(p, c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point()) && + side_of_triangle(p, + c->vertex((i+1)&3)->point(), + c->vertex((i+2)&3)->point(), + c->vertex((i+3)&3)->point(), + lt, li, lj) == ON_BOUNDED_SIDE); Vertex_handle v = _tds.insert_in_facet(c, i); v->set_point(p); @@ -4137,11 +4137,11 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_in_edge(const Point& p, Cell_handle c, int i, int j) { - CGAL_triangulation_precondition(i != j); - CGAL_triangulation_precondition(dimension() >= 1 && dimension() <= 3); - CGAL_triangulation_precondition(i >= 0 && i <= dimension() && - j >= 0 && j <= dimension()); - CGAL_triangulation_exactness_precondition_code( + CGAL_precondition(i != j); + CGAL_precondition(dimension() >= 1 && dimension() <= 3); + CGAL_precondition(i >= 0 && i <= dimension() && + j >= 0 && j <= dimension()); + CGAL_exactness_precondition_code( Locate_type lt; int li; ); @@ -4151,19 +4151,19 @@ insert_in_edge(const Point& p, Cell_handle c, int i, int j) case 3: case 2: { - CGAL_triangulation_precondition(! is_infinite(c, i, j)); - CGAL_triangulation_exactness_precondition(collinear(c->vertex(i)->point(), - p, - c->vertex(j)->point()) - && side_of_segment(p, - c->vertex(i)->point(), - c->vertex(j)->point(), - lt, li) == ON_BOUNDED_SIDE); + CGAL_precondition(! is_infinite(c, i, j)); + CGAL_exactness_precondition(collinear(c->vertex(i)->point(), + p, + c->vertex(j)->point()) + && side_of_segment(p, + c->vertex(i)->point(), + c->vertex(j)->point(), + lt, li) == ON_BOUNDED_SIDE); break; } case 1: { - CGAL_triangulation_exactness_precondition(side_of_edge(p, c, lt, li) == ON_BOUNDED_SIDE); + CGAL_exactness_precondition(side_of_edge(p, c, lt, li) == ON_BOUNDED_SIDE); break; } } @@ -4182,8 +4182,8 @@ insert_outside_convex_hull(const Point& p, Cell_handle c) // p is strictly outside the convex hull // dimension 0 not allowed, use outside-affine-hull - CGAL_triangulation_precondition(dimension() > 0); - CGAL_triangulation_precondition(c->has_vertex(infinite)); + CGAL_precondition(dimension() > 0); + CGAL_precondition(c->has_vertex(infinite)); // the precondition that p is in c is tested in each of the // insertion methods called from this method @@ -4218,7 +4218,7 @@ typename Triangulation_3::Vertex_handle Triangulation_3:: insert_outside_affine_hull(const Point& p) { - CGAL_triangulation_precondition(dimension() < 3); + CGAL_precondition(dimension() < 3); bool reorient; switch(dimension()) { @@ -4228,7 +4228,7 @@ insert_outside_affine_hull(const Point& p) Cell_handle n = c->neighbor(c->index(infinite_vertex())); Orientation o = coplanar_orientation(n->vertex(0)->point(), n->vertex(1)->point(), p); - CGAL_triangulation_precondition(o != COLLINEAR); + CGAL_precondition(o != COLLINEAR); reorient = o == NEGATIVE; break; } @@ -4239,7 +4239,7 @@ insert_outside_affine_hull(const Point& p) Orientation o = orientation(n->vertex(0)->point(), n->vertex(1)->point(), n->vertex(2)->point(), p); - CGAL_triangulation_precondition(o != COPLANAR); + CGAL_precondition(o != COPLANAR); reorient = o == NEGATIVE; break; } @@ -4410,8 +4410,8 @@ test_dim_down(Vertex_handle v) const // Returns true iff v is incident to all finite cells/facets // and all the other vertices are coplanar/collinear in dim3/2. - CGAL_triangulation_precondition(dimension() >= 0); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() >= 0); + CGAL_precondition(! is_infinite(v)); if(dimension() == 3) { @@ -4474,8 +4474,8 @@ test_dim_down_using_incident_cells_3(Vertex_handle v, std::vector& adj_vertices, bool *could_lock_zone) const { - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_precondition(! is_infinite(v)); + CGAL_precondition(dimension() == 3); + CGAL_precondition(! is_infinite(v)); // Collect all vertices on the boundary // and all incident cells @@ -4913,7 +4913,7 @@ make_hole_3D(Vertex_handle v, Vertex_triple_Facet_map& outer_map, std::vector& hole) { - CGAL_triangulation_expensive_precondition(! test_dim_down(v)); + CGAL_expensive_precondition(! test_dim_down(v)); incident_cells(v, std::back_inserter(hole)); @@ -4943,7 +4943,7 @@ make_hole_3D(Vertex_handle v, const std::vector& incident_cells, Vertex_triple_Facet_map& outer_map) { - CGAL_triangulation_expensive_precondition(! test_dim_down(v)); + CGAL_expensive_precondition(! test_dim_down(v)); for(typename std::vector::const_iterator cit = incident_cells.begin(), end = incident_cells.end(); cit != end; ++cit) @@ -4968,7 +4968,7 @@ VertexRemover& Triangulation_3:: remove_dim_down(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition (dimension() >= 0); + CGAL_precondition (dimension() >= 0); // Collect all the hidden points. for(All_cells_iterator ci = tds().raw_cells_begin(), @@ -4998,7 +4998,7 @@ VertexRemover& Triangulation_3:: remove_1D(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition (dimension() == 1); + CGAL_precondition (dimension() == 1); Cell_handle c1 = v->cell(); Cell_handle c2 = c1->neighbor(c1->index(v) == 0 ? 1 : 0); @@ -5016,7 +5016,7 @@ VertexRemover& Triangulation_3:: remove_2D(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list hole; make_hole_2D(v, hole, remover); fill_hole_2D(hole, remover); @@ -5124,7 +5124,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover) vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5179,7 +5179,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover) unsigned int o_i = o_vt_f_pair.second.second; typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5321,7 +5321,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5377,7 +5377,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5431,9 +5431,9 @@ void Triangulation_3:: remove(Vertex_handle v, VertexRemover& remover) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_expensive_precondition(tds().is_vertex(v)); if(test_dim_down (v)) { @@ -5450,7 +5450,7 @@ remove(Vertex_handle v, VertexRemover& remover) case 3: remove_3D (v, remover); break; default: - CGAL_triangulation_assertion (false); + CGAL_assertion (false); } } } @@ -5464,10 +5464,10 @@ remove(Vertex_handle v, VertexRemover& remover, bool *could_lock_zone) // N.B.: dimension doesn't need to be atomic since the parallel removal // will never decrease the dimension (the last few removes are done // sequentially) - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_precondition(dimension() == 3); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_precondition(dimension() == 3); + CGAL_expensive_precondition(tds().is_vertex(v)); #ifdef CGAL_CONCURRENT_TRIANGULATION_3_PROFILING static Profile_branch_counter_3 bcounter( @@ -5551,7 +5551,7 @@ VertexRemover& Triangulation_3:: remove_2D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(dimension() == 2); + CGAL_precondition(dimension() == 2); std::list hole; make_hole_2D(v, hole, remover); fill_hole_2D(hole, remover, fit); @@ -5565,7 +5565,7 @@ VertexRemover& Triangulation_3:: remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(dimension() == 3); + CGAL_precondition(dimension() == 3); std::vector hole; hole.reserve(64); @@ -5624,7 +5624,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -5680,7 +5680,7 @@ remove_3D(Vertex_handle v, VertexRemover& remover, OutputItCells fit) typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -5737,9 +5737,9 @@ Triangulation_3:: remove_and_give_new_cells(Vertex_handle v, VertexRemover& remover, OutputItCells fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); - CGAL_triangulation_expensive_precondition(tds().is_vertex(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); + CGAL_expensive_precondition(tds().is_vertex(v)); if(test_dim_down (v)) { @@ -5756,7 +5756,7 @@ remove_and_give_new_cells(Vertex_handle v, VertexRemover& remover, case 3: remove_3D (v, remover, fit); break; default: - CGAL_triangulation_assertion (false); + CGAL_assertion (false); } } } @@ -5772,7 +5772,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, VertexRemover& remover, VertexInserter& inserter) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; const int dim = dimension(); @@ -5829,7 +5829,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, if(i == 0) f = f->neighbor(1); - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Cell_handle g= f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -5841,7 +5841,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, if(i == 0) f_ins = f_ins->neighbor(1); - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Cell_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -6012,7 +6012,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -6069,7 +6069,7 @@ move_if_no_collision(Vertex_handle v, const Point& p, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6138,7 +6138,7 @@ move(Vertex_handle v, const Point& p, VertexRemover& remover, VertexInserter& inserter) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -6164,7 +6164,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, OutputItCells fit) { CGAL_assertion(remover.hidden_points_begin() == remover.hidden_points_end()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; @@ -6233,7 +6233,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, if(i==0) f = f->neighbor(1); - CGAL_triangulation_assertion(f->index(v) == 1); + CGAL_assertion(f->index(v) == 1); Cell_handle g = f->neighbor(0); f->set_vertex(1, g->vertex(1)); f->set_neighbor(0,g->neighbor(0)); @@ -6246,7 +6246,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, if(i==0) f_ins = f_ins->neighbor(1); - CGAL_triangulation_assertion(f_ins->index(inserted) == 1); + CGAL_assertion(f_ins->index(inserted) == 1); Cell_handle g_ins = f_ins->neighbor(0); f_ins->set_vertex(1, v); g_ins->set_vertex(0, v); @@ -6465,7 +6465,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, vmap[remover.tmp.infinite_vertex()] = infinite_vertex(); } - CGAL_triangulation_assertion(remover.tmp.dimension() == 3); + CGAL_assertion(remover.tmp.dimension() == 3); // Construct the set of vertex triples of remover.tmp // We reorient the vertex triple so that it matches those from outer_map @@ -6521,7 +6521,7 @@ move_if_no_collision_and_give_new_cells(Vertex_handle v, const Point& p, typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6861,7 +6861,7 @@ _remove_cluster_3D(InputIterator first, InputIterator beyond, VertexRemover& rem typename Vertex_triple_Facet_map::iterator iit = inner_map.find(o_vt_f_pair.first); - CGAL_triangulation_assertion(iit != inner_map.end()); + CGAL_assertion(iit != inner_map.end()); typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; Cell_handle i_ch = i_vt_f_pair.second.first; unsigned int i_i = i_vt_f_pair.second.second; @@ -6949,8 +6949,8 @@ typename Triangulation_3::size_type Triangulation_3:: remove(InputIterator first, InputIterator beyond, VertexRemover& remover) { - CGAL_triangulation_precondition(!does_repeat_in_range(first, beyond)); - CGAL_triangulation_precondition(!infinite_vertex_in_range(first, beyond)); + CGAL_precondition(!does_repeat_in_range(first, beyond)); + CGAL_precondition(!infinite_vertex_in_range(first, beyond)); size_type n = number_of_vertices(); InputIterator init = first, init2 = first; @@ -6988,7 +6988,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -6997,7 +6997,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "no infinite vertex" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -7047,7 +7047,7 @@ is_valid(Cell_handle c, bool verbose, int level) const std::cerr << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -7083,7 +7083,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->vertex(2)->point() << ", " << c->vertex(3)->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -7101,7 +7101,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->vertex(1)->point() << ", " << c->vertex(2)->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } break; @@ -7123,7 +7123,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->neighbor(0)->vertex(1-c->neighbor(0)->index(c))->point() << ", " << v->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -7140,7 +7140,7 @@ is_valid_finite(Cell_handle c, bool verbose, int) const << c->neighbor(1)->vertex(1-c->neighbor(1)->index(c))->point() << ", " << v->point() << std::endl; } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } } @@ -7154,16 +7154,14 @@ is_valid_finite(Cell_handle c, bool verbose, int) const namespace internal { // Internal function used by operator==. -template < class GT, class Tds1, class Tds2, class Lds > +template < class GT, class Tds1, class Tds2, class Lds, typename CMAP, typename VMAP > bool test_next(const Triangulation_3& t1, const Triangulation_3& t2, typename Triangulation_3::Cell_handle c1, typename Triangulation_3::Cell_handle c2, - std::map::Cell_handle, - typename Triangulation_3::Cell_handle>& Cmap, - std::map::Vertex_handle, - typename Triangulation_3::Vertex_handle>& Vmap) + CMAP& Cmap, + VMAP& Vmap) { // This function tests and registers the 4 neighbors of c1/c2, // and recursively calls itself over them. @@ -7171,12 +7169,12 @@ test_next(const Triangulation_3& t1, // Returns false if an inequality has been found. // Precondition: c1, c2 have been registered as well as their 4 vertices. - CGAL_triangulation_precondition(t1.dimension() >= 2); - CGAL_triangulation_precondition(Cmap[c1] == c2); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); - CGAL_triangulation_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); - CGAL_triangulation_precondition(t1.dimension() == 2 || + CGAL_precondition(t1.dimension() >= 2); + CGAL_precondition(Cmap[c1] == c2); + CGAL_precondition(Vmap.find(c1->vertex(0)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(1)) != Vmap.end()); + CGAL_precondition(Vmap.find(c1->vertex(2)) != Vmap.end()); + CGAL_precondition(t1.dimension() == 2 || Vmap.find(c1->vertex(3)) != Vmap.end()); typedef Triangulation_3 Tr1; @@ -7186,8 +7184,8 @@ test_next(const Triangulation_3& t1, typedef typename Tr2::Vertex_handle Vertex_handle2; typedef typename Tr2::Cell_handle Cell_handle2; - typedef typename std::map::const_iterator Vit; - typedef typename std::map::const_iterator Cit; + typedef typename std::unordered_map::const_iterator Vit; + typedef typename std::unordered_map::const_iterator Cit; typedef typename Tr1::Geom_traits::Construct_point_3 Construct_point_3; typedef typename Tr1::Geom_traits::Compare_xyz_3 Compare_xyz_3; @@ -7196,7 +7194,7 @@ test_next(const Triangulation_3& t1, Construct_point_3 cp = t1.geom_traits().construct_point_3_object(); std::vector > cell_stack; - cell_stack.push_back(std::make_pair(c1, c2)); + cell_stack.emplace_back(c1, c2); while(! cell_stack.empty()) { @@ -7242,12 +7240,12 @@ test_next(const Triangulation_3& t1, return false; // We register vn1/vn2. - Vmap.insert(std::make_pair(vn1, vn2)); + Vmap.emplace(vn1, vn2); } // We register n1/n2. - Cmap.insert(std::make_pair(n1, n2)); - cell_stack.push_back(std::make_pair(n1, n2)); + Cmap.emplace(n1, n2); + cell_stack.emplace_back(n1, n2); } } @@ -7286,11 +7284,11 @@ operator==(const Triangulation_3& t1, int dim = t1.dimension(); // Special case for dimension < 1. // The triangulation is uniquely defined in these cases. - if(dim < 1) + if(dim == - 1) return true; - // Special case for dimension == 1. - if(dim == 1) + // Special case for dimensions 0 and 1. + if(dim < 2) { // It's enough to test that the points are the same, // since the triangulation is uniquely defined in this case. @@ -7308,13 +7306,13 @@ operator==(const Triangulation_3& t1, // We will store the mapping between the 2 triangulations vertices and // cells in 2 maps. - std::map Vmap; - std::map Cmap; + std::unordered_map Vmap; + std::unordered_map Cmap; // Handle the infinite vertex. Vertex_handle1 v1 = t1.infinite_vertex(); Vertex_handle2 iv2 = t2.infinite_vertex(); - Vmap.insert(std::make_pair(v1, iv2)); + Vmap.emplace(v1, iv2); // We pick one infinite cell of t1, and try to match it against the // infinite cells of t2. @@ -7364,7 +7362,7 @@ operator==(const Triangulation_3& t1, } // Found it ! - Cmap.insert(std::make_pair(c, *cit)); + Cmap.emplace(c, *cit); break; } diff --git a/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h b/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h index 663032162a4..b93c9a3f874 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h +++ b/Triangulation_3/include/CGAL/Triangulation_3/internal/Triangulation_segment_traverser_3_impl.h @@ -20,10 +20,10 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, Vertex_handle s, Vertex_handle t ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(s) ); - CGAL_triangulation_precondition( !_tr->is_infinite(t) ); - CGAL_triangulation_precondition( s->point() != t->point() ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( !_tr->is_infinite(s) ); + CGAL_precondition( !_tr->is_infinite(t) ); + CGAL_precondition( s->point() != t->point() ); + CGAL_precondition( _tr->dimension() >= 2 ); _source = s->point(); _target = t->point(); @@ -45,11 +45,11 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, Vertex_handle s, const Point& t ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(s) ); - CGAL_triangulation_precondition( s->point() != t ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - orientation( *_tr->finite_facets_begin(), t ) == COPLANAR ); + CGAL_precondition( !_tr->is_infinite(s) ); + CGAL_precondition( s->point() != t ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + orientation( *_tr->finite_facets_begin(), t ) == COPLANAR ); _source = s->point(); _target = t; @@ -71,11 +71,11 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, Vertex_handle t, Cell_handle hint ) : _tr(tr) { - CGAL_triangulation_precondition( !_tr->is_infinite(t) ); - CGAL_triangulation_precondition( s != t->point() ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - orientation( *_tr->finite_facets_begin(), s ) == COPLANAR ); + CGAL_precondition( !_tr->is_infinite(t) ); + CGAL_precondition( s != t->point() ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + orientation( *_tr->finite_facets_begin(), s ) == COPLANAR ); _source = s; _target = t->point(); @@ -84,7 +84,7 @@ Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, Vertex_hand cell() = _tr->locate( s, lt(), li(), lj(), hint ); - CGAL_triangulation_postcondition( cell() != Cell_handle() ); + CGAL_postcondition( cell() != Cell_handle() ); jump_to_intersecting_cell(); } @@ -93,10 +93,10 @@ template < class Tr, class Inc > Triangulation_segment_cell_iterator_3:: Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, const Point& t, Cell_handle hint ) : _tr(tr) { - CGAL_triangulation_precondition( s != t ); - CGAL_triangulation_precondition( _tr->dimension() >= 2 ); - CGAL_triangulation_precondition( _tr->dimension() == 3 || - coplanar( *_tr->finite_facets_begin(), _target ) ); + CGAL_precondition( s != t ); + CGAL_precondition( _tr->dimension() >= 2 ); + CGAL_precondition( _tr->dimension() == 3 || + coplanar( *_tr->finite_facets_begin(), _target ) ); _source = s; _target = t; @@ -105,7 +105,7 @@ Triangulation_segment_cell_iterator_3( const Tr* tr, const Point& s, const Point cell() = _tr->locate( s, lt(), li(), lj(), hint ); - CGAL_triangulation_postcondition( cell() != Cell_handle() ); + CGAL_postcondition( cell() != Cell_handle() ); jump_to_intersecting_cell(); } @@ -131,7 +131,7 @@ Triangulation_segment_cell_iterator_3::end() const { template < class Tr, class Inc > inline Triangulation_segment_cell_iterator_3& Triangulation_segment_cell_iterator_3::operator++() { - CGAL_triangulation_precondition( cell() != Cell_handle() ); + CGAL_precondition( cell() != Cell_handle() ); increment(); return *this; } @@ -169,8 +169,8 @@ operator!=( const SCI& sci ) const { template < class Tr, class Inc > inline bool Triangulation_segment_cell_iterator_3:: -operator==( Nullptr_t CGAL_triangulation_assertion_code(n) ) const { - CGAL_triangulation_assertion( n == NULL ); +operator==( Nullptr_t CGAL_assertion_code(n) ) const { + CGAL_assertion( n == NULL ); return cell() == Cell_handle(); } @@ -233,7 +233,7 @@ jump_to_intersecting_cell() template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next() { - CGAL_triangulation_precondition( has_next() ); + CGAL_precondition( has_next() ); // Check if the target is in the current cell. int ti; @@ -463,7 +463,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre // For the remembering stochastic walk, we start trying with a random facet. int li = 0; - CGAL_triangulation_assertion_code( bool incell = true; ) + CGAL_assertion_code( bool incell = true; ) for( int k = 0; k < 4; ++k, ++li ) { // Skip the previous cell. @@ -485,7 +485,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre vert[li] = backup; continue; } - CGAL_triangulation_assertion_code( incell = false; ) + CGAL_assertion_code( incell = false; ) // Check if the target is inside the 3-wedge with // the source as apex and the facet as an intersection. @@ -547,15 +547,15 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre if(regular_case) { - CGAL_triangulation_assertion( std::get<0>(cur_after_walk)==nnext ); - CGAL_triangulation_assertion( li==outside ); - CGAL_triangulation_assertion( ! inside ); + CGAL_assertion( std::get<0>(cur_after_walk)==nnext ); + CGAL_assertion( li==outside ); + CGAL_assertion( ! inside ); } return std::make_pair(prev_after_walk, cur_after_walk); case 2: if(regular_case) - CGAL_triangulation_assertion(degenerate ); + CGAL_assertion(degenerate ); std::get<1>(prev_after_walk) = Tr::EDGE; std::get<1>(cur_after_walk) = Tr::EDGE; @@ -574,11 +574,11 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre return std::make_pair(prev_after_walk, cur_after_walk); } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); case 1: if(regular_case) - CGAL_triangulation_assertion(degenerate ); + CGAL_assertion(degenerate ); std::get<1>(prev_after_walk) = Tr::VERTEX; std::get<1>(cur_after_walk) = Tr::VERTEX; @@ -592,22 +592,22 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre return std::make_pair(prev_after_walk, cur_after_walk); } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return std::make_pair(prev, cur); } } // The target lies inside this cell. Simplex prev_after_walk; - CGAL_triangulation_assertion( incell ); + CGAL_assertion( incell ); switch( op[0] + op[1] + op[2] + op[3] ) { case 4: - CGAL_triangulation_assertion( pos == 6 ); + CGAL_assertion( pos == 6 ); prev_after_walk = Simplex( std::get<0>(cur), Tr::CELL, -1, -1 ); - CGAL_triangulation_assertion( (! regular_case) || inside ); + CGAL_assertion( (! regular_case) || inside ); break; case 3: @@ -626,7 +626,7 @@ Triangulation_segment_cell_iterator_3::walk_to_next_3(const Simplex& pre break; default: prev_after_walk = Simplex( std::get<0>(cur), Tr::OUTSIDE_AFFINE_HULL, -1, -1 ); - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); } Simplex cur_after_walk(Cell_handle(), Tr::OUTSIDE_AFFINE_HULL, -1, -1); @@ -637,7 +637,7 @@ template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next_3_inf( int inf ) { - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); // If this cell was reached by traversal from a finite one, it must be the final cell. Cell_handle fin = cell()->neighbor(inf); @@ -664,7 +664,7 @@ walk_to_next_3_inf( int inf ) } vert[inf] = &(_source); - CGAL_triangulation_assertion( _tr->orientation( *vert[0], *vert[1], *vert[2], *vert[3] ) == POSITIVE ); + CGAL_assertion( _tr->orientation( *vert[0], *vert[1], *vert[2], *vert[3] ) == POSITIVE ); int li = 0; // Check if the line enters an adjacent infinite cell. @@ -694,7 +694,7 @@ walk_to_next_3_inf( int inf ) // The target lies behind the plane through the source and two finite vertices. // Traverse to the incident infinite cell. - CGAL_triangulation_assertion( _tr->is_infinite( next ) ); + CGAL_assertion( _tr->is_infinite( next ) ); _prev = Simplex( cell(), Tr::FACET, li, -1 ); _cur = Simplex( next, Tr::FACET, next->index( prev_cell() ), -1 ); return; @@ -725,7 +725,7 @@ walk_to_next_3_inf( int inf ) return; } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; case 1: prev_lt() = Tr::VERTEX; @@ -737,10 +737,10 @@ walk_to_next_3_inf( int inf ) return; } } - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; } } @@ -802,7 +802,7 @@ walk_to_next_2() return; default: // The current vertex is the target. - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return; } } @@ -829,7 +829,7 @@ walk_to_next_2() _prev = Simplex( cell(), Tr::VERTEX, li(), -1 ); break; case 0: - CGAL_triangulation_assertion(false); + CGAL_assertion(false); _prev = Simplex( cell(), Tr::OUTSIDE_AFFINE_HULL, -1, -1 ); break; } @@ -929,7 +929,7 @@ walk_to_next_2() if( op == POSITIVE ) _prev = Simplex( cell(), Tr::FACET, 3, -1 ); else { - CGAL_triangulation_assertion( op == ZERO ); + CGAL_assertion( op == ZERO ); switch( o ) { case POSITIVE: _prev = Simplex( cell(), Tr::EDGE, li(), lk ); @@ -1006,7 +1006,7 @@ walk_to_next_2() this->li() = cell()->index( prev_cell()->vertex( prev_li() ) ); return; default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); return; } } @@ -1017,7 +1017,7 @@ walk_to_next_2() return; } default: - CGAL_triangulation_assertion( false ); + CGAL_assertion( false ); } } @@ -1025,8 +1025,8 @@ template < class Tr, class Inc > void Triangulation_segment_cell_iterator_3:: walk_to_next_2_inf( int inf ) { - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(3) ) ); - CGAL_triangulation_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(3) ) ); + CGAL_precondition( _tr->is_infinite( cell()->vertex(inf) ) ); // If this cell was reached by traversal from a finite one, it must be the final cell. Cell_handle fin = cell()->neighbor(inf); @@ -1126,9 +1126,9 @@ typename Triangulation_segment_cell_iterator_3::Edge Triangulation_segment_cell_iterator_3::opposite_edge( Cell_handle c, int li, int lj) const { - CGAL_triangulation_precondition(li >= 0 && li < 4); - CGAL_triangulation_precondition(lj >= 0 && lj < 4); - CGAL_triangulation_precondition(li != lj); + CGAL_precondition(li >= 0 && li < 4); + CGAL_precondition(lj >= 0 && lj < 4); + CGAL_precondition(li != lj); switch (6 - li - lj) { // i + j + missing indices = 6. case 1: return Edge(c, 0, 1); @@ -1138,7 +1138,7 @@ Triangulation_segment_cell_iterator_3::opposite_edge( case 5: return Edge(c, 2, 3); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return Edge(); } diff --git a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h index 927342b96be..de2bacddbbf 100644 --- a/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_cell_base_3.h @@ -19,7 +19,6 @@ #include -#include #include namespace CGAL { diff --git a/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h b/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h index 479d550af63..bc9c8ff3cb6 100644 --- a/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_geom_traits_3.h @@ -22,8 +22,6 @@ #include -#include - namespace CGAL { template < class Repres > diff --git a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h index 7f8b2ce1dd3..8553a34a1b3 100644 --- a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -358,8 +358,8 @@ public: template < typename InputIterator > size_type remove_cluster(InputIterator first, InputIterator beyond) { - CGAL_triangulation_precondition(!this->does_repeat_in_range(first, beyond)); - CGAL_triangulation_precondition(!this->infinite_vertex_in_range(first, beyond)); + CGAL_precondition(!this->does_repeat_in_range(first, beyond)); + CGAL_precondition(!this->infinite_vertex_in_range(first, beyond)); size_type n = this->number_of_vertices(); std::vector vo(first, beyond), vc; int l=0; @@ -686,7 +686,7 @@ void Triangulation_hierarchy_3

    :: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); hierarchy[l]->remove(v); @@ -702,8 +702,8 @@ void Triangulation_hierarchy_3:: remove_and_give_new_cells(Vertex_handle v, OutputItCells fit) { - CGAL_triangulation_precondition(v != Vertex_handle()); - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(v != Vertex_handle()); + CGAL_precondition(!is_infinite(v)); for (int l = 0; l < maxlevel; ++l) { Vertex_handle u = v->up(); if(l) hierarchy[l]->remove(v); @@ -719,7 +719,7 @@ typename Triangulation_hierarchy_3::Vertex_handle Triangulation_hierarchy_3:: move_if_no_collision(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle ans; for (int l = 0; l < maxlevel; ++l) { @@ -739,7 +739,7 @@ typename Triangulation_hierarchy_3::Vertex_handle Triangulation_hierarchy_3:: move(Vertex_handle v, const Point & p) { - CGAL_triangulation_precondition(!this->is_infinite(v)); + CGAL_precondition(!this->is_infinite(v)); if(v->point() == p) return v; Vertex_handle w = move_if_no_collision(v,p); if(w != v) { @@ -756,7 +756,7 @@ Triangulation_hierarchy_3:: move_if_no_collision_and_give_new_cells( Vertex_handle v, const Point & p, OutputItCells fit) { - CGAL_triangulation_precondition(!is_infinite(v)); + CGAL_precondition(!is_infinite(v)); if(v->point() == p) return v; Vertex_handle ans; for (int l = 0; l < maxlevel; ++l) { diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 76b0f7572e3..9aca45fae91 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -379,7 +379,7 @@ public: } // \} - bool operator==( Nullptr_t CGAL_triangulation_assertion_code(n) ) const; + bool operator==( Nullptr_t CGAL_assertion_code(n) ) const; bool operator!=( Nullptr_t n ) const; protected: @@ -422,9 +422,9 @@ private: private: inline int edgeIndex( int i, int j ) const { - CGAL_triangulation_precondition( i>=0 && i<=3 ); - CGAL_triangulation_precondition( j>=0 && j<=3 ); - CGAL_triangulation_precondition( i != j ); + CGAL_precondition( i>=0 && i<=3 ); + CGAL_precondition( j>=0 && j<=3 ); + CGAL_precondition( i != j ); return ( i==0 || j==0 ) ? i+j-1 : i+j; } diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index fe5b2d041b2..9790692fd90 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -222,15 +222,23 @@ _test_cls_triangulation_3(const Triangulation &) } std::cout << " Constructor1 " << std::endl; - Point p10(0,0,0); - Vertex_handle v0=T0.insert(p10); + Vertex_handle v0=T0.insert(p[0]); assert(T0.dimension() == 0); assert(T0.number_of_vertices() == 1); assert(T0.is_valid()); + assert(T0 != Tm1); Cls T0d0(T0); assert(T0 == T0d0); + Cls T0d0b; + v0=T0d0b.insert(p[1]); + assert(T0d0b.dimension() == 0); + assert(T0d0b.number_of_vertices() == 1); + assert(T0d0b.is_valid()); + assert(T0d0b != T0d0); + assert(T0d0b != Tm1); + if (! del) // to avoid doing the following tests for both Delaunay // and non Delaunay triangulations { @@ -244,6 +252,7 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.dimension() == 1); assert(T0.number_of_vertices() == 2); assert(T0.is_valid()); + assert(T0 != T0d0); Cls T0d1(T0); assert(T0 == T0d1); @@ -261,6 +270,7 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.dimension() == 2); assert(T0.number_of_vertices() == 3); assert(T0.is_valid()); + assert(T0 != T0d1); Cls T0d2(T0); assert(T0 == T0d2); @@ -278,6 +288,7 @@ _test_cls_triangulation_3(const Triangulation &) assert(T0.dimension() == 3); assert(T0.number_of_vertices() == 4); assert(T0.is_valid()); + assert(T0 != T0d2); Cls T0d3(T0); assert(T0 == T0d3); diff --git a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp index 1ce3881222b..f37bb096413 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp @@ -288,16 +288,14 @@ bool test_case (std::istream &is) point_set points; Cls T; - int number = 0; do { - ++number; points.insert (*pi); T.insert (*pi); } while (++pi != pend); assert(T.is_valid()); - for (int i = 0; !points.empty(); ++i) { + while(! points.empty()) { assert(T.number_of_vertices() != 0); Vertex_handle v = T.finite_vertices_begin(); set_iterator pos = points.find (v->point()); @@ -376,4 +374,3 @@ int main(int argc, char **argv) return 0; } - diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h index 31158c0c9b1..9ccb879cffc 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -261,7 +261,7 @@ public: Face_handle f = Face_handle(), std::enable_if_t::value>* = nullptr) { - CGAL_triangulation_assertion((std::is_same::value)); + CGAL_assertion((std::is_same::value)); return insert(geom_traits().construct_point_on_sphere_2_object()(p), f); } @@ -474,7 +474,7 @@ typename Triangulation_on_sphere_2::Vertex_handle Delaunay_triangulation_on_sphere_2:: insert_third(const Point& p) { - CGAL_triangulation_assertion(number_of_vertices() == 2); + CGAL_assertion(number_of_vertices() == 2); Vertex_handle v = vertices_begin(); Vertex_handle u = v->face()->neighbor(0)->vertex(0); @@ -493,10 +493,10 @@ insert_third(const Point& p) nv->set_point(p); - CGAL_triangulation_assertion_code(Face_handle f = all_edges_begin()->first;) - CGAL_triangulation_assertion(orientation_on_sphere(point(f, 0), - point(f, 1), - point(f->neighbor(0), 1)) != RIGHT_TURN); + CGAL_assertion_code(Face_handle f = all_edges_begin()->first;) + CGAL_assertion(orientation_on_sphere(point(f, 0), + point(f, 1), + point(f->neighbor(0), 1)) != RIGHT_TURN); return nv; } @@ -516,7 +516,7 @@ insert_outside_affine_hull_regular(const Point& p) const Point& p1 = point(f, 1); const Point& p2 = point(fn, 1); - CGAL_triangulation_assertion(orientation_on_sphere(p0, p1, p2) != NEGATIVE); + CGAL_assertion(orientation_on_sphere(p0, p1, p2) != NEGATIVE); Orientation orient2 = side_of_oriented_circle(p0, p1, p2, p); if(orient2 == POSITIVE) @@ -587,7 +587,7 @@ insert(const Point& p, Locate_type lt, Face_handle loc, int /*li*/) } } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return v; } @@ -606,7 +606,7 @@ insert(const Point& p, Face_handle start) return Vertex_handle(); case TOO_CLOSE: { - CGAL_triangulation_assertion(loc != Face_handle()); + CGAL_assertion(loc != Face_handle()); return loc->vertex(li); } case VERTEX: @@ -661,7 +661,7 @@ insert(InputIterator first, InputIterator beyond, points.reserve(input_points.size()); for(const P3_wit& p3wi : p3_points) { - CGAL_triangulation_assertion(p3wi.input_point_ptr != nullptr); + CGAL_assertion(p3wi.input_point_ptr != nullptr); points.push_back(*(p3wi.input_point_ptr)); } @@ -715,7 +715,7 @@ bool Delaunay_triangulation_on_sphere_2:: update_ghost_faces(Vertex_handle v, bool first) { - CGAL_triangulation_assertion(dimension() == 2); + CGAL_assertion(dimension() == 2); bool ghost_found = false; @@ -736,7 +736,7 @@ update_ghost_faces(Vertex_handle v, bool first) } else // not first { - CGAL_triangulation_assertion(v != Vertex_handle()); + CGAL_assertion(v != Vertex_handle()); Face_circulator fc = this->incident_faces(v, v->face()); Face_circulator done(fc); do @@ -763,7 +763,7 @@ void Delaunay_triangulation_on_sphere_2:: remove_1D(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); tds().remove_1D(v); } @@ -792,7 +792,7 @@ void Delaunay_triangulation_on_sphere_2:: remove(Vertex_handle v) { - CGAL_triangulation_precondition(v != Vertex_handle()); + CGAL_precondition(v != Vertex_handle()); if(number_of_vertices() <= 3) tds().remove_dim_down(v); @@ -824,7 +824,7 @@ test_dim_down(Vertex_handle v) if(it4 == vertices_end()) break; - CGAL_triangulation_assertion(it != v && it2 != v && it3 != v && it4 != v); + CGAL_assertion(it != v && it2 != v && it3 != v && it4 != v); if(side_of_oriented_circle(it->point(), it2->point(), it3->point(), it4->point()) != ON_ORIENTED_BOUNDARY) return false; @@ -1134,7 +1134,7 @@ is_valid_face(Face_handle fh, bool verbose, int /*level*/) const { Orientation test = side_of_oriented_circle(fh, point(fh->vertex(i))); result = result && test == ON_ORIENTED_BOUNDARY; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } if(!result) @@ -1146,7 +1146,7 @@ is_valid_face(Face_handle fh, bool verbose, int /*level*/) const } } - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } @@ -1162,7 +1162,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << "invalid data structure" << std::endl; - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1177,18 +1177,18 @@ is_valid(bool verbose, int level) const case 0: break; case 1: - CGAL_triangulation_assertion(this->is_plane()); + CGAL_assertion(this->is_plane()); break; case 2: for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); ++it) { Orientation s = orientation_on_sphere(point(it, 0), point(it, 1), point(it, 2)); result = result && (s != NEGATIVE || it->is_ghost()); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } result = result && (number_of_faces() == 2 * number_of_vertices() - 4); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); break; } @@ -1196,7 +1196,7 @@ is_valid(bool verbose, int level) const if(verbose) std::cerr << " number of vertices " << number_of_vertices() << "\t" << std::endl; - CGAL_triangulation_assertion(result); + CGAL_assertion(result); return result; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h index 95c12831583..ffb5d002aa0 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include @@ -101,14 +101,14 @@ public: // Check if r is on the same side of the plane orthogonal to the plane (c,p,q) // and going through c and p as q const Orientation op = _lk.coplanar_orientation_3_object()(_center, p, q, r); - CGAL_triangulation_assertion(op != COLLINEAR); + CGAL_assertion(op != COLLINEAR); if(op == NEGATIVE) return false; // Check if r is on the same side of the plane orthogonal to the plane (c,p,q) // and going through c and q as p const Orientation oq = _lk.coplanar_orientation_3_object()(_center, q, p, r); - CGAL_triangulation_assertion(oq != COLLINEAR); + CGAL_assertion(oq != COLLINEAR); if(oq == NEGATIVE) return false; diff --git a/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h b/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h index fd3675e4b7c..82a073dc5c6 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Geographical_coordinates_traits_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include diff --git a/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h b/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h index 4f69f9bf179..5673c7f597e 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h +++ b/Triangulation_on_sphere_2/include/CGAL/Projection_on_sphere_traits_3.h @@ -17,8 +17,7 @@ #include #include - -#include +#include #include namespace CGAL { diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h index 0de37519ad3..743a1ca7026 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h @@ -16,7 +16,7 @@ #include -#include +#include #include #include #include @@ -417,7 +417,7 @@ public: Arc_on_sphere_2 segment_on_sphere(const Face_handle f, int i) const { - CGAL_triangulation_precondition(!is_ghost(f, i)); + CGAL_precondition(!is_ghost(f, i)); return geom_traits().construct_arc_on_sphere_2_object()(point(f, ccw(i)), point(f, cw(i))); } @@ -695,7 +695,7 @@ typename Triangulation_on_sphere_2::Face_handle Triangulation_on_sphere_2:: march_locate_1D(const Point& p, Locate_type& lt, int& li) const { - CGAL_triangulation_assertion(dimension() == 1); + CGAL_assertion(dimension() == 1); // Check if p is coplanar with the existing points first three points of the triangulation Face_handle f = all_edges_begin()->first; @@ -743,8 +743,8 @@ march_locate_2D(Face_handle f, Locate_type& lt, int& li) const { - CGAL_triangulation_precondition(dimension() == 2); - CGAL_triangulation_precondition(!is_ghost(f)); + CGAL_precondition(dimension() == 2); + CGAL_precondition(!is_ghost(f)); boost::rand48 rng; boost::uniform_smallint<> two(0, 1); @@ -973,7 +973,7 @@ march_locate_2D(Face_handle f, default: { // impossible - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return f; } } @@ -1221,21 +1221,21 @@ check_neighboring_faces() const { for(All_faces_iterator eit=all_faces_begin(); eit!=all_faces_end(); ++eit) { - CGAL_triangulation_assertion_code(const Face_handle f1 = eit->neighbor(0);) - CGAL_triangulation_assertion_code(const Face_handle f2 = eit->neighbor(1);) - CGAL_triangulation_assertion(f1->has_neighbor(eit)); - CGAL_triangulation_assertion(f2->has_neighbor(eit)); + CGAL_assertion_code(const Face_handle f1 = eit->neighbor(0);) + CGAL_assertion_code(const Face_handle f2 = eit->neighbor(1);) + CGAL_assertion(f1->has_neighbor(eit)); + CGAL_assertion(f2->has_neighbor(eit)); } } for(All_faces_iterator eit=all_faces_begin(); eit!=all_faces_end(); ++eit) { - CGAL_triangulation_assertion_code(const Face_handle f1 = eit->neighbor(0);) - CGAL_triangulation_assertion_code(const Face_handle f2 = eit->neighbor(1);) - CGAL_triangulation_assertion_code(const Face_handle f3 = eit->neighbor(2);) - CGAL_triangulation_assertion(f1->has_neighbor(eit)); - CGAL_triangulation_assertion(f2->has_neighbor(eit)); - CGAL_triangulation_assertion(f3->has_neighbor(eit)); + CGAL_assertion_code(const Face_handle f1 = eit->neighbor(0);) + CGAL_assertion_code(const Face_handle f2 = eit->neighbor(1);) + CGAL_assertion_code(const Face_handle f3 = eit->neighbor(2);) + CGAL_assertion(f1->has_neighbor(eit)); + CGAL_assertion(f2->has_neighbor(eit)); + CGAL_assertion(f3->has_neighbor(eit)); } } @@ -1257,7 +1257,7 @@ is_valid_vertex(Vertex_handle vh, bool verbose, int /*level*/) const show_face(vh->face()); } - CGAL_triangulation_assertion(false); + CGAL_assertion(false); return false; } @@ -1283,7 +1283,7 @@ is_valid(bool verbose, { const Orientation s = orientation(point(it1), point(it2), point(it3)); result = result && (s == COLLINEAR); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); ++it1; ++it2; ++it3; } } @@ -1292,7 +1292,7 @@ is_valid(bool verbose, for(All_faces_iterator it=all_faces_begin(); it!=all_faces_end(); ++it) { const Orientation s = orientation_on_sphere(point(it, 0), point(it, 1), point(it, 2)); - CGAL_triangulation_assertion(s == LEFT_TURN || is_ghost(it)); + CGAL_assertion(s == LEFT_TURN || is_ghost(it)); result = result && (s == LEFT_TURN || is_ghost(it)); } @@ -1301,7 +1301,7 @@ is_valid(bool verbose, // which does not know the number of components nor the genus result = result && (number_of_faces() == (2 * number_of_vertices() - 4)); - CGAL_triangulation_assertion(result); + CGAL_assertion(result); } return result; @@ -1340,7 +1340,7 @@ std::istream& operator>>(std::istream& is, Triangulation_on_sphere_2& tr) { tr.file_input(is); - CGAL_triangulation_assertion(tr.is_valid()); + CGAL_assertion(tr.is_valid()); return is; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h index fb5ba3d6605..3995430c2d9 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -94,7 +94,7 @@ bool write_OFF(std::ostream& os, index_of_vertex[vh] = i; } - CGAL_triangulation_assertion(i == n); + CGAL_assertion(i == n); size_type number_of_triangles = 0; for(Face_iterator fit = dt.all_faces_begin() ; fit != dt.all_faces_end() ; ++fit) diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h index 10ca5b89fc7..fbe52979939 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/internal/arc_on_sphere_2_subsampling.h @@ -15,7 +15,7 @@ #include -#include +#include #include #ifdef CGAL_EIGEN3_ENABLED @@ -103,7 +103,7 @@ void subsample_arc_on_sphere_2(const typename Kernel::Circle_3& circle, if(source > target) target += 2*CGAL_PI; - CGAL_triangulation_assertion(target > source); + CGAL_assertion(target > source); const double radius = sqrt(circle.squared_radius()); const double edge_len = (target - source) * radius; @@ -115,7 +115,7 @@ void subsample_arc_on_sphere_2(const typename Kernel::Circle_3& circle, for(int i=0; i(circle.center(), radius, current_theta, b1, b2); } *out_pts++ = compute_point(circle.center(), radius, target, b1, b2); diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h index e863d91a638..aa7ffa1ba47 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_sphere_line_face_circulator_2.h @@ -14,7 +14,7 @@ #include -#include +#include namespace CGAL { @@ -347,7 +347,7 @@ inline bool Triangulation_sphere_line_face_circulator_2:: operator==(Nullptr_t CGAL_assertion_code(n)) const { - CGAL_triangulation_assertion(n == NULL); + CGAL_assertion(n == NULL); return pos == Face_handle(); } @@ -356,7 +356,7 @@ inline bool Triangulation_sphere_line_face_circulator_2:: operator!=(Nullptr_t n) const { - CGAL_triangulation_assertion(n == NULL); + CGAL_assertion(n == NULL); return !(*this == n); } diff --git a/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h b/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h index 63596be4174..a57dee947cf 100644 --- a/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h +++ b/Visibility_2/test/Visibility_2/include/CGAL/test_utils.h @@ -858,7 +858,6 @@ typename Arrangement_2::Face_const_handle construct_biggest_arr_with_no_holes( Ccb_halfedge_const_circulator curr; Face_const_iterator fit; - int cnt(0); for (fit = arr_in.faces_begin() ; fit != arr_in.faces_end() ; fit++) { if (fit->has_outer_ccb()) { Ccb_halfedge_const_circulator circ = fit->outer_ccb(); @@ -868,7 +867,6 @@ typename Arrangement_2::Face_const_handle construct_biggest_arr_with_no_holes( curr_max_circ = circ; } } - cnt++; } std::vector segments; diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h index 3f58af9a3bb..63819bc0afc 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h @@ -329,6 +329,8 @@ void print_report(const VDA& vda, const Projector& project, std::cout << "# of Voronoi cells: " << n_all << std::endl; std::cout << "# of Voronoi cells with empty interior: " << n_empty << std::endl; +#else + CGAL_USE(n_vert); CGAL_USE(n_all); CGAL_USE(n_empty); #endif std::cout << "is Voronoi diagram valid? " diff --git a/Weights/include/CGAL/Weights/tangent_weights.h b/Weights/include/CGAL/Weights/tangent_weights.h index 03c8e91ad5b..da4c87d0fdd 100644 --- a/Weights/include/CGAL/Weights/tangent_weights.h +++ b/Weights/include/CGAL/Weights/tangent_weights.h @@ -461,7 +461,7 @@ namespace Weights { const auto v1 = construct_vector_2(q, r); const auto v2 = construct_vector_2(q, p); - const auto A = internal::area_2(traits, p, q, r); + const auto A = internal::positive_area_2(traits, p, q, r); CGAL_assertion(A != FT(0)); // three points are identical! const auto S = scalar_product_2(v1, v2); m_w_base = -tangent_half_angle(m_d_r, m_d_p, A, S); diff --git a/Weights/package_info/Weights/dependencies b/Weights/package_info/Weights/dependencies new file mode 100644 index 00000000000..4ff65640789 --- /dev/null +++ b/Weights/package_info/Weights/dependencies @@ -0,0 +1,15 @@ +Algebraic_foundations +BGL +Circulator +Installation +Interval_support +Kernel_23 +Modular_arithmetic +Number_types +Polygon +Profiling_tools +Property_map +Random_numbers +STL_Extension +Stream_support +Weights